Daily Archives: January 26, 2025

LLVM Exercise III

Let us return a larger constant: int foo() { return 0xFF; } For numbers up to 12 bits we can use the LDI S&X instruction. Some code snippets: def immSExt12 : PatLeaf<(imm), [{ return isInt<12>(N->getSExtValue()); }]>; def : Pat<(i32 immSExt12:$in), (LDI imm:$in)>; def LDI : HP41MCODEInst<0x130, (outs RC:$r), (ins i32imm:$sx), “LDI S&X HEX: $sx”, [(set … Continue reading »

Categories: Uncategorized | Comments Off on LLVM Exercise III