Gang-Ryung Uh
2011-Jul-15 17:13 UTC
[LLVMdev] LLVM and little-endian 32-bit MIPS code generation
Hi,
We have tried and generate assembly code for very simple test C code.
But, binutils-2.5.2 (simplesim-3.0) cannot handle the produced assembly code
with the following complaints. Could you advise which version of bitutils
that we need to use for mips code with LLVM with Clang? Thanks,
$ GCC addr01.s
addr01.s: Assembler messages:
addr01.s:1: Error: Unknown pseudo-op: `.section'
addr01.s:2: Error: Unknown pseudo-op: `.previous'
addr01.s:3: Error: Bad expression
addr01.s:3: Warning: Missing string
addr01.s:3: Error: Rest of line ignored. First ignored character is `a'.
addr01.s:3: Error: Rest of line ignored. First ignored character valued 0x9.
addr01.s:6: Warning: .type pseudo-op used outside of .def/.endef; ignored
addr01.s:6: Error: Rest of line ignored. First ignored character is `f'.
addr01.s:9: Warning: Unrecognized register name
addr01.s:17: Error: ERROR: Illegal operands `sw $ra,28($sp)'
addr01.s:19: Warning: Instruction addiu requires absolute expression
addr01.s:19: Error: ERROR: Illegal operands `addiu $5,$zero,1'
addr01.s:21: Error: Bad expression
addr01.s:21: Error: Bad expression
....
On Sun, Jul 10, 2011 at 10:22 PM, Akira Hatanaka <ahatanak at gmail.com>
wrote:
> It will produce little-endian code if you replace "mips" with
"mipsel".
>
> 1. clang -ccc-host-triple mipsel-unknown-linux -ccc-clang-archs mipsel -O3
> -S -emit-llvm foo.c -o foo.ll
> 2. llc -march=mipsel -mcpu=4ke foo.ll -o foo.s (the -march option is
> redundant)
>
> If you do not specify the target cpu with -mcpu, by default it will
> generate code for Mips1, which has not been tested as thoroughly as
Mips32r2
> (-mcpu=4ke) or Mips2 (-mcpu=mips2).
>
> The default ABI is o32.
>
> On Sat, Jul 9, 2011 at 8:32 AM, Gang-Ryung Uh <guh at boisestate.edu>
wrote:
>
>> We are trying to use LLVM (Clang as the C frontend) to generate code
for
>> 32-bit MIPS (little-endian)l, which can run on simplescalar 3.0
>> sslittle-na-sstrix platform. Can you advise what would be the right way
to
>> use the LLVM compiler infrastructure?
>>
>> The following is the one I used, but it appears that it produce the
code
>> in big-endian (and I wonder whether the calling convention is right.)
To
>> check the correctness of code generation in a quick and dirty way, I
don't
>> invoke LLVM "opt"
>>
>> (1) clang -emit-llvm hello.c -S -o hello.ll
>> (2) llvm-as hello.ll
>> (2) llc -march=mips hello.bc
>>
>> Thanks in advance.
>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
--
Gang-Ryung Uh, Associate Professor
Department of Computer Science
College of Engineering, Boise State Univerisity
tel: 1 208 426-5691 e-mail:guh at boisestate.edu
http://cs.boisestate.edu/~uh
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20110715/ea2222ea/attachment.html>
Eric Christopher
2011-Jul-15 17:39 UTC
[LLVMdev] LLVM and little-endian 32-bit MIPS code generation
On Jul 15, 2011, at 10:13 AM, Gang-Ryung Uh wrote:> Hi, > > We have tried and generate assembly code for very simple test C code. But, binutils-2.5.2 (simplesim-3.0) cannot handle the produced assembly code with the following complaints. Could you advise which version of bitutils that we need to use for mips code with LLVM with Clang? Thanks,Something released in the last 10 years maybe? Just download something recent from gnu.org and you should be fine. -eric
Gang-Ryung Uh
2011-Jul-15 21:55 UTC
[LLVMdev] LLVM and little-endian 32-bit MIPS code generation
Hi,
We would like to assemble .s file using binutils-2.5.2 which comes with
simple-scalar3.0. Unfortunately, this particular version of binutils doesn't
seem to handle global-offset-table (position independent code) and the some
of the mips instructions. Thanks,
On Fri, Jul 15, 2011 at 11:39 AM, Eric Christopher <echristo at
apple.com>wrote:
>
> On Jul 15, 2011, at 10:13 AM, Gang-Ryung Uh wrote:
>
> > Hi,
> >
> > We have tried and generate assembly code for very simple test C
code.
> But, binutils-2.5.2 (simplesim-3.0) cannot handle the produced assembly
code
> with the following complaints. Could you advise which version of bitutils
> that we need to use for mips code with LLVM with Clang? Thanks,
>
> Something released in the last 10 years maybe? Just download something
> recent from gnu.org and you should be fine.
>
> -eric
>
>
--
Gang-Ryung Uh, Associate Professor
Department of Computer Science
College of Engineering, Boise State Univerisity
tel: 1 208 426-5691 e-mail:guh at boisestate.edu
http://cs.boisestate.edu/~uh
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20110715/bc464234/attachment.html>
Apparently Analagous Threads
- [LLVMdev] LLVM and little-endian 32-bit MIPS code generation
- [LLVMdev] LLVM and little-endian 32-bit MIPS code generation
- [LLVMdev] LLVM and little-endian 32-bit MIPS code generation
- [LLVMdev] LLVM and little-endian 32-bit MIPS code generation
- [LLVMdev] MIPS 32bit code generation