[cfe-dev] [LLVMdev] [MIPS] How can I add a constraint to LLVM/Clang for MIPS BE?

Jia Liu proljc at gmail.com
Sat Mar 2 11:21:38 PST 2013


Hi Jack

On Sat, Mar 2, 2013 at 8:15 AM, Jack Carter <Jack.Carter at imgtec.com> wrote:
> Jia,
>
> I made what I believe to be the correct changes and rebuilt clang and llc. Are the results what you expected? I so I will prepare the patches for commitment.
>
> Jack
>
> clang ../mips_R_JiaLiu.c -o mips_R_JiaLiu.ll -emit-llvm -O3 -S -target mipsel-unknown-linux -std=gnu89
> llc mips_R_JiaLiu.ll -o mips_R_JiaLiu.o -mcpu=mips32r2 -march=mipsel -filetype=obj
> mips-linux-gnu-gcc -mips32r2 -O3 -EL -fPIC -o mips_R_JiaLiu.exe mips_R_JiaLiu.o
>
> inline_asm: run *.exe
> out is 4
> out is 10
> out is ccddffbb
> inline_asm:
>

llvm-install/bin/clang -target mipsel-unknown-linux-gnu -gcc-toolchain
$SDK/mipsel-linux-gnu --sysroot $SDK/mipsel-gnu-rootfs -S
constraints.c

inline_asm:
	#APP
	lw $2, 0($2)
	#NO_APP

	#APP
	lw $1, 0($1)
	#NO_APP

	#APP
	lwl $1, 1 + 0($1)
	lwr $1, 2 + 0($1)
	#NO_APP

Please cc me if you will send the patches, I wanna know what I missed.

And, will you please point what is wrong with my patches in my first mail?
I wonder how can I make it right.

Regards,
Jia



More information about the cfe-dev mailing list