[llvm-dev] lower 64 bits constant

Xiangyang Guo via llvm-dev
Wed, 02 Dec 2015 18:30:39 -0000

Hi, All,

I want to lower 64 Bits constant such as 'long' and 'double'. So
I define
them like this:

def CONSTI64 : InstFOO<(outs GRWideRegs:$dst),
                       (ins i64imm:$src),
                       "const-long $dst, $src",
                       [(set (i64 GRWideRegs:$dst), imm:$src)]>{
  let isMoveImm = 1;
}

def CONSTF64 : InstFOO<(outs GRWideRegs:$dst),
                       (ins f64imm:$src),
                       "const-double $dst, $src",
                       [(set (f64 GRWideRegs:$dst), fpimm:$src)]>{
  let isMoveImm = 1;
}

GRWideRegs can be f64 and i64. However, the 'const-long' works while the
'const-double' doesn't work. From the -debug log, it seems "f64
ConstantFP" is replaced by "f64,ch = load" and this is where the
error
happens. Can anyone tell me why this happens and how to make this work?

Any suggestion is appreciated.

Regards,

Xiangyang
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20151202/a35b8b98/attachment.html>