This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [MIPS] Add new virtualization instructions
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: Chao-Ying Fu <Chao-Ying dot Fu at imgtec dot com>, "'Pinski\, Andrew'" <Andrew dot Pinski at caviumnetworks dot com>, "binutils\ at sourceware dot org" <binutils at sourceware dot org>
- Date: Thu, 13 Jun 2013 21:18:08 +0100
- Subject: Re: [MIPS] Add new virtualization instructions
- References: <e790fa722ba34ff097a964d1dfa06e9d at BY2PR07MB058 dot namprd07 dot prod dot outlook dot com> <87wqr81o3b dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <98cba9069a7141f399456267fe33b95f at BY2PR07MB058 dot namprd07 dot prod dot outlook dot com> <87d2szptbr dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com> <81D57523CB07B24881D63DE650C6ED82EDBB9B at bamail02 dot ba dot imgtec dot org> <bd8d0ebef46949869722652cd2cab2d1 at BY2PR07MB058 dot namprd07 dot prod dot outlook dot com> <81D57523CB07B24881D63DE650C6ED82018D3FE3 at BADAG02 dot ba dot imgtec dot org> <alpine dot DEB dot 1 dot 10 dot 1306130105100 dot 16287 at tp dot orcam dot me dot uk> <81D57523CB07B24881D63DE650C6ED82018D4A32 at BADAG02 dot ba dot imgtec dot org> <alpine dot DEB dot 1 dot 10 dot 1306131847410 dot 16287 at tp dot orcam dot me dot uk>
"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