From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1118) id 8F16D3858D1E; Wed, 30 Nov 2022 18:44:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8F16D3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669833877; bh=6mzB2P/ehz0GY0ziXcDOYoI54o7roZl0/0ahtEOvCF4=; h=From:To:Subject:Date:From; b=PL1We01N5fb8tpINppXRmaY9e2z+Mo03UK5t4u7zu9G8PRuELern8mydP+1Ku1OR3 GOIOuSZl26meH20h4JXldWMG3xuzfst5YnYDaL4YcU711q98HZvgi7sN60HV4JJhz2 5+zu0//bC4OABDKCNQ2qhNNZn26n+OWQnz38iS64= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: John David Anglin To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-10401] Fix addvdi3 and subvdi3 patterns X-Act-Checkin: gcc X-Git-Author: John David Anglin X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 885f5c3d5763d46e02bd2f192765cb589b4c4fe4 X-Git-Newrev: edad87c2693e3ab42f17c4d6d7b58116ccb6fc46 Message-Id: <20221130184437.8F16D3858D1E@sourceware.org> Date: Wed, 30 Nov 2022 18:44:37 +0000 (GMT) List-Id: https://gcc.gnu.org/g:edad87c2693e3ab42f17c4d6d7b58116ccb6fc46 commit r11-10401-gedad87c2693e3ab42f17c4d6d7b58116ccb6fc46 Author: John David Anglin Date: Wed Nov 30 18:40:10 2022 +0000 Fix addvdi3 and subvdi3 patterns While most PA 2.0 instructions support both 32 and 64-bit traps and conditions, the addi and subi instructions only support 32-bit traps and conditions. Thus, we need to force immediate operands to register operands on the 64-bit target and use the add/sub instructions which can trap on 64-bit signed overflow. 2022-11-30 John David Anglin gcc/ChangeLog: * config/pa/pa.md (addvdi3): Force operand 2 to a register. Remove "addi,tsv,*" instruction from unamed pattern. (subvdi3): Force operand 1 to a register. Remove "subi,tsv" instruction from from unamed pattern. Diff: --- gcc/config/pa/pa.md | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 31e3b1bff80..3e0bfb09da2 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5071,23 +5071,25 @@ (match_dup 2)))) (const_int 0))])] "" - "") + " +{ + if (TARGET_64BIT) + operands[2] = force_reg (DImode, operands[2]); +}") (define_insn "" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rM,rM") - (match_operand:DI 2 "arith11_operand" "r,I"))) + [(set (match_operand:DI 0 "register_operand" "=r") + (plus:DI (match_operand:DI 1 "reg_or_0_operand" "%rM") + (match_operand:DI 2 "register_operand" "r"))) (trap_if (ne (plus:TI (sign_extend:TI (match_dup 1)) (sign_extend:TI (match_dup 2))) (sign_extend:TI (plus:DI (match_dup 1) (match_dup 2)))) (const_int 0))] "TARGET_64BIT" - "@ - add,tsv,* %2,%1,%0 - addi,tsv,* %2,%1,%0" - [(set_attr "type" "binary,binary") - (set_attr "length" "4,4")]) + "add,tsv,* %2,%1,%0" + [(set_attr "type" "binary") + (set_attr "length" "4")]) (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r") @@ -5262,23 +5264,25 @@ (match_dup 2)))) (const_int 0))])] "" - "") + " +{ + if (TARGET_64BIT) + operands[1] = force_reg (DImode, operands[1]); +}") (define_insn "" - [(set (match_operand:DI 0 "register_operand" "=r,r") - (minus:DI (match_operand:DI 1 "arith11_operand" "r,I") - (match_operand:DI 2 "reg_or_0_operand" "rM,rM"))) + [(set (match_operand:DI 0 "register_operand" "=r") + (minus:DI (match_operand:DI 1 "register_operand" "r") + (match_operand:DI 2 "reg_or_0_operand" "rM"))) (trap_if (ne (minus:TI (sign_extend:TI (match_dup 1)) (sign_extend:TI (match_dup 2))) (sign_extend:TI (minus:DI (match_dup 1) (match_dup 2)))) (const_int 0))] "TARGET_64BIT" - "@ - {subo|sub,tsv} %1,%2,%0 - {subio|subi,tsv} %1,%2,%0" - [(set_attr "type" "binary,binary") - (set_attr "length" "4,4")]) + "sub,tsv,* %1,%2,%0" + [(set_attr "type" "binary") + (set_attr "length" "4")]) (define_insn "" [(set (match_operand:DI 0 "register_operand" "=r,&r")