integrated assembler should convert and foo, bar, immediate
into bic foo, bar, ~immediate
if immediate doesn't fit into the immediate field bit ~immediate does
#26094
Labels
Extended Description
When trying to build boringssl with clang's integrated assembler, it complains about this:
thakis@thakis:
/src/chrome/src$ cat arm.S/src/chrome/src$ third_party/llvm-build/Release+Asserts/bin/clang -c arm.S -march=armv7-a -target arm-linux-androideab.fpu neon
.text
.align 4
.global foo
.hidden foo
.type foo, %function
and sp, sp, #0xffffffe0
thakis@thakis:
arm.S:7:14: error: invalid operand for instruction
and sp, sp, #0xffffffe0
^
gas accepts this without complaints and converts it into a BIC instruction (a and not b), as ~0xffffffe0 = 1f fits into the 8bit unshifted immediate. The integrated assembler should do this too:
thakis@thakis:
/src/chrome/src$ third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -c arm.S/src/chrome/src$ third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-objdump -D -marm arm.othakis@thakis:
arm.o: file format elf32-littlearm
Disassembly of section .text:
00000000 <.text>:
0: e3cdd01f bic sp, sp, #31
4: e1a00000 nop ; (mov r0, r0)
8: e1a00000 nop ; (mov r0, r0)
c: e1a00000 nop ; (mov r0, r0)
The text was updated successfully, but these errors were encountered: