problem with sgt's on Sparc machine

Hi,

I compiled the following code on a Sparc machine, basically it produce different results than a X86 machine.

Hi,

target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"

if you are using this target data layout and triple on a Sparc machine,
I'm not surprised you get wrong results.

Ciao, Duncan.

Hi Duncan,

Thanks for the reply! There is no LLVM on the Sparc machine so I cannot compile my code there into .s file. How shall I modify the target data layout and triple so it works on Sparc? Basically I got these from compiling C code using llvm-gcc.

Best,
Christine

You can use clang for that:
clang -ccc-host-triple sparc-unknown-linux -ccc-clang-archs sparc ...

Hi guys,

Thanks for the input. However, it seems that the code still produces the wrong output on a Sparc machine.

My current llvm_print.bc code is:

Hi,

Hello,

  What is your LLVM version? Also, can you attach the assembly generated?

Thanks,
Venkatraman

Hi Venkatraman,

I am using LLVM 2.8 and llvm-gcc 4.2.

The assembly files are attached. In the assembly file, the erroneous result is associated with ‘subcc’, while the correct ones are associated with ‘or’.

Thanks a lot!

Christine

llvm_print.bc (1.41 KB)

llvm_print.s (1.43 KB)

Hi Christine,

I am using LLVM 2.8 and llvm-gcc 4.2.

Could you please try svn top-of-tree? Clang is also a better choice here.

I can't reproduce this problem with the recent svn trunk. LLVM 2.9 has
lots of fixes for Sparc back-end. So, please at least try with
LLVM-2.9.

Thanks,

Hi guys,

Thanks for all the input! Let me try llvm 2.9 first.

Have a nice weekend.

Christine