From 3fb9e749791211cb3df74e5ae929579a29bb6861 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Tue, 7 May 1996 15:11:47 -0600 Subject: [PATCH] h8300.h (OK_FOR_U): (const (plus (symbol_ref) (const_int))) is a valid U operand if... * h8300/h8300.h (OK_FOR_U): (const (plus (symbol_ref) (const_int))) is a valid U operand if SYMBOL_REF_FLAG is set on the SYMBOL_REF. * h8300/h8300.md (memory btst patterns): New patterns. From-SVN: r11954 --- gcc/config/h8300/h8300.h | 7 ++++++- gcc/config/h8300/h8300.md | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 6bad73e0801..069797f7fe1 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -791,7 +791,12 @@ struct rtx_def *function_arg(); || (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG \ && REG_OK_FOR_BASE_P (XEXP (OP, 0))) \ || (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == SYMBOL_REF \ - && SYMBOL_REF_FLAG (XEXP (OP, 0)))) + && SYMBOL_REF_FLAG (XEXP (OP, 0))) \ + || (GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == CONST \ + && GET_CODE (XEXP (XEXP (OP, 0), 0)) == PLUS \ + && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 0)) == SYMBOL_REF \ + && SYMBOL_REF_FLAG (XEXP (XEXP (XEXP (OP, 0), 0), 0)) \ + && GET_CODE (XEXP (XEXP (XEXP (OP, 0), 0), 1)) == CONST_INT)) #define EXTRA_CONSTRAINT(OP, C) \ ((C) == 'U' ? OK_FOR_U (OP) : 0) diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index be2fb158004..059a91fe2a8 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -452,6 +452,33 @@ ;; TEST INSTRUCTIONS ;; ---------------------------------------------------------------------- +(define_insn "" + [(set (cc0) (zero_extract:QI (match_operand:QI 0 "memory_operand" "U") + (const_int 1) + (match_operand:QI 1 "const_int_operand" "n")))] + "" + "btst %Z1,%R0" + [(set_attr "length" "2") + (set_attr "cc" "set_zn_c0")]) + +(define_insn "" + [(set (cc0) (zero_extract:HI (match_operand:QI 0 "memory_operand" "U") + (const_int 1) + (match_operand:QI 1 "const_int_operand" "n")))] + "" + "btst %Z1,%Y0" + [(set_attr "length" "2") + (set_attr "cc" "set_zn_c0")]) + +(define_insn "" + [(set (cc0) (zero_extract:SI (match_operand:QI 0 "memory_operand" "U") + (const_int 1) + (match_operand:QI 1 "const_int_operand" "n")))] + "" + "btst %Z1,%Y0" + [(set_attr "length" "2") + (set_attr "cc" "set_zn_c0")]) + (define_insn "" [(set (cc0) (zero_extract:QI (match_operand:HI 0 "register_operand" "r") (const_int 1) -- 2.30.2