diff options
author | Uros Bizjak <ubizjak@gmail.com> | 2021-06-04 17:51:05 +0200 |
---|---|---|
committer | Uros Bizjak <ubizjak@gmail.com> | 2021-06-04 17:52:06 +0200 |
commit | 1b51f038cf027fdc1bf00240cacee59dd5cbe458 (patch) | |
tree | 7ae6ec16a265eebc42824bbfafd89b82e43d2087 | |
parent | 4facf2bf5b7b32f444da864306b5c11e14c15bcf (diff) | |
download | gcc-1b51f038cf027fdc1bf00240cacee59dd5cbe458.zip gcc-1b51f038cf027fdc1bf00240cacee59dd5cbe458.tar.gz gcc-1b51f038cf027fdc1bf00240cacee59dd5cbe458.tar.bz2 |
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.
-rw-r--r-- | gcc/config/i386/predicates.md | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md index abd307e..d2f5f15 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" |