mirror of git://gcc.gnu.org/git/gcc.git
predicates.md (io_address_operand): New predicate.
* config/avr/predicates.md (io_address_operand): New predicate. * config/avr/avr-protos.h (avr_io_address_p): Remove declaration. * config/avr/avr.c (avr_io_address_p): Remove function. (out_movqi_r_mr): Use 'io_address_operand' predicate instead of 'avr_io_address_p' function. (out_movhi_r_mr): (Ditto.). (out_movqi_mr_r): (Ditto.). (out_movhi_mr_r): (Ditto.). (avr_address_cost): (Ditto.). From-SVN: r133846
This commit is contained in:
parent
7b1980026c
commit
e6b69d0e56
|
@ -1,3 +1,15 @@
|
||||||
|
2008-04-02 Anatoly Sokolov <aesok@post.ru>
|
||||||
|
|
||||||
|
* config/avr/predicates.md (io_address_operand): New predicate.
|
||||||
|
* config/avr/avr-protos.h (avr_io_address_p): Remove declaration.
|
||||||
|
* config/avr/avr.c (avr_io_address_p): Remove function.
|
||||||
|
(out_movqi_r_mr): Use 'io_address_operand' predicate instead of
|
||||||
|
'avr_io_address_p' function.
|
||||||
|
(out_movhi_r_mr): (Ditto.).
|
||||||
|
(out_movqi_mr_r): (Ditto.).
|
||||||
|
(out_movhi_mr_r): (Ditto.).
|
||||||
|
(avr_address_cost): (Ditto.).
|
||||||
|
|
||||||
2008-04-02 Uros Bizjak <ubizjak@gmail.com>
|
2008-04-02 Uros Bizjak <ubizjak@gmail.com>
|
||||||
|
|
||||||
* config/i386/i386.md (*float<SSEMODEI24:mode><X87MODEF:mode>2_1):
|
* config/i386/i386.md (*float<SSEMODEI24:mode><X87MODEF:mode>2_1):
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/* Prototypes for exported functions defined in avr.c
|
/* Prototypes for exported functions defined in avr.c
|
||||||
|
|
||||||
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007
|
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2008
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
Contributed by Denis Chertykov (denisc@overta.ru)
|
Contributed by Denis Chertykov (denisc@overta.ru)
|
||||||
|
|
||||||
|
@ -122,7 +122,6 @@ extern RTX_CODE avr_normalize_condition (RTX_CODE condition);
|
||||||
extern int compare_eq_p (rtx insn);
|
extern int compare_eq_p (rtx insn);
|
||||||
extern void out_shift_with_cnt (const char *template, rtx insn,
|
extern void out_shift_with_cnt (const char *template, rtx insn,
|
||||||
rtx operands[], int *len, int t_len);
|
rtx operands[], int *len, int t_len);
|
||||||
extern int avr_io_address_p (rtx x, int size);
|
|
||||||
extern int avr_peep2_scratch_safe (rtx reg_rtx);
|
extern int avr_peep2_scratch_safe (rtx reg_rtx);
|
||||||
#endif /* RTX_CODE */
|
#endif /* RTX_CODE */
|
||||||
|
|
||||||
|
|
|
@ -1846,7 +1846,7 @@ out_movqi_r_mr (rtx insn, rtx op[], int *l)
|
||||||
*l = 1;
|
*l = 1;
|
||||||
return AS2 (in,%0,__SREG__);
|
return AS2 (in,%0,__SREG__);
|
||||||
}
|
}
|
||||||
if (avr_io_address_p (x, 1))
|
if (optimize > 0 && io_address_operand (x, QImode))
|
||||||
{
|
{
|
||||||
*l = 1;
|
*l = 1;
|
||||||
return AS2 (in,%0,%1-0x20);
|
return AS2 (in,%0,%1-0x20);
|
||||||
|
@ -2034,7 +2034,7 @@ out_movhi_r_mr (rtx insn, rtx op[], int *l)
|
||||||
}
|
}
|
||||||
else if (CONSTANT_ADDRESS_P (base))
|
else if (CONSTANT_ADDRESS_P (base))
|
||||||
{
|
{
|
||||||
if (avr_io_address_p (base, 2))
|
if (optimize > 0 && io_address_operand (base, HImode))
|
||||||
{
|
{
|
||||||
*l = 2;
|
*l = 2;
|
||||||
return (AS2 (in,%A0,%A1-0x20) CR_TAB
|
return (AS2 (in,%A0,%A1-0x20) CR_TAB
|
||||||
|
@ -2534,7 +2534,7 @@ out_movqi_mr_r (rtx insn, rtx op[], int *l)
|
||||||
*l = 1;
|
*l = 1;
|
||||||
return AS2 (out,__SREG__,%1);
|
return AS2 (out,__SREG__,%1);
|
||||||
}
|
}
|
||||||
if (avr_io_address_p (x, 1))
|
if (optimize > 0 && io_address_operand (x, QImode))
|
||||||
{
|
{
|
||||||
*l = 1;
|
*l = 1;
|
||||||
return AS2 (out,%0-0x20,%1);
|
return AS2 (out,%0-0x20,%1);
|
||||||
|
@ -2613,7 +2613,7 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l)
|
||||||
l = &tmp;
|
l = &tmp;
|
||||||
if (CONSTANT_ADDRESS_P (base))
|
if (CONSTANT_ADDRESS_P (base))
|
||||||
{
|
{
|
||||||
if (avr_io_address_p (base, 2))
|
if (optimize > 0 && io_address_operand (base, HImode))
|
||||||
{
|
{
|
||||||
*l = 2;
|
*l = 2;
|
||||||
return (AS2 (out,%B0-0x20,%B1) CR_TAB
|
return (AS2 (out,%B0-0x20,%B1) CR_TAB
|
||||||
|
@ -5465,7 +5465,7 @@ avr_address_cost (rtx x)
|
||||||
return 18;
|
return 18;
|
||||||
if (CONSTANT_ADDRESS_P (x))
|
if (CONSTANT_ADDRESS_P (x))
|
||||||
{
|
{
|
||||||
if (avr_io_address_p (x, 1))
|
if (optimize > 0 && io_address_operand (x, QImode))
|
||||||
return 2;
|
return 2;
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
@ -5711,17 +5711,6 @@ avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
|
||||||
return !(regno & 1);
|
return !(regno & 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns 1 if X is a valid address for an I/O register of size SIZE
|
|
||||||
(1 or 2). Used for lds/sts -> in/out optimization. Add 0x20 to SIZE
|
|
||||||
to check for the lower half of I/O space (for cbi/sbi/sbic/sbis). */
|
|
||||||
|
|
||||||
int
|
|
||||||
avr_io_address_p (rtx x, int size)
|
|
||||||
{
|
|
||||||
return (optimize > 0 && GET_CODE (x) == CONST_INT
|
|
||||||
&& INTVAL (x) >= 0x20 && INTVAL (x) <= 0x60 - size);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
output_reload_inhi (rtx insn ATTRIBUTE_UNUSED, rtx *operands, int *len)
|
output_reload_inhi (rtx insn ATTRIBUTE_UNUSED, rtx *operands, int *len)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;; Predicate definitions for ATMEL AVR micro controllers.
|
;; Predicate definitions for ATMEL AVR micro controllers.
|
||||||
;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
|
;; Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||||
;;
|
;;
|
||||||
;; This file is part of GCC.
|
;; This file is part of GCC.
|
||||||
;;
|
;;
|
||||||
|
@ -52,6 +52,11 @@
|
||||||
(and (match_code "const_int")
|
(and (match_code "const_int")
|
||||||
(match_test "IN_RANGE((INTVAL (op)), 0x40, 0x5F)")))
|
(match_test "IN_RANGE((INTVAL (op)), 0x40, 0x5F)")))
|
||||||
|
|
||||||
|
;; Return true if OP is a valid address of I/O space.
|
||||||
|
(define_predicate "io_address_operand"
|
||||||
|
(and (match_code "const_int")
|
||||||
|
(match_test "IN_RANGE((INTVAL (op)), 0x20, (0x60 - GET_MODE_SIZE(mode)))")))
|
||||||
|
|
||||||
;; Return 1 if OP is the zero constant for MODE.
|
;; Return 1 if OP is the zero constant for MODE.
|
||||||
(define_predicate "const0_operand"
|
(define_predicate "const0_operand"
|
||||||
(and (match_code "const_int,const_double")
|
(and (match_code "const_int,const_double")
|
||||||
|
|
Loading…
Reference in New Issue