From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20501 invoked by alias); 25 Jun 2007 11:53:30 -0000 Received: (qmail 20491 invoked by uid 22791); 25 Jun 2007 11:53:28 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 25 Jun 2007 11:53:24 +0000 Received: (qmail 750 invoked from network); 25 Jun 2007 11:53:23 -0000 Received: from unknown (HELO gateway) (10.0.0.100) by mail.codesourcery.com with SMTP; 25 Jun 2007 11:53:23 -0000 Received: by gateway (Postfix, from userid 1010) id ECA396C10D; Mon, 25 Jun 2007 04:53:22 -0700 (PDT) From: Richard Sandiford To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org, richard@codesourcery.com Subject: Make all four mipsisa* simulators support mipsisa{32,64}{,r2} Date: Mon, 25 Jun 2007 18:17:00 -0000 Message-ID: <878xa81c99.fsf@firetop.home> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00447.txt.bz2 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"