public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1217] i386: Convert a couple of predicates to use match_code RTXes.
@ 2021-06-04 15:52 Uros Bizjak
0 siblings, 0 replies; only message in thread
From: Uros Bizjak @ 2021-06-04 15:52 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:1b51f038cf027fdc1bf00240cacee59dd5cbe458
commit r12-1217-g1b51f038cf027fdc1bf00240cacee59dd5cbe458
Author: Uros Bizjak <ubizjak@gmail.com>
Date: Fri Jun 4 17:51:05 2021 +0200
i386: Convert a couple of predicates to use match_code RTXes.
No functional changes.
2021-06-04 Uroš Bizjak <ubizjak@gmail.com>
gcc/
* config/i386/predicates.md (GOT_memory_operand):
Implement using match_code RTXes.
(GOT32_symbol_operand): Ditto.
Diff:
---
gcc/config/i386/predicates.md | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index abd307ebdb8..d2f5f15d971 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -734,13 +734,10 @@
;; Return true if OP is a GOT memory operand.
(define_predicate "GOT_memory_operand"
- (match_operand 0 "memory_operand")
-{
- op = XEXP (op, 0);
- return (GET_CODE (op) == CONST
- && GET_CODE (XEXP (op, 0)) == UNSPEC
- && XINT (XEXP (op, 0), 1) == UNSPEC_GOTPCREL);
-})
+ (and (match_operand 0 "memory_operand")
+ (match_code "const" "0")
+ (match_code "unspec" "00")
+ (match_test "XINT (XEXP (XEXP (op, 0), 0), 1) == UNSPEC_GOTPCREL")))
;; Test for a valid operand for a call instruction.
;; Allow constant call address operands in Pmode only.
@@ -767,9 +764,9 @@
;; Return true if OP is a 32-bit GOT symbol operand.
(define_predicate "GOT32_symbol_operand"
- (match_test "GET_CODE (op) == CONST
- && GET_CODE (XEXP (op, 0)) == UNSPEC
- && XINT (XEXP (op, 0), 1) == UNSPEC_GOT"))
+ (and (match_code "const")
+ (match_code "unspec" "0")
+ (match_test "XINT (XEXP (op, 0), 1) == UNSPEC_GOT")))
;; Match exactly zero.
(define_predicate "const0_operand"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-04 15:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-04 15:52 [gcc r12-1217] i386: Convert a couple of predicates to use match_code RTXes Uros Bizjak
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).