;; Predicate definitions for Xtensa.
-;; Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2005-2021 Free Software Foundation, Inc.
;;
;; This file is part of GCC.
;;
;; GCC is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;;
;; GCC is distributed in the hope that it will be useful,
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
-;; along with GCC; see the file COPYING. If not, write to
-;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
(define_predicate "add_operand"
(ior (and (match_code "const_int")
(define_predicate "addsubx_operand"
(and (match_code "const_int")
- (match_test "INTVAL (op) == 2
- || INTVAL (op) == 4
- || INTVAL (op) == 8")))
+ (match_test "INTVAL (op) >= 1
+ && INTVAL (op) <= 3")))
(define_predicate "arith_operand"
(ior (and (match_code "const_int")
;; Non-immediate operand excluding the constant pool.
(define_predicate "nonimmed_operand"
(ior (and (match_operand 0 "memory_operand")
- (match_test "!constantpool_address_p (XEXP (op, 0))"))
+ (match_test "!constantpool_mem_p (op)"))
(match_operand 0 "register_operand")))
;; Memory operand excluding the constant pool.
(define_predicate "mem_operand"
(and (match_operand 0 "memory_operand")
- (match_test "!constantpool_address_p (XEXP (op, 0))")))
+ (match_test "!constantpool_mem_p (op)")))
+
+;; Memory operand in the constant pool.
+(define_predicate "constantpool_operand"
+ (match_test "constantpool_mem_p (op)"))
(define_predicate "mask_operand"
(ior (and (match_code "const_int")
/* Direct calls only allowed to static functions with PIC. */
if (flag_pic)
{
- tree callee, callee_sec, caller_sec;
+ tree callee;
+ const char * callee_sec, * caller_sec;
if (GET_CODE (op) != SYMBOL_REF
|| !SYMBOL_REF_LOCAL_P (op) || SYMBOL_REF_EXTERNAL_P (op))
if (DECL_ONE_ONLY (callee))
return false;
callee_sec = DECL_SECTION_NAME (callee);
- if (((caller_sec == NULL_TREE) ^ (callee_sec == NULL_TREE))
- || (caller_sec != NULL_TREE
- && strcmp (TREE_STRING_POINTER (caller_sec),
- TREE_STRING_POINTER (callee_sec)) != 0))
+ if (((caller_sec == NULL) ^ (callee_sec == NULL))
+ || (caller_sec != NULL
+ && caller_sec != callee_sec))
return false;
}
- else if (caller_sec != NULL_TREE)
+ else if (caller_sec)
return false;
}
return true;
(define_predicate "move_operand"
(ior
(ior (match_operand 0 "register_operand")
- (match_operand 0 "memory_operand"))
+ (and (match_operand 0 "memory_operand")
+ (match_test "!constantpool_mem_p (op)
+ || GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0")))
(ior (and (match_code "const_int")
(match_test "GET_MODE_CLASS (mode) == MODE_INT
&& xtensa_simm12b (INTVAL (op))"))
(and (match_code "const_int,const_double,const,symbol_ref,label_ref")
- (match_test "TARGET_CONST16 && CONSTANT_P (op)
+ (match_test "(TARGET_CONST16 || TARGET_AUTO_LITPOOLS)
+ && CONSTANT_P (op)
&& GET_MODE_SIZE (mode) % UNITS_PER_WORD == 0")))))
;; Accept the floating point constant 1 in the appropriate mode.
(define_predicate "const_float_1_operand"
(match_code "const_double")
{
- REAL_VALUE_TYPE d;
- REAL_VALUE_FROM_CONST_DOUBLE (d, op);
- return REAL_VALUES_EQUAL (d, dconst1);
+ return real_equal (CONST_DOUBLE_REAL_VALUE (op), &dconst1);
})
(define_predicate "fpmem_offset_operand"
(define_predicate "boolean_operator"
(match_code "eq,ne"))
+
+(define_predicate "xtensa_cstoresi_operator"
+ (match_code "eq,ne,gt,ge,lt,le"))
+
+(define_predicate "tls_symbol_operand"
+ (and (match_code "symbol_ref")
+ (match_test "SYMBOL_REF_TLS_MODEL (op) != 0")))