You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The armv7 architecture should be able to deal with the armv6t2 instruction set for moving 16 bit values.
// current clang inline assembler bug for: /usr/local/bin/clang -march=armv7 -ccc-host-triple arm-apple-darwin11 -c test.c
#ifdef arm
int test(void) {
int val;
asm (
//"mov %[r0], #0xff \n\t" // old ARM way for 1023 constant (works)
//"orr %[r0], %[r0], #0x300 \n\t"
"movw %[r0], #1023 \n\t" // new ARMv6T2 way for 16 bit wide constants
"movt %[r0], #0 \n\t"
: [r0] "=r" (val)
);
return val;
}
#endif
Currently this results in an error:
test.c:8:7: error: instruction requires: armv6t2
"movw %[r0], #1023 \n\t" // new ARMv6T2 way for 16 bit wide constants
^
:1:2: note: instantiated into assembly here
movw r0, #1023
The text was updated successfully, but these errors were encountered:
Extended Description
The armv7 architecture should be able to deal with the armv6t2 instruction set for moving 16 bit values.
// current clang inline assembler bug for: /usr/local/bin/clang -march=armv7 -ccc-host-triple arm-apple-darwin11 -c test.c
#ifdef arm
int test(void) {
int val;
asm (
//"mov %[r0], #0xff \n\t" // old ARM way for 1023 constant (works)
//"orr %[r0], %[r0], #0x300 \n\t"
"movw %[r0], #1023 \n\t" // new ARMv6T2 way for 16 bit wide constants
"movt %[r0], #0 \n\t"
: [r0] "=r" (val)
);
return val;
}
#endif
Currently this results in an error:
test.c:8:7: error: instruction requires: armv6t2
"movw %[r0], #1023 \n\t" // new ARMv6T2 way for 16 bit wide constants
^
:1:2: note: instantiated into assembly here
movw r0, #1023
The text was updated successfully, but these errors were encountered: