[GAS][ARM]Adjust tests with recent change to consolidate run_dump_test.

Renlin Li renlin.li@foss.arm.com
Tue Oct 2 14:02:00 GMT 2018


Hi Richard,


On 10/02/2018 01:39 PM, Richard Earnshaw (lists) wrote:
> On 02/10/18 12:33, Renlin Li wrote:
>> Hi all,
>>
>> After recent change to consolidate run_dump_test, the following regressions
>> on arm target are observed.
>>
>> arm-*-eabi  +FAIL: ARM v1 instructions
>> arm-*-eabi  +FAIL: Accepted v8-a with ARMv8.1 AdvSIMD.
>> arm-*-eabi  +FAIL: bl local instructions for v4t.
>> arm-*-eabi  +FAIL: UDF
>>
>> Here the patch adjusts those test cases.
>> Okay to commit?
>>
>> Renlin
>>
>> gas/ChangeLog:
>>
>> 2018-10-02  Renlin Li  <renlin.li@arm.com>
>>
>>      * testsuite/gas/arm/armv1.d: Adjust expected assembly.
>>      * testsuite/gas/arm/udf.d: Likewise.
> 
> Why has the encoding picked for NOP changed?
> 
> R.
> 

I have inlined the comment below. There are two places where encoding is changed.

>>
>>
>> diff --git a/gas/testsuite/gas/arm/armv1.d b/gas/testsuite/gas/arm/armv1.d
>> index 8b9759b96136d8726b6c4dfa5cbea1db7c712962..bea4c52339a4cbb1b3e43825fd80f994b5e44920 100644
>> --- a/gas/testsuite/gas/arm/armv1.d
>> +++ b/gas/testsuite/gas/arm/armv1.d
>> @@ -30,29 +30,29 @@ Disassembly of section .text:
...
>> -0+94 <[^>]*> e5900000 ?	ldr	r0, \[r0\]
>> -0+98 <[^>]*> e5d00000 ?	ldrb	r0, \[r0\]
>> -0+9c <[^>]*> e4b10000 ?	ldrt	r0, \[r1\]
>> -0+a0 <[^>]*> e4f10000 ?	ldrbt	r0, \[r1\]
>> -0+a4 <[^>]*> e5800000 ?	str	r0, \[r0\]
>> -0+a8 <[^>]*> e5c00000 ?	strb	r0, \[r0\]
>> -0+ac <[^>]*> e4a10000 ?	strt	r0, \[r1\]
>> -0+b0 <[^>]*> e4e10000 ?	strbt	r0, \[r1\]
>> +0+94 <[^>]*> e5100000 ?	ldr	r0, \[r0, \#-0\]
>> +0+98 <[^>]*> e5500000 ?	ldrb	r0, \[r0, #-0\]
>> +0+9c <[^>]*> e4b10000 ?	ldrt	r0, \[r1\], #0
>> +0+a0 <[^>]*> e4f10000 ?	ldrbt	r0, \[r1\], #0
>> +0+a4 <[^>]*> e5000000 ?	str	r0, \[r0, #-0\]
>> +0+a8 <[^>]*> e5400000 ?	strb	r0, \[r0, #-0\]
>> +0+ac <[^>]*> e4a10000 ?	strt	r0, \[r1\], #0
>> +0+b0 <[^>]*> e4e10000 ?	strbt	r0, \[r1\], #0


Here the encoding is changed for the U bit.
#-0 and and #0 is treated differently. +/- will be encoded in "U" bit.
and the value of offset will be encoded as 12-bit unsigned value in the encoding.


>> diff --git a/gas/testsuite/gas/arm/udf.d b/gas/testsuite/gas/arm/udf.d
>> index c8777a9f052e71ad679a27c64cf666afa1dcf38f..4a736ae9c0f02f3ac33486f074c2ae3bd85153ab 100644
>> --- a/gas/testsuite/gas/arm/udf.d
>> +++ b/gas/testsuite/gas/arm/udf.d
>> @@ -1,4 +1,4 @@
>> -#objdump: -dr --prefix-addresses --show-raw-insn
>> +#objdump: -dr
>>   #name: UDF
>>   #as: -march=armv8-a
>>   #warning_output: udf.l
>> @@ -11,11 +11,11 @@ Disassembly of section \.text:
>>   \s*0:\s+e7f000f0\s+udf	#0
>>   \s*4:\s+e7fabcfd\s+udf	#43981	; 0xabcd
>>   
>> -0+0 <thumb>:
>> +0+8 <thumb>:
>>   \s*8:\s+deab\s+udf	#171	; 0xab
>>   \s*a:\s+decd\s+udf	#205	; 0xcd
>>   \s*c:\s+de00\s+udf	#0
>> -\s*e:\s+46c0\s+nop.*
>> +\s*e:\s+bf00\s+nop.*

I have checked the nop encoding in thumb-16, it is 0xbf00.
And 0x46c0 is for MOV r8, r8.
By using unified syntax in the assembly, 0xbf00 will be used for NOP encoding.

It seems that, before the change to consolidate the test, the object dump pattern is not checked against.

Thanks,
Renlin

>>   \s*10:\s+f7f0 a000\s+udf\.w	#0
>>   \s*14:\s+f7f1 a234\s+udf\.w	#4660	; 0x1234
>>   \s*18:\s+f7fc acdd\s+udf\.w	#52445	; 0xccdd
>>
> 



More information about the Binutils mailing list