Mercurial > repos > tabletprog
comparison modules/x86.tp @ 315:f987bb2a1911
WIP native compiler work
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 14 Mar 2015 12:10:51 -0700 |
parents | a8dffa4d4b54 |
children | a840e9a068a2 |
comparison
equal
deleted
inserted
replaced
314:d4df33596e7d | 315:f987bb2a1911 |
---|---|
730 opmap <- #[ | 730 opmap <- #[ |
731 { outarr append: (add: (inst in) (inst out) (mapSize: (inst size))) } | 731 { outarr append: (add: (inst in) (inst out) (mapSize: (inst size))) } |
732 { outarr append: (and: (inst in) (inst out) (mapSize: (inst size))) } | 732 { outarr append: (and: (inst in) (inst out) (mapSize: (inst size))) } |
733 { outarr append: (or: (inst in) (inst out) (mapSize: (inst size))) } | 733 { outarr append: (or: (inst in) (inst out) (mapSize: (inst size))) } |
734 { outarr append: (xor: (inst in) (inst out) (mapSize: (inst size))) } | 734 { outarr append: (xor: (inst in) (inst out) (mapSize: (inst size))) } |
735 //mul | |
736 //div | |
735 { outarr append: (sub: (inst in) (inst out) (mapSize: (inst size))) } | 737 { outarr append: (sub: (inst in) (inst out) (mapSize: (inst size))) } |
736 { outarr append: (cmp: (inst in) (inst out) (mapSize: (inst size))) } | 738 { outarr append: (cmp: (inst in) (inst out) (mapSize: (inst size))) } |
737 { outarr append: (bnot: (inst arg) (mapSize: (inst size))) } | 739 { outarr append: (bnot: (inst arg) (mapSize: (inst size))) } |
738 { outarr append: (shl: (inst in) (inst out) (mapSize: (inst size))) } //sl | 740 { outarr append: (shl: (inst in) (inst out) (mapSize: (inst size))) } //sl |
739 { outarr append: (sar: (inst in) (inst out) (mapSize: (inst size))) } //asr | 741 { outarr append: (sar: (inst in) (inst out) (mapSize: (inst size))) } //asr |
784 foreach: (inst toskip) :_ inst { | 786 foreach: (inst toskip) :_ inst { |
785 convertIL: inst to: outarr withLabels: labels withSaved: saved | 787 convertIL: inst to: outarr withLabels: labels withSaved: saved |
786 } | 788 } |
787 outarr append: endlab | 789 outarr append: endlab |
788 } | 790 } |
791 //skipIf:else | |
789 { | 792 { |
790 //save | 793 //save |
791 newsave <- [] | 794 newsave <- [] |
792 foreach: (inst tosave) :_ reg { | 795 foreach: (inst tosave) :_ reg { |
793 outarr append: (push: reg) | 796 outarr append: (push: reg) |
800 foreach: newsave :_ reg { | 803 foreach: newsave :_ reg { |
801 outarr append: (pop: reg) | 804 outarr append: (pop: reg) |
802 } | 805 } |
803 } | 806 } |
804 } | 807 } |
808 //bool | |
805 ] | 809 ] |
806 fun <- opmap get: (inst opcode) | 810 fun <- opmap get: (inst opcode) |
807 fun: | 811 fun: |
808 outarr | 812 outarr |
809 } | 813 } |