From: John David Anglin <dave.anglin@bell.net>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [committed] hppa: Fix addvdi3 and subvdi3 patterns
Date: Wed, 30 Nov 2022 18:50:11 +0000 [thread overview]
Message-ID: <Y4el43pq83ixCe/N@mx3210.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 2999 bytes --]
This was found building 64-bit openssh package.
Committed to active branches.
Dave
---
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 <danglin@gcc.gnu.org>
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 --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 76ae35d4cfa..41382271e54 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")
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
reply other threads:[~2022-11-30 18:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y4el43pq83ixCe/N@mx3210.localdomain \
--to=dave.anglin@bell.net \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).