From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44481 invoked by alias); 20 Mar 2015 20:52:09 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 44470 invoked by uid 89); 20 Mar 2015 20:52:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 20 Mar 2015 20:52:06 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id t2KKq1hs015338; Fri, 20 Mar 2015 15:52:02 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id t2KKq1to015337; Fri, 20 Mar 2015 15:52:01 -0500 Date: Fri, 20 Mar 2015 20:52:00 -0000 From: Segher Boessenkool To: Peter Bergner Cc: GCC Patches , David Edelsohn , Michael Meissner , Bill Schmidt Subject: Re: [PATCH, rs6000, testsuite] Fix PR target/64579, __TM_end __builtin_tend failed to return transactional state Message-ID: <20150320205200.GA32613@gate.crashing.org> References: <1426879660.13627.71.camel@otta> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426879660.13627.71.camel@otta> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2015-03/txt/msg01115.txt.bz2 Hi Peter, Nice patch. Some minor things... On Fri, Mar 20, 2015 at 02:27:40PM -0500, Peter Bergner wrote: > Index: gcc/config/rs6000/htm.md > =================================================================== > --- gcc/config/rs6000/htm.md (revision 221519) > +++ gcc/config/rs6000/htm.md (working copy) > @@ -48,24 +48,19 @@ (define_c_enum "unspecv" > > > (define_expand "tabort" > - [(set (match_dup 2) > - (unspec_volatile:CC [(match_operand:SI 1 "int_reg_operand" "")] > - UNSPECV_HTM_TABORT)) > - (set (match_dup 3) > - (eq:SI (match_dup 2) > - (const_int 0))) > - (set (match_operand:SI 0 "int_reg_operand" "") > - (xor:SI (match_dup 3) > - (const_int 1)))] > + [(match_operand:SI 0 "gpc_reg_operand" "") > + (match_operand:SI 1 "gpc_reg_operand" "")] > "TARGET_HTM" > { > - operands[2] = gen_rtx_REG (CCmode, CR0_REGNO); > - operands[3] = gen_reg_rtx (SImode); > + rtx cr = gen_reg_rtx (CCmode); > + emit_insn (gen_tabort_internal (operands[1], cr)); > + rs6000_emit_move_from_cr_field (operands[0], cr); > + DONE; > }) Maybe it would be nicer if the builtin-expansion code handled the copy from cc, instead of stacking on RTL expanders. > (define_expand "tabortdc" > - [(set (match_dup 4) > - (unspec_volatile:CC [(match_operand 1 "u5bit_cint_operand" "n") > - (match_operand:SI 2 "gpc_reg_operand" "r") > - (match_operand:SI 3 "gpc_reg_operand" "r")] > - UNSPECV_HTM_TABORTDC)) > - (set (match_dup 5) > - (eq:SI (match_dup 4) > - (const_int 0))) > - (set (match_operand:SI 0 "int_reg_operand" "") > - (xor:SI (match_dup 5) > - (const_int 1)))] > + [(match_operand:SI 0 "gpc_reg_operand" "") > + (match_operand 1 "u5bit_cint_operand" "n") > + (match_operand:SI 2 "gpc_reg_operand" "") > + (match_operand:SI 3 "gpc_reg_operand" "")] > "TARGET_HTM" > { > - operands[4] = gen_rtx_REG (CCmode, CR0_REGNO); > - operands[5] = gen_reg_rtx (SImode); > + rtx cr = gen_reg_rtx (CCmode); > + emit_insn (gen_tabortdc_internal (operands[1], operands[2], operands[3], cr)); > + rs6000_emit_move_from_cr_field (operands[0], cr); > + DONE; > }) Expanders have no constraints (you can leave out the field completely). Doesn't gen* warn on non-empty constraints? > --- gcc/testsuite/gcc.target/powerpc/htm-1.c (revision 0) > +++ gcc/testsuite/gcc.target/powerpc/htm-1.c (working copy) > @@ -0,0 +1,53 @@ > +/* { dg-do run { target { powerpc*-*-* && htm_hw } } } */ > +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ htm_hw already disallows Darwin? [ And {"*"} {""} is default. ] > + # For now, disable on Darwin > + if { [istarget powerpc-*-eabi] || [istarget powerpc*-*-eabispe] || [istarget *-*-darwin*]} { > + expr 0 If ever HTM is enabled on Darwin, the testcases should Just Work as far as I see. Cheers, Segher