[PATCH 42/43] aarch64: Add support for strided register lists

Richard Sandiford richard.sandiford@arm.com
Thu Mar 30 16:06:08 GMT 2023


Simon Marchi <simon.marchi@polymtl.ca> writes:
> On 3/30/23 06:23, Richard Sandiford wrote:
>> SME2 has instructions that accept strided register lists,
>> such as { z0.s, z4.s, z8.s, z12.s }.  The purpose of this
>> patch is to extend binutils to support such lists.
>> 
>> The parsing code already had (unused) support for strides of 2.
>> The idea here is instead to accept all strides during parsing
>> and reject invalid strides during constraint checking.
>> 
>> The SME2 instructions that accept strided operands also have
>> non-strided forms.  The errors about invalid strides therefore
>> take a bitmask of acceptable strides, which allows multiple
>> possibilities to be summed up in a single message.
>> 
>> I've tried to update all code that handles register lists.
>
> Hi Richard,
>
> In a binutils-gdb build with --enable-targets=all, I get:
>
>
> make[4]: Entering directory '/home/smarchi/build/binutils-gdb-all-targets/binutils'
>   CCLD     objdump
> mold: error: duplicate symbol: ../opcodes/.libs/libopcodes.a(aarch64-dis-2.o): ../opcodes/.libs/libopcodes.a(aarch64-dis.o): reglist
> mold: error: duplicate symbol: ../opcodes/.libs/libopcodes.a(aarch64-dis-2.o): ../opcodes/.libs/libopcodes.a(aarch64-dis.o): __odr_asan.reglist
> mold: error: duplicate symbol: ../opcodes/.libs/libopcodes.a(aarch64-opc-2.o): ../opcodes/.libs/libopcodes.a(aarch64-dis.o): reglist
> mold: error: duplicate symbol: ../opcodes/.libs/libopcodes.a(aarch64-opc.o): ../opcodes/.libs/libopcodes.a(aarch64-dis.o): reglist
> mold: error: duplicate symbol: ../opcodes/.libs/libopcodes.a(aarch64-opc-2.o): ../opcodes/.libs/libopcodes.a(aarch64-dis.o): __odr_asan.reglist
> mold: error: duplicate symbol: ../opcodes/.libs/libopcodes.a(aarch64-opc.o): ../opcodes/.libs/libopcodes.a(aarch64-dis.o): __odr_asan.reglist
> collect2: error: ld returned 1 exit status

Yeah, I've just pushed a patch for this.  Sorry for the breakage.

Richard

>> diff --git a/include/opcode/aarch64.h b/include/opcode/aarch64.h
>> index 61afe561a12..ef59d531d17 100644
>> --- a/include/opcode/aarch64.h
>> +++ b/include/opcode/aarch64.h
>> @@ -1122,6 +1122,19 @@ struct aarch64_indexed_za
>>    unsigned v : 1;	/* <HV> horizontal or vertical vector indicator.  */
>>  };
>>  
>> +/* Information about a list of registers.  */
>> +struct aarch64_reglist
>> +{
>> +  unsigned first_regno : 8;
>> +  unsigned num_regs : 8;
>> +  /* The difference between the nth and the n+1th register.  */
>> +  unsigned stride : 8;
>> +  /* 1 if it is a list of reg element.  */
>> +  unsigned has_index : 1;
>> +  /* Lane index; valid only when has_index is 1.  */
>> +  int64_t index;
>> +} reglist;
>
> Probably because this last "reglist" shouldn't be there.
>
> Simon


More information about the Binutils mailing list