From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21919 invoked by alias); 2 Mar 2005 21:50:30 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 21890 invoked from network); 2 Mar 2005 21:50:25 -0000 Received: from unknown (HELO e31.co.us.ibm.com) (32.97.110.129) by sourceware.org with SMTP; 2 Mar 2005 21:50:25 -0000 Received: from westrelay01.boulder.ibm.com (westrelay01.boulder.ibm.com [9.17.195.10]) by e31.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j22LoIua386614 for ; Wed, 2 Mar 2005 16:50:18 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay01.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j22LoIsq163322 for ; Wed, 2 Mar 2005 14:50:18 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j22LoIAD020298 for ; Wed, 2 Mar 2005 14:50:18 -0700 Received: from dyn319633.beaverton.ibm.com (DYN319633.beaverton.ibm.com [9.47.22.123]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j22LoH7A020268 for ; Wed, 2 Mar 2005 14:50:17 -0700 From: Paul Gilliam Reply-To: pgilliam@us.ibm.com To: gdb-patches@sources.redhat.com Subject: Re: [patch] test for altivec h/w on PowerPC Date: Wed, 02 Mar 2005 21:50:00 -0000 User-Agent: KMail/1.6.2 References: <200503011519.39739.pgilliam@us.ibm.com> <20050302015607.GA1694@nevyn.them.org> <200503021010.17990.pgilliam@us.ibm.com> In-Reply-To: <200503021010.17990.pgilliam@us.ibm.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_7QjJCs+qDxPG0ML" Message-Id: <200503021346.35253.pgilliam@us.ibm.com> X-SW-Source: 2005-03/txt/msg00019.txt.bz2 --Boundary-00=_7QjJCs+qDxPG0ML Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 955 Murphy got me.... Here is yet another version of the patch, this time with out a 'verbose 0' left in. -=# Paul #=- PS: I have another altivec related testsuite patch coming... that one will let the compiles in altivec-*.exp succeed. On Wednesday 02 March 2005 10:10, Paul Gilliam wrote: > On Tuesday 01 March 2005 17:56, Daniel Jacobowitz wrote: > > On Tue, Mar 01, 2005 at 04:32:17PM -0800, Paul Gilliam wrote: > > > Daniel, > > > > > > Thanks a lot for your speedy review! > > > > > > I didn't know Janis wrote it, she didn't say so when she showed it to > > > me. (Her cube is right next to mine: we are in the same group) > > > > She's too modest :-) Or my memory is bad. > > I just talked to her. She doesn't think she needs the atribution and it > came from Aldy Hernandez anyway. 8-) > > > > Ok to commit? > > > > No patch attached? :-) > > I CAN'T BELEAVE IT ! FUDGE! > > Here it is: > (This time for sure, I hope 8-) > > -=# Paul #=- --Boundary-00=_7QjJCs+qDxPG0ML Content-Type: text/x-diff; charset="utf-8"; name="altivec.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="altivec.patch" Content-length: 3554 diff -Naur testsuite.old/ChangeLog testsuite/ChangeLog --- testsuite.old/ChangeLog 2005-03-01 14:56:21.439229400 -0800 +++ testsuite/ChangeLog 2005-03-01 15:59:49.052246512 -0800 @@ -1,3 +1,10 @@ +2004-03-01 Paul Gilliam + + * lib/gdb.exp: added 'skip_altivec_tests', a modification of + Janis Johnson's 'check_vmx_hw_available' from GCC testsuite + * lib/gdb.arch/altivec-abi.exp: use new 'skip_altivec_tests' + * lib/gdb.arch/altivec-regs.exp: Likewise + 2004-02-24 Joel Brobecker * gdb.ada/fixed_points.exp: Create compilation object directory diff -Naur testsuite.old/gdb.arch/altivec-abi.exp testsuite/gdb.arch/altivec-abi.exp --- testsuite.old/gdb.arch/altivec-abi.exp 2005-03-01 14:56:21.484222560 -0800 +++ testsuite/gdb.arch/altivec-abi.exp 2005-03-01 15:01:49.451289288 -0800 @@ -32,7 +32,7 @@ set prms_id 0 set bug_id 0 -if ![istarget "powerpc-*altivec"] then { +if [skip_altivec_tests] { verbose "Skipping altivec abi tests." return } diff -Naur testsuite.old/gdb.arch/altivec-regs.exp testsuite/gdb.arch/altivec-regs.exp --- testsuite.old/gdb.arch/altivec-regs.exp 2005-03-01 14:56:21.485222408 -0800 +++ testsuite/gdb.arch/altivec-regs.exp 2005-03-01 15:02:41.869176744 -0800 @@ -32,7 +32,7 @@ set prms_id 0 set bug_id 0 -if ![istarget "powerpc-*altivec"] then { +if [skip_altivec_tests] then { verbose "Skipping altivec register tests." return } diff -Naur testsuite.old/lib/gdb.exp testsuite/lib/gdb.exp --- testsuite.old/lib/gdb.exp 2005-03-01 14:56:22.127258976 -0800 +++ testsuite/lib/gdb.exp 2005-03-02 10:09:13.241270112 -0800 @@ -1142,6 +1142,59 @@ return 0 } +# Run a test on the target to see if it supports vmx hardware. +# Return 1 if it does not, 0 if it does. + +# This code is based on 'check_vmx_hw_available' from the GCC testsuite. + +proc skip_altivec_tests {} { + global skip_vmx_tests_saved + + if [info exists skip_vmx_tests_saved] { + verbose "check_hw_available: returning saved $skip_vmx_tests_saved" 2 + return $skip_vmx_tests_saved + } + + # Some simulators are known to not support VMX instructions. + if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] } { + verbose "check_hw_available returning 0" 2 + return [set $skip_vmx_tests_saved 1] + } + + # Set up, compile, and execute a test program containing VMX + # instructions. Include the current process ID in the file + # names to prevent conflicts with invocations for multiple + # testsuites. + set src vmx[pid].c + set exe vmx[pid].x + + set f [open $src "w"] + puts $f "int main() {" + puts $f "#ifdef __MACH__" + puts $f " asm volatile (\"vor v0,v0,v0\");" + puts $f "#else" + puts $f " asm volatile (\"vor 0,0,0\");" + puts $f "#endif" + puts $f " return 0; }" + close $f + + verbose "skip_altivec_testing compiling testfile $src" 1 + set lines [gdb_compile $src $exe executable {debug additional_flags=-maltivec}] + file delete $src + + if ![string match "" $lines] then { + verbose "check_vmx_hw_availalble testfile compilation failed" 2 + return [set skip_vmx_tests_saved 1] + } + + # No error message, compilation succeeded so now run it. + + set exec_result [remote_exec target "./$exe"] + remote_file build delete "$exe" + + return [set skip_vmx_tests_saved [lindex $exec_result 0]] +} + # Skip all the tests in the file if you are not on an hppa running # hpux target. --Boundary-00=_7QjJCs+qDxPG0ML--