[llvm-dev] Add a custom intrinsic to the ARM backend

Max Muster via llvm-dev llvm-dev at lists.llvm.org
Fri Feb 10 02:12:19 PST 2017


Hi,

I'm trying to add a new intrinsic to the ARM backend. The intrinsic should
a custom comparison.
To do so, I started with first defining the intrinsic in
llvm/include/llvm/IR/intrinsicsARM.td:

def int_foo_cmp : Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], []>;

The second step I did is adding a new pseudo instruction matching that
intrinsic in lib/Target/ARM/ARMInstInfo.td:

def FOO_CMP : PseudoInst<(outs GPR:$Rd), (ins GPR:$src1, GPR:$src2),
IIC_iCMPi,
                         [(set GPR:$Rd, (int_foo_cmp GPR:$src1,
GPR:$src2))]>;

Now I am a bit lost how to proceed. I want the instrinsic to do a certain
comparison chain and want to avoid any optimization on them.
Can someone guide me on how to proceed and emit machine instructions for
that intrinsic?

Thanks & Cheers
Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170210/6e36ab51/attachment.html>


More information about the llvm-dev mailing list