search for: retreg

Displaying 2 results from an estimated 2 matches for "retreg".

Did you mean: retred
2011 Apr 26
2
[LLVMdev] Symbol folding with MC
...ith global symbols but i guess that other symbol types should be equivalent. My first question is how can i negate the address of a symbol? Consider this piece of code: char g_var[80]; char foo(int a) { return g_var[a]; } this gets compiles into something like (in pseudo asm): addi a, g_var load retreg, a but i dont have an add with immediate instruction so i have to do the following subi a, -g_var // negate g_var addr load retreg, a A solution I thought could be passing a target flag indicating that a negation is needed when lowering the machineinstr into a MCInst, and adding a MCExpr to negat...
2011 Apr 26
0
[LLVMdev] Symbol folding with MC
...pes should be equivalent. > > My first question is how can i negate the address of a symbol? > > Consider this piece of code: > char g_var[80]; > char foo(int a) { return g_var[a]; } > > this gets compiles into something like (in pseudo asm): > addi a, g_var > load retreg, a > > but i dont have an add with immediate instruction so i have to do the following > subi a, -g_var // negate g_var addr > load retreg, a > > A solution I thought could be passing a target flag indicating that a negation is needed when lowering the machineinstr into a MCInst...