* Make all four mipsisa* simulators support mipsisa{32,64}{,r2}
@ 2007-06-25 18:17 Richard Sandiford
2007-06-26 13:14 ` Thiemo Seufer
2007-06-26 19:11 ` Joel Brobecker
0 siblings, 2 replies; 4+ messages in thread
From: Richard Sandiford @ 2007-06-25 18:17 UTC (permalink / raw)
To: gdb-patches
Although most mipsisa* GNU tools support all four of MIPS32, MIP32r2,
MIPS64 and MIPS64r2, the gdb simulator doesn't. So while the gcc
configurations build multilibs for all four targets, it usually isn't
possible to test them all using one configuration's simulator.
Would it be OK to:
- make the all four simulators support all four targets,
- select the target specified by the binary, if any, and
- use the target triplet to set the default architecture otherwise
? This patch does that by reusing the mips64vr* MULTI infrastructure.
I've been testing this locally for a while with no ill effects.
One specific test I tried today was to build mipsisa64-elf-run
with and without the patch, then create four tests:
1. mips32.c:
---------------------------------
int main (void)
{
asm ("maddp $2,$2");
return 0;
}
---------------------------------
compiled as:
mipsisa32r2-elf-gcc -Tidt32.ld mips32.c -mips32 \
-Wa,-msmartmips -o mips32
2. mips32r2.c:
---------------------------------
int main (void)
{
asm ("maddp $2,$2");
asm ("seb $2,$2");
return 0;
}
---------------------------------
compiled as:
mipsisa32r2-elf-gcc -Tidt32.ld mips32r2.c -mips32r2 \
-Wa,-msmartmips -o mips32r2
3. mips64.c:
---------------------------------
int main (void)
{
asm ("dmult $2,$2");
return 0;
}
---------------------------------
compiled as:
mipsisa32r2-elf-gcc -Tidt32.ld mips64.c -mips64 -o mips64
4. mips64r2.c:
---------------------------------
int main (void)
{
asm ("drotr $2,$2,1");
return 0;
}
---------------------------------
compiled as:
mipsisa32r2-elf-gcc -Tidt32.ld mips64r2.c -mips64 \
-Wa,-mips64r2 -o mips64r2
As expected, (3) worked OK with the unpatched compiler, but (1),
(2) and (4) raised a ReservedInstruction exception. (1)-(4) all
worked correctly with the patched simulator. I also tried using
the patched simulator to run the mips32r2 tests with the architecture
forced to mips32; as expected, it too raised ReservedInstruction.
I did the same thing for mips64r2 with the architecture forced
to mips64, and it failed in the same way.
OK to install?
Richard
sim/mips/
* configure.ac (sim_mipsisa3264_configs): New variable.
(mipsis32*-*-, mipsisa32r2*-*-*, mips64*-*-*, mips64r2*-*-*): Make
every configuration support all four targets, using the triplet to
determine the default.
* configure: Regenerate.
Index: sim/mips/configure.ac
===================================================================
--- sim/mips/configure.ac (revision 172263)
+++ sim/mips/configure.ac (working copy)
@@ -109,6 +109,12 @@ sim_igen_filter="32,64,f"
sim_m16_filter="16"
sim_mach_default="mips8000"
+sim_mipsisa3264_configs="\
+ mipsisa32:mips32,mips16,mips16e,smartmips:32,f:mipsisa32\
+ mipsisa32r2:mips32r2,mips16,mips16e,mdmx,dsp,dsp2,smartmips:32,f:mipsisa32r2\
+ mipsisa64:mips64,mips3d,mips16,mips16e,mdmx:32,64,f:mipsisa64\
+ mipsisa64r2:mips64r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2:32,64,f:mipsisa64r2"
+
case "${target}" in
mips*tx39*) sim_gen=IGEN
sim_igen_filter="32,f"
@@ -152,34 +158,26 @@ case "${target}" in
sim_igen_filter="32,64,f"
sim_m16_filter="16"
;;
- mipsisa32r2*-*-*) sim_gen=M16
- sim_igen_machine="-M mips32r2,mips16,mips16e,mdmx,dsp,dsp2,smartmips"
- sim_m16_machine="-M mips16,mips16e,mips32r2"
- sim_igen_filter="32,f"
- sim_mach_default="mipsisa32r2"
- ;;
- mipsisa32*-*-*) sim_gen=M16
- sim_igen_machine="-M mips32,mips16,mips16e,smartmips"
- sim_m16_machine="-M mips16,mips16e,mips32"
- sim_igen_filter="32,f"
- sim_mach_default="mipsisa32"
- ;;
- mipsisa64r2*-*-*) sim_gen=M16
- sim_igen_machine="-M mips64r2,mips3d,mips16,mips16e,mdmx,dsp,dsp2"
- sim_m16_machine="-M mips16,mips16e,mips64r2"
- sim_igen_filter="32,64,f"
- sim_mach_default="mipsisa64r2"
+ mipsisa32r2*-*-*) sim_gen=MULTI
+ sim_multi_configs=$sim_mipsisa3264_configs
+ sim_multi_default="mipsisa32r2"
+ ;;
+ mipsisa32*-*-*) sim_gen=MULTI
+ sim_multi_configs=$sim_mipsisa3264_configs
+ sim_multi_default="mipsisa32"
+ ;;
+ mipsisa64r2*-*-*) sim_gen=MULTI
+ sim_multi_configs=$sim_mipsisa3264_configs
+ sim_multi_default="mipsisa64r2"
;;
mipsisa64sb1*-*-*) sim_gen=IGEN
sim_igen_machine="-M mips64,mips3d,sb1"
sim_igen_filter="32,64,f"
sim_mach_default="mips_sb1"
;;
- mipsisa64*-*-*) sim_gen=M16
- sim_igen_machine="-M mips64,mips3d,mips16,mips16e,mdmx"
- sim_m16_machine="-M mips16,mips16e,mips64"
- sim_igen_filter="32,64,f"
- sim_mach_default="mipsisa64"
+ mipsisa64*-*-*) sim_gen=MULTI
+ sim_multi_configs=$sim_mipsisa3264_configs
+ sim_multi_default="mipsisa64"
;;
mips*lsi*) sim_gen=M16
sim_igen_machine="-M mipsIII,mips16"
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Make all four mipsisa* simulators support mipsisa{32,64}{,r2}
2007-06-25 18:17 Make all four mipsisa* simulators support mipsisa{32,64}{,r2} Richard Sandiford
@ 2007-06-26 13:14 ` Thiemo Seufer
2007-06-26 19:11 ` Joel Brobecker
1 sibling, 0 replies; 4+ messages in thread
From: Thiemo Seufer @ 2007-06-26 13:14 UTC (permalink / raw)
To: gdb-patches, richard
Richard Sandiford wrote:
[snip]
> sim/mips/
> * configure.ac (sim_mipsisa3264_configs): New variable.
> (mipsis32*-*-, mipsisa32r2*-*-*, mips64*-*-*, mips64r2*-*-*): Make
> every configuration support all four targets, using the triplet to
> determine the default.
> * configure: Regenerate.
Ok.
Thiemo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Make all four mipsisa* simulators support mipsisa{32,64}{,r2}
2007-06-25 18:17 Make all four mipsisa* simulators support mipsisa{32,64}{,r2} Richard Sandiford
2007-06-26 13:14 ` Thiemo Seufer
@ 2007-06-26 19:11 ` Joel Brobecker
2007-06-28 9:41 ` Richard Sandiford
1 sibling, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2007-06-26 19:11 UTC (permalink / raw)
To: gdb-patches, richard
> Although most mipsisa* GNU tools support all four of MIPS32, MIP32r2,
> MIPS64 and MIPS64r2, the gdb simulator doesn't. So while the gcc
> configurations build multilibs for all four targets, it usually isn't
> possible to test them all using one configuration's simulator.
[..]
> sim/mips/
> * configure.ac (sim_mipsisa3264_configs): New variable.
> (mipsis32*-*-, mipsisa32r2*-*-*, mips64*-*-*, mips64r2*-*-*): Make
> every configuration support all four targets, using the triplet to
> determine the default.
> * configure: Regenerate.
I think this deserves an entry in gdb/NEWS. Opinions?
Thanks,
--
Joel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Make all four mipsisa* simulators support mipsisa{32,64}{,r2}
2007-06-26 19:11 ` Joel Brobecker
@ 2007-06-28 9:41 ` Richard Sandiford
0 siblings, 0 replies; 4+ messages in thread
From: Richard Sandiford @ 2007-06-28 9:41 UTC (permalink / raw)
To: Joel Brobecker; +Cc: gdb-patches
Joel Brobecker <brobecker@adacore.com> writes:
>> Although most mipsisa* GNU tools support all four of MIPS32, MIP32r2,
>> MIPS64 and MIPS64r2, the gdb simulator doesn't. So while the gcc
>> configurations build multilibs for all four targets, it usually isn't
>> possible to test them all using one configuration's simulator.
>
> [..]
>
>> sim/mips/
>> * configure.ac (sim_mipsisa3264_configs): New variable.
>> (mipsis32*-*-, mipsisa32r2*-*-*, mips64*-*-*, mips64r2*-*-*): Make
>> every configuration support all four targets, using the triplet to
>> determine the default.
>> * configure: Regenerate.
>
> I think this deserves an entry in gdb/NEWS.
Events have proven otherwise. I can't have tested the patch as well
as I'd thought: I think the only mips32 code I tested on mipsisa64
must have been soft-float.
It turns out that mips.igen's implementation of ldc1 does not work when
WITH_TARGET_WORD_SIZE==64. The different W_T_W_S probably causes other
(perhaps more subtle) problems in the same line, so I've decided to
revert the patch. I'd still like to make the change in principle,
but it clearly needs more work, and I don't have time for that at
the moment.
Sorry for screwing this up.
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-06-28 6:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-25 18:17 Make all four mipsisa* simulators support mipsisa{32,64}{,r2} Richard Sandiford
2007-06-26 13:14 ` Thiemo Seufer
2007-06-26 19:11 ` Joel Brobecker
2007-06-28 9:41 ` Richard Sandiford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox