|
From: Stepan D. <stp...@na...> - 2013-06-27 13:35:07
|
BTW, for X86 target and memory constraint I got the same as for ARM:
call void asm "instr $0", "=*m,~{dirflag},~{fpsr},~{flags}"(i32* @a) #1,
!srcloc !0
It just uses 'm' instead of 'Q'. Note it also contains '*' before 'm'.
-Stepan.
Stepan Dyatkovskiy wrote:
> Agh!! MY grammar: Subject: One more differencE in clang. Would you fix
> it in your reply please.
> Thanks.
> -Stepan.
>
> Stepan Dyatkovskiy wrote:
>> Hi guys.
>>
>> Today I went through whole AVR-Libc Inline Assembler Cookbook chapter.
>> I have checked all examples with two commands:
>> 1. clang -S -o - -emit-llvm example.c
>> 2. avr-clang -S -o - -emit-llvm example.c
>>
>> I've found two difference:
>>
>> 1. As I mentioned before difference for memory constraint.
>> For string "asm("instr %0": "=Q"(a):)"
>>
>> clang emits:
>> %0 = call i32 asm "instr $0", "=Q,~{dirflag},~{fpsr},~{flags}"()
>>
>> arm-linux-gnueabi emits:
>> call void asm "instr $0", "=*Q"(i32* @a) #1, !srcloc !0
>>
>> avr-clang:
>> %0 = call i16 asm "instr $0", "=Q"()
>>
>> I'll try to use current syntax here. Though ARM syntax is working well
>> now, but I din't find explanation of =*Q sequence yet.
>>
>> 2. asm names.
>>
>> // example.c:
>> extern long Calc(void) asm ("CALCULATE");
>> void f() { Calc(); }
>>
>> clang emits:
>> %call = call i64 @CALCULATE()
>> ...
>> declare i64 @CALCULATE()
>>
>> avr-clang emits:
>> %call = call i32 @"\01CALCULATE"()
>> ...
>> declare i32 @"\01CALCULATE"()
>>
>> Does somebody know what \01 is used for here?
>>
>> -Stepan
>>
>> ------------------------------------------------------------------------------
>>
>> This SF.net email is sponsored by Windows:
>>
>> Build for Windows Store.
>>
>> http://p.sf.net/sfu/windows-dev2dev
>> _______________________________________________
>> avr-llvm-devel mailing list
>> avr...@li...
>> https://lists.sourceforge.net/lists/listinfo/avr-llvm-devel
>>
>
|