SCM Repository
[smlnj] / sml / trunk / src / MLRISC / sparc / instructions / sparcPeephole.sml |
View of /sml/trunk/src/MLRISC/sparc/instructions/sparcPeephole.sml
Parent Directory
|
Revision Log
Revision 606 -
(download)
(annotate)
Sun Apr 9 23:10:59 2000 UTC (21 years ago) by leunga
File size: 753 byte(s)
Sun Apr 9 23:10:59 2000 UTC (21 years ago) by leunga
File size: 753 byte(s)
Assembly fix for x86 and other miscellaneous changes to MLRISC
functor SparcPeephole(SparcInstr : SPARCINSTR) : PEEPHOLE = struct structure I = SparcInstr (* IMPORTANT: instructions are given in reversed order *) fun peephole regmap instrs = let fun isZero(I.LAB le) = I.LabelExp.valueOf le = 0 | isZero(I.REG r) = regmap r = 0 | isZero(I.IMMED i) = i = 0 | isZero _ = false fun removable(I.ARITH{a=(I.ADD | I.SUB), r, i, d}) = regmap r = regmap d andalso isZero i | removable(I.ANNOTATION{i,a}) = removable i | removable _ = false fun loop([], instrs) = rev instrs | loop(i::rest, instrs) = if removable i then loop(rest, instrs) else loop(rest, i::instrs) in loop(instrs, []) end end
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |