From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108720 invoked by alias); 26 Feb 2016 13:00:21 -0000 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 Received: (qmail 108692 invoked by uid 89); 26 Feb 2016 13:00:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 26 Feb 2016 13:00:17 +0000 Received: from EUSAAHC008.ericsson.se (Unknown_Domain [147.117.188.96]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id 64.8B.12433.C1840D65; Fri, 26 Feb 2016 13:42:04 +0100 (CET) Received: from elxa4wqvvz1 (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.96) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 26 Feb 2016 08:00:14 -0500 References: <861t81cc2c.fsf@gmail.com> <1456414378-1918-1-git-send-email-antoine.tremblay@ericsson.com> <86wpprc1ky.fsf@gmail.com> User-agent: mu4e 0.9.17; emacs 24.4.1 From: Antoine Tremblay To: Yao Qi CC: Antoine Tremblay , Subject: Re: [PATCH v6] Enable tracing of pseudo-registers on ARM In-Reply-To: <86wpprc1ky.fsf@gmail.com> Date: Fri, 26 Feb 2016 13:00:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00839.txt.bz2 Yao Qi writes: > Antoine Tremblay writes: > >> @@ -20,7 +20,11 @@ >> * registers on x86_64. >> */ >> > > The comments above should be updated as well. Done. > >> +#if (defined __x86_64__) >> #include >> +#elif (defined __arm__ || defined __thumb2__ || defined __thumb__) > > __arm__ is defined even in thumb mode, so only "defined __arm__" is enough. > >> +#include > > Why do you include arm_neon.h? I don't see anything NEON specific is used. > >> +#endif Indeed I was playing with neon types before, forgot to remove it. Fixed. >> >> void >> dummy (void) >> @@ -37,6 +41,7 @@ main (void) >> { >> /* Strictly speaking, it should be ymm15 (xmm15 is 128-bit), but gcc older >> than 4.9 doesn't recognize "ymm15" as a valid register name. */ >> +#if (defined __x86_64__) >> register __v8si a asm("xmm15") = { >> 0x12340001, >> 0x12340002, >> @@ -48,6 +53,13 @@ main (void) >> 0x12340008, >> }; >> asm volatile ("traceme: call dummy" : : "x" (a)); >> +#elif (defined __arm__ || defined __thumb2__ || defined __thumb__) > > Only "defined __arm__" is needed. > Done. >> + register uint32_t a asm("s5") = { >> + 0x2 >> + }; > > I'd like to write an inline asm to set s5 a value and the value can be shown as > an integer so that the test is more reliable (current test tests float > "2.80259693e-45"). > Done. >> + asm volatile ("traceme: bl dummy" : : "x" (a)); >> +#endif >> + >> end (); >> return 0; >> } >> diff --git a/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp b/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp >> index 4c52c64..12a2740 100644 >> --- a/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp >> +++ b/gdb/testsuite/gdb.trace/tracefile-pseudo-reg.exp >> @@ -12,8 +12,8 @@ >> # You should have received a copy of the GNU General Public License >> # along with this program. If not, see . >> >> -if { ! [is_amd64_regs_target] } { >> - verbose "Skipping tfile AVX test (target is not x86_64)." >> +if { ! [is_amd64_regs_target] && ! [istarget "arm*-*-*"] } { >> + verbose "Skipping tracefile pseudo register tests, target is not supported." >> return >> } >> >> @@ -21,8 +21,14 @@ load_lib "trace-support.exp" >> >> standard_testfile >> >> +if { [is_amd64_regs_target] } { >> + set add_flags "-mavx" >> +} elseif { [istarget "arm*-*-*"] } { >> + set add_flags "-mfpu=neon" > > Don't have to pass -mfpu=neon, because the case is also valid for vfp. > Right, Fixed. >> +} >> + >> if {[prepare_for_testing $testfile.exp $testfile $srcfile \ >> - [list debug additional_flags=-mavx]]} { >> + [list debug additional_flags=$add_flags]]} { >> return -1 >> } >> >> @@ -36,20 +42,31 @@ if ![gdb_target_supports_trace] { >> return -1 >> } >> >> -gdb_test_multiple "print \$ymm15" "check for AVX support" { >> +if { [is_amd64_regs_target] } { >> + set reg "\$ymm15" >> + set reg_message "check for AVX support" >> +} elseif { [istarget "arm*-*-*"] } { >> + set reg "\$s5" >> + set reg_message "check for Neon support" > > $s5 exists on the processors which support NEON or VFP, so the > $reg_message isn't accurate. We can change reg_message to "check > register $reg". Done. A v7 patch follows.