summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/R600/SIInstrInfo.td
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Target/R600/SIInstrInfo.td')
-rw-r--r--llvm/lib/Target/R600/SIInstrInfo.td12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/R600/SIInstrInfo.td b/llvm/lib/Target/R600/SIInstrInfo.td
index 655a8b1641a..067a34bf479 100644
--- a/llvm/lib/Target/R600/SIInstrInfo.td
+++ b/llvm/lib/Target/R600/SIInstrInfo.td
@@ -21,11 +21,23 @@ def LO32 : SDNodeXForm<imm, [{
return CurDAG->getTargetConstant(N->getZExtValue() & 0xffffffff, MVT::i32);
}]>;
+def LO32f : SDNodeXForm<fpimm, [{
+ uint64_t val = N->getValueAPF().bitcastToAPInt().getZExtValue() & 0xffffffff;
+ float *fval = reinterpret_cast<float *>(&val);
+ return CurDAG->getTargetConstantFP(*fval, MVT::f32);
+}]>;
+
// Transformation function, extract the upper 32bit of a 64bit immediate
def HI32 : SDNodeXForm<imm, [{
return CurDAG->getTargetConstant(N->getZExtValue() >> 32, MVT::i32);
}]>;
+def HI32f : SDNodeXForm<fpimm, [{
+ uint64_t val = N->getValueAPF().bitcastToAPInt().getZExtValue() >> 32;
+ float *fval = reinterpret_cast<float *>(&val);
+ return CurDAG->getTargetConstantFP(*fval, MVT::f32);
+}]>;
+
def IMM8bitDWORD : ImmLeaf <
i32, [{
return (Imm & ~0x3FC) == 0;
OpenPOWER on IntegriCloud