[MIPS] Add new virtualization instructions
Richard Sandiford
rdsandiford@googlemail.com
Thu Jun 13 20:18:00 GMT 2013
"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> On Thu, 13 Jun 2013, Chao-Ying Fu wrote:
>> > Why do you need to change it? It's proved useful in finding
>> > bugs -- ASEs
>> > that should be made available to microMIPS assembly
>> > unconditionally such
>> > as with the EVA support discussed as recently as yesterday.
>>
>> If I add -mips64r2 to the as flag for the micromips@virt64.d test,
>> I will get this error.
>>
>> Ex: micromips@virt64.d
>> #objdump: -dr --prefix-addresses --show-raw-insn -Mvirt,cp0-names=mips64r2
>> #name: virt64 instructions
>> #source: virt64.s
>> #as: -64 -mvirt -mips64r2
>> ....
>>
>> Ex: Testing
>> ../as-new -64 -mvirt -mips64r2 -march=mips64 -mmicromips -o dump.o /home/fu/dev
>> /gcc-mainline/src/gas/testsuite/gas/mips/virt64.s
>> Executing on host: sh -c {../as-new -64 -mvirt -mips64r2 -march=mips64 -mmicrom
>> ips -o dump.o /home/fu/dev/gcc-mainline/src/gas/testsuite/gas/mips/virt64.s 2>&1
>> } /dev/null gas.out (timeout = 300)
>> Assembler messages:
>> Error: -mips64r2 conflicts with the other architecture options, which imply -mip
>> s64
>> /home/fu/dev/gcc-mainline/src/gas/testsuite/gas/mips/virt64.s:5: Error: Opcode n
>> ot supported on this processor: mips64 (mips64) `dmfgc0 $3,$29'
>> ....
>>
>> Or, if I change ISA_SUPPORTS_VIRT64_ASE to support micromips with MIPS64,
>> I won't need the mips64r2 change in mips.exp and the micromips virt64
>> test will run.
>> Ex:
>> Index: config/tc-mips.c
>> ===================================================================
>> RCS file: /cvs/src/src/gas/config/tc-mips.c,v
>> retrieving revision 1.538
>> diff -u -p -r1.538 tc-mips.c
>> --- config/tc-mips.c 10 Jun 2013 18:15:47 -0000 1.538
>> +++ config/tc-mips.c 13 Jun 2013 17:37:10 -0000
>> @@ -381,9 +381,12 @@ static int file_ase_mt;
>> static int file_ase_virt;
>>
>> #define ISA_SUPPORTS_VIRT_ASE (mips_opts.isa == ISA_MIPS32R2 \
>> - || mips_opts.isa == ISA_MIPS64R2)
>> + || mips_opts.isa == ISA_MIPS64R2 \
>> + || mips_opts.micromips)
>>
>> -#define ISA_SUPPORTS_VIRT64_ASE (mips_opts.isa == ISA_MIPS64R2)
>> +#define ISA_SUPPORTS_VIRT64_ASE (mips_opts.isa == ISA_MIPS64R2 \
>> + || (mips_opts.isa == ISA_MIPS64 \
>> + && mips_opts.micromips))
>>
>> /* The argument of the -march= flag. The architecture we are assembling. */
>> static int file_mips_arch = CPU_UNKNOWN;
>>
>> Are there other solutions to let the micromips virt64 test run?
>
> Thanks, I can see what you mean now -- essentially VIRT64 is the first
> strictly microMIPS64 feature we're going to support. The issue looks to
> me like the outcome of a previous decision to make -mips3 switch microMIPS
> assembly into the 64-bit mode. I believe this was your own decision too,
> :) that we accepted. I think we can stick to it and just as we already
> enable all the optional microMIPS32 features for -mips1 assembly we do the
> same for microMIPS64 and -mips3 assembly.
>
> Given the above how about:
>
> #define ISA_SUPPORTS_VIRT64_ASE (mips_opts.isa == ISA_MIPS64R2
> || (mips_opts.micromips
> && ISA_HAS_64BIT_REGS (mips_opts.isa)))
>
> ? We'll then do the same if e.g. DSP64 is added to the microMIPS
> instruction set.
Yeah, that'd be OK for now. There are some "cleanups" I'd like to make
to the way we handle this kind of thing, but it'd be easier to do that
once this and the EVA patches are in.
The idea is to have a table listing the ASE names, their ASE_* flags,
the minimum ISA revision number, whether they are supported on microMIPS,
and other related stuff. Hopefully then we can cut down on the amount
of cut-&-paste involved. It'd also make it easier to fix inconsistencies
like:
.set mips64r2
...
.set dspr2
.set mips3
mul.ph $2,$3,$4
being OK but:
.set mips3
.set dspr2
mul.ph $2,$3,$4
being rejected.
Richard
More information about the Binutils
mailing list