Displaying 4 results from an estimated 4 matches for "ch8_3".
2013 Feb 20
3
[LLVMdev] Is va_arg correct on Mips backend?
...(arg_ptr1+8 or arg_ptr2+8). I assume the #BB#4 and #BB#5 are the arg_ptr which is the pointer to access the stack arguments.
2. Question:
Stack memory 28($sp) has no initial value. If this memory address is a relocation record which set value by linker/loader, then it maybe is correct.
clang -c ch8_3.cpp -emit-llvm -o ch8_3.bc
llc -march=mips -relocation-model=pic -filetype=asm ch8_3.bc -o ch8_3.mips.s
.section .mdebug.abi32
.previous
.file "ch8_3.bc"
.text
.globl _Z5sum_iiz
.align 2
.type _Z5sum_iiz, at function
.set nomips16 # @_Z5sum_iiz
.ent _Z5sum_iiz
_Z5...
2013 Feb 20
0
[LLVMdev] Is va_arg correct on Mips backend?
Does it make a difference if you give the "-target" option to clang?
$ clang -target mips-linux-gnu ch8_3.cpp -o ch8_3.bc -emit-llvm -c
The .s file generated this way looks quite different from the one in your
email.
On Tue, Feb 19, 2013 at 5:06 PM, Jonathan <gamma_chen at yahoo.com.tw> wrote:
> I didn't have Mips board. I compile as the commands and check the asm
> output as below....
2013 Feb 19
2
[LLVMdev] Is va_arg correct on Mips backend?
I check the Mips backend for the following C code fragment compile result. It seems not correct. Is it my misunderstand or it's a bug.
//ch8_3.cpp
#include <stdarg.h>
int sum_i(int amount, ...)
{
int i = 0;
int val = 0;
int sum = 0;
va_list vl;
va_start(vl, amount);
for (i = 0; i < amount; i++)
{
val = va_arg(vl, int);
sum += val;
}
va_end(vl);
return sum;
}
int main()
{
int a = sum_i(6, 1, 2...
2013 Feb 19
0
[LLVMdev] Is va_arg correct on Mips backend?
...n a mips board. It returns
the expected result (21).
On Tue, Feb 19, 2013 at 4:15 AM, Jonathan <gamma_chen at yahoo.com.tw> wrote:
> I check the Mips backend for the following C code fragment compile result.
> It seems not correct. Is it my misunderstand or it's a bug.
>
> //ch8_3.cpp
> #include <stdarg.h>
>
> int sum_i(int amount, ...)
> {
> int i = 0;
> int val = 0;
> int sum = 0;
>
> va_list vl;
> va_start(vl, amount);
> for (i = 0; i < amount; i++)
> {
> val = va_arg(vl, int);
> sum += val;
> }...