[LLVMdev] Floating-Point Constants in TableGen?
justin.holewinski at gmail.com
Wed Sep 28 20:58:38 CDT 2011
Is it possible to represent floating-point constants in TableGen
Let's say I have the following pattern:
def : Pat<(i1 (trunc RegI16:$a)), (SETPGTu16ri RegI16:$a, 0)>;
Note the zero constant in the result. Is there a way to represent
floating-point literals in the same way? Something like...
def : Pat<(i1 (uint_to_fp RegF32:$a)), (SETPGTf32ri RegF32:$a, (f32
This unfortunately does not work. Right now I'm getting around this by
using alternate instructions to first convert from an integer immediate,
def : Pat<(i1 (uint_to_fp RegF32:$a)), (SETPGTf32ri RegF32:$a,
Since my back-end supports floating-point literals in the instructions, I'd
rather not introduce additional instructions needlessly.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the LLVMdev