From: Stepan D. <stp...@na...> - 2013-06-27 10:33:31
|
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 |
From: Stepan D. <stp...@na...> - 2013-06-27 10:34:52
|
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 > |
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 >> > |
From: Borja F. <bor...@gm...> - 2013-06-27 17:57:03
|
1) I think this now resolved. 2) I will take a look, no idea about it now. 2013/6/27 Stepan Dyatkovskiy <stp...@na...> > 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<http://p.sf.net/sfu/windows-dev2dev> >>> ______________________________**_________________ >>> avr-llvm-devel mailing list >>> avr-llvm-devel@lists.**sourceforge.net<avr...@li...> >>> https://lists.sourceforge.net/**lists/listinfo/avr-llvm-devel<https://lists.sourceforge.net/lists/listinfo/avr-llvm-devel> >>> >>> >> > |
From: Stepan D. <stp...@na...> - 2013-06-27 18:01:28
|
Good ) Currently I'm working on multi-byte constraints. Once it would be done, hope we can compile avr-libc. -Stepan. Borja Ferrer wrote: > 1) I think this now resolved. > 2) I will take a look, no idea about it now. > > > 2013/6/27 Stepan Dyatkovskiy <stp...@na... <mailto:stp...@na...>> > > 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 > <http://p.sf.net/sfu/windows-dev2dev> > _________________________________________________ > avr-llvm-devel mailing list > avr-llvm-devel@lists.__sourceforge.net > <mailto:avr...@li...> > https://lists.sourceforge.net/__lists/listinfo/avr-llvm-devel <https://lists.sourceforge.net/lists/listinfo/avr-llvm-devel> > > > > |
From: Borja F. <bor...@gm...> - 2013-06-27 18:04:52
|
Ok, remember that there's an additional constraint to print memory registers as X, Y, Z instead of r26, etc... it's described in the avr libc manual. This one should be easier than the multi byte constraints. 2013/6/27 Stepan Dyatkovskiy <stp...@na...> > Good ) Currently I'm working on multi-byte constraints. Once it would be > done, hope we can compile avr-libc. > > -Stepan. > > Borja Ferrer wrote: > >> 1) I think this now resolved. >> 2) I will take a look, no idea about it now. >> >> >> 2013/6/27 Stepan Dyatkovskiy <stp...@na... <mailto:stp...@na... >> >> >> >> >> 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<http://p.sf.net/sfu/windows-__dev2dev> >> <http://p.sf.net/sfu/windows-**dev2dev<http://p.sf.net/sfu/windows-dev2dev> >> > >> ______________________________**___________________ >> avr-llvm-devel mailing list >> avr-llvm-devel@lists.__sourcef**orge.net<http://sourceforge.net> >> <mailto:avr-llvm-devel@lists.**sourceforge.net<avr...@li...> >> > >> https://lists.sourceforge.net/**__lists/listinfo/avr-llvm-** >> devel <https://lists.sourceforge.net/__lists/listinfo/avr-llvm-devel> < >> https://lists.sourceforge.**net/lists/listinfo/avr-llvm-**devel<https://lists.sourceforge.net/lists/listinfo/avr-llvm-devel> >> > >> >> >> >> >> > |