search for: g_val

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

Did you mean: _val
2011 Apr 26
2
[LLVMdev] Symbol folding with MC
...ave something like: unsigned int g_var[80]; unsigned int foo() { return (unsigned int)&g_var[0] & 0x1234; } Currently this moves the g_var address into a register and then performs the and operation, but i want this to be done at compilation time, so we have something like: move retreg, (g_val & 0x1234) Without touching anything else only additions get folded, but this could be expanded into other operations like or, xor, shifts, etc.. A more complex case would be combining operations in a single statement. So my question is how to achieve this. As an idea I've thought of using...
2011 Apr 26
0
[LLVMdev] Symbol folding with MC
...gned int g_var[80]; > unsigned int foo() { return (unsigned int)&g_var[0] & 0x1234; } > > Currently this moves the g_var address into a register and then performs the and operation, but i want this to be done at compilation time, so we have something like: > > move retreg, (g_val & 0x1234) > For many targets this isn't legal, as the object file format used can't represent those sorts of expressions in a relocation. It sounds like your situation is different, though. > Without touching anything else only additions get folded, but this could be expanded i...