[llvm-commits] CVS: llvm/lib/Target/SparcV8/SparcV8InstrInfo.td
Chris Lattner
lattner at cs.uiuc.edu
Sat Dec 17 11:41:55 PST 2005
Changes in directory llvm/lib/Target/SparcV8:
SparcV8InstrInfo.td updated: 1.54 -> 1.55
---
Log message:
Use a combination of sethi and or to build arbitrary immediates.
---
Diffs of the changes: (+7 -0)
SparcV8InstrInfo.td | 7 +++++++
1 files changed, 7 insertions(+)
Index: llvm/lib/Target/SparcV8/SparcV8InstrInfo.td
diff -u llvm/lib/Target/SparcV8/SparcV8InstrInfo.td:1.54 llvm/lib/Target/SparcV8/SparcV8InstrInfo.td:1.55
--- llvm/lib/Target/SparcV8/SparcV8InstrInfo.td:1.54 Sat Dec 17 13:37:00 2005
+++ llvm/lib/Target/SparcV8/SparcV8InstrInfo.td Sat Dec 17 13:41:43 2005
@@ -39,6 +39,10 @@
return (((int)N->getValue() << (32-13)) >> (32-13)) == (int)N->getValue();
}]>;
+def LO10 : SDNodeXForm<imm, [{
+ return CurDAG->getTargetConstant((unsigned)N->getValue() & 1023, MVT::i32);
+}]>;
+
def HI22 : SDNodeXForm<imm, [{
// Transformation function: shift the immediate value down into the low bits.
return CurDAG->getTargetConstant((unsigned)N->getValue() >> 10, MVT::i32);
@@ -580,3 +584,6 @@
// Small immediates.
def : Pat<(i32 simm13:$val),
(ORri G0, imm:$val)>;
+// Arbitrary immediates.
+def : Pat<(i32 imm:$val),
+ (ORri (SETHIi (HI22 imm:$val)), (LO10 imm:$val))>;
\ No newline at end of file
More information about the llvm-commits
mailing list