From patchwork Wed Nov 6 12:42:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 288865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4D11D2C00CA for ; Wed, 6 Nov 2013 23:42:41 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=UMfc7LNzXEETXGTbQS4JVx18FAnD+43veqf/ynS1qQox8o alaOh0f50/X7T/jipumhbbrhLbeeq1s4N9hNWGoeOvCH5lFO7/Tw9njL2U1DUYtc q6gSXsWLJ2elYomp/AteiiITHn9dA4VKGeIW2twWmSemxtkxeQqpx57r+EDms= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=LD04OO0Q5jwxfeEEFbGmDttYRLg=; b=S9Wg6gwRnVf+8fjT1sS+ pU3Lmie2uIS8PyeEjkVVsSLd9NjGE9JfnTYnS93q8HtoBtEoErBS9+XPA2+8wwFG jyRUwkbDVD5fIJMnc03rCHct0/47qiDoEhuImAfk0M2u2fwdtraLn4Bsuc7sprf/ 5LFNyUOI8BoYmwQ9t0AIDgI= Received: (qmail 20660 invoked by alias); 6 Nov 2013 12:42:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 20596 invoked by uid 89); 6 Nov 2013 12:42:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_50, RDNS_NONE, UNPARSEABLE_RELAY, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mailout08.t-online.de Received: from Unknown (HELO mailout08.t-online.de) (194.25.134.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 06 Nov 2013 12:42:28 +0000 Received: from fwd00.aul.t-online.de (fwd00.aul.t-online.de ) by mailout08.t-online.de with smtp id 1Ve2R1-00065O-LO; Wed, 06 Nov 2013 13:42:11 +0100 Received: from [192.168.0.103] (rIfdKOZfohIQQdRIGYvFxLtWRuQs5VJWqfzlpd-ZyERtVRqer6yp0okxqOc-Eq9wzs@[93.195.11.24]) by fwd00.t-online.de with esmtp id 1Ve2R1-1UWgIy0; Wed, 6 Nov 2013 13:42:11 +0100 Message-ID: <1383741727.2445.449.camel@yam-132-YW-E178-FTW> Subject: [SH] arith_reg_operand vs. fp_arith_reg_operand From: Oleg Endo To: gcc-patches Date: Wed, 06 Nov 2013 13:42:07 +0100 Mime-Version: 1.0 X-IsSubscribed: yes Hello, The attached patch addresses one thing which I mentioned in PR 22553 comment #27. Some of the FP insns take "arith_reg_operand", which seems a bit off. I haven't checked whether it fixes the original problem of PR 22553, but anyway it's probably better to use "fp_arith_reg_operand" for FP insns. Tested on rev 204263 with make -k check RUNTESTFLAGS="--target_board=sh-sim \{-m2/-ml,-m2/-mb,-m2a/-mb,-m2a-single/-mb,-m4/-ml,-m4/-mb,-m4-single/ -ml,-m4-single/-mb,-m4a-single/-ml,-m4a-single/-mb}" and no new failures. OK for trunk? Cheers, Oleg gcc/ChangeLog: * config/sh/sh.md (addsf3, divsf3, divsf3_i, rsqrtsf2, cmpgtdf_t, cmpeqdf_t, *ieee_ccmpeqdf_t, negdf2, sqrtdf2, absdf2): Use fp_arith_reg_operand instead of arith_reg_operand. Index: gcc/config/sh/sh.md =================================================================== --- gcc/config/sh/sh.md (revision 204263) +++ gcc/config/sh/sh.md (working copy) @@ -12187,9 +12187,9 @@ [(set_attr "type" "fpscr_toggle")]) (define_expand "addsf3" - [(set (match_operand:SF 0 "arith_reg_operand" "") - (plus:SF (match_operand:SF 1 "arith_reg_operand" "") - (match_operand:SF 2 "arith_reg_operand" "")))] + [(set (match_operand:SF 0 "fp_arith_reg_operand") + (plus:SF (match_operand:SF 1 "fp_arith_reg_operand") + (match_operand:SF 2 "fp_arith_reg_operand")))] "TARGET_SH2E || TARGET_SHMEDIA_FPU" { if (TARGET_SH2E) @@ -12436,9 +12436,9 @@ [(set_attr "type" "fparith_media")]) (define_expand "divsf3" - [(set (match_operand:SF 0 "arith_reg_operand" "") - (div:SF (match_operand:SF 1 "arith_reg_operand" "") - (match_operand:SF 2 "arith_reg_operand" "")))] + [(set (match_operand:SF 0 "fp_arith_reg_operand") + (div:SF (match_operand:SF 1 "fp_arith_reg_operand") + (match_operand:SF 2 "fp_arith_reg_operand")))] "TARGET_SH2E || TARGET_SHMEDIA_FPU" { if (TARGET_SH2E) @@ -12457,9 +12457,9 @@ [(set_attr "type" "fdiv_media")]) (define_insn "divsf3_i" - [(set (match_operand:SF 0 "arith_reg_dest" "=f") - (div:SF (match_operand:SF 1 "arith_reg_operand" "0") - (match_operand:SF 2 "arith_reg_operand" "f"))) + [(set (match_operand:SF 0 "fp_arith_reg_dest" "=f") + (div:SF (match_operand:SF 1 "fp_arith_reg_operand" "0") + (match_operand:SF 2 "fp_arith_reg_operand" "f"))) (use (match_operand:PSI 3 "fpscr_operand" "c"))] "TARGET_SH2E" "fdiv %2,%0" @@ -12743,9 +12743,9 @@ (set_attr "fp_mode" "single")]) (define_insn "rsqrtsf2" - [(set (match_operand:SF 0 "register_operand" "=f") + [(set (match_operand:SF 0 "fp_arith_reg_operand" "=f") (div:SF (match_operand:SF 1 "immediate_operand" "i") - (sqrt:SF (match_operand:SF 2 "register_operand" "0")))) + (sqrt:SF (match_operand:SF 2 "fp_arith_reg_operand" "0")))) (use (match_operand:PSI 3 "fpscr_operand" "c"))] "TARGET_FPU_ANY && TARGET_FSRRA && operands[1] == CONST1_RTX (SFmode)" @@ -13059,8 +13059,8 @@ (define_insn "cmpgtdf_t" [(set (reg:SI T_REG) - (gt:SI (match_operand:DF 0 "arith_reg_operand" "f") - (match_operand:DF 1 "arith_reg_operand" "f"))) + (gt:SI (match_operand:DF 0 "fp_arith_reg_operand" "f") + (match_operand:DF 1 "fp_arith_reg_operand" "f"))) (use (match_operand:PSI 2 "fpscr_operand" "c"))] "(TARGET_SH4 || TARGET_SH2A_DOUBLE)" "fcmp/gt %1,%0" @@ -13069,8 +13069,8 @@ (define_insn "cmpeqdf_t" [(set (reg:SI T_REG) - (eq:SI (match_operand:DF 0 "arith_reg_operand" "f") - (match_operand:DF 1 "arith_reg_operand" "f"))) + (eq:SI (match_operand:DF 0 "fp_arith_reg_operand" "f") + (match_operand:DF 1 "fp_arith_reg_operand" "f"))) (use (match_operand:PSI 2 "fpscr_operand" "c"))] "(TARGET_SH4 || TARGET_SH2A_DOUBLE)" "fcmp/eq %1,%0" @@ -13080,8 +13080,8 @@ (define_insn "*ieee_ccmpeqdf_t" [(set (reg:SI T_REG) (ior:SI (reg:SI T_REG) - (eq:SI (match_operand:DF 0 "arith_reg_operand" "f") - (match_operand:DF 1 "arith_reg_operand" "f")))) + (eq:SI (match_operand:DF 0 "fp_arith_reg_operand" "f") + (match_operand:DF 1 "fp_arith_reg_operand" "f")))) (use (match_operand:PSI 2 "fpscr_operand" "c"))] "TARGET_IEEE && (TARGET_SH4 || TARGET_SH2A_DOUBLE)" { @@ -13139,10 +13139,9 @@ DONE; }) - (define_expand "negdf2" - [(set (match_operand:DF 0 "arith_reg_operand" "") - (neg:DF (match_operand:DF 1 "arith_reg_operand" "")))] + [(set (match_operand:DF 0 "fp_arith_reg_operand") + (neg:DF (match_operand:DF 1 "fp_arith_reg_operand")))] "(TARGET_SH4 || TARGET_SH2A_DOUBLE) || TARGET_SHMEDIA_FPU" { if (TARGET_SH4 || TARGET_SH2A_DOUBLE) @@ -13169,8 +13168,8 @@ (set_attr "fp_mode" "double")]) (define_expand "sqrtdf2" - [(set (match_operand:DF 0 "arith_reg_operand" "") - (sqrt:DF (match_operand:DF 1 "arith_reg_operand" "")))] + [(set (match_operand:DF 0 "fp_arith_reg_operand") + (sqrt:DF (match_operand:DF 1 "fp_arith_reg_operand")))] "(TARGET_SH4 || TARGET_SH2A_DOUBLE) || TARGET_SHMEDIA_FPU" { if (TARGET_SH4 || TARGET_SH2A_DOUBLE) @@ -13197,8 +13196,8 @@ (set_attr "fp_mode" "double")]) (define_expand "absdf2" - [(set (match_operand:DF 0 "arith_reg_operand" "") - (abs:DF (match_operand:DF 1 "arith_reg_operand" "")))] + [(set (match_operand:DF 0 "fp_arith_reg_operand") + (abs:DF (match_operand:DF 1 "fp_arith_reg_operand")))] "(TARGET_SH4 || TARGET_SH2A_DOUBLE) || TARGET_SHMEDIA_FPU" { if (TARGET_SH4 || TARGET_SH2A_DOUBLE)