search for: va_arg_gpr

Displaying 3 results from an estimated 3 matches for "va_arg_gpr".

2007 Apr 03
3
[LLVMdev] Implementing a complicated VAARG
...It is largely more complicated than the Macho ABI or x86 because it manipulates a struct instead of a direct pointer in the stack. You can find the layout of the va_list struct at the end of this mail. A VAARG call requires a lot of computation. Typically the C code for va_arg(ap, int) is: int va_arg_gpr(ap_list ap) { int idx = ap->gpr; if (idx < 8) { ap->gpr = idx + 1; return ap->reg_save_area[idx]; } else { int res = ap->overflow_arg_area[0]; ap->gpr = idx + 1; ap->overflow_arg_area += 4; return res; } } Actually, a...
2007 Apr 03
0
[LLVMdev] Implementing a complicated VAARG
On Tue, 3 Apr 2007, Nicolas Geoffray wrote: > A VAARG call requires a lot of computation. Typically the C code for > va_arg(ap, int) If you use va_arg in C, are you seeing llvm.vaarg in the output .ll file? -Chris > is: > > int va_arg_gpr(ap_list ap) { > int idx = ap->gpr; > if (idx < 8) { > ap->gpr = idx + 1; > return ap->reg_save_area[idx]; > } > else { > int res = ap->overflow_arg_area[0]; > ap->gpr = idx + 1; > ap->overflow_arg_area += 4; &g...
2007 Apr 03
1
[LLVMdev] Implementing a complicated VAARG
...PPC. Btw, I'm using the JIT of llvm, not llvm-gcc, I do not code in C to generate llvm code, but in "MyLanguage". And I want "MyLanguage" to have variadic functions and interoperate with C code. Cheers, Nicolas > -Chris > > >> is: >> >> int va_arg_gpr(ap_list ap) { >> int idx = ap->gpr; >> if (idx < 8) { >> ap->gpr = idx + 1; >> return ap->reg_save_area[idx]; >> } >> else { >> int res = ap->overflow_arg_area[0]; >> ap->gpr = idx + 1; >>...