Commit 648a7cdc by Georg-Johann Lay Committed by Georg-Johann Lay

avr.c (output_reload_in_const): Loading a byte with 0 must not affect cc0.

	* config/avr/avr.c (output_reload_in_const): Loading a byte with 0
	must not affect cc0.
	* config/avr/avr.md (*movhi, *movpsi, *movsi, *movsf): Zero to any
	register does not change cc0. Same for any constant to ld-register.

From-SVN: r181592
parent dc9945a4
2011-11-21 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.c (output_reload_in_const): Loading a byte with 0
must not affect cc0.
* config/avr/avr.md (*movhi, *movpsi, *movsi, *movsf): Zero to any
register does not change cc0. Same for any constant to ld-register.
2011-11-21 Uros Bizjak <ubizjak@gmail.com> 2011-11-21 Uros Bizjak <ubizjak@gmail.com>
* config/i386/mmx.md (unspec) <UNSPEC_MOVNTQ, UNSPEC_PFRCP, * config/i386/mmx.md (unspec) <UNSPEC_MOVNTQ, UNSPEC_PFRCP,
...@@ -8836,7 +8836,13 @@ avr_regno_mode_code_ok_for_base_p (int regno, ...@@ -8836,7 +8836,13 @@ avr_regno_mode_code_ok_for_base_p (int regno,
LEN != NULL: set *LEN to the length of the instruction sequence LEN != NULL: set *LEN to the length of the instruction sequence
(in words) printed with LEN = NULL. (in words) printed with LEN = NULL.
If CLEAR_P is true, OP[0] had been cleard to Zero already. If CLEAR_P is true, OP[0] had been cleard to Zero already.
If CLEAR_P is false, nothing is known about OP[0]. */ If CLEAR_P is false, nothing is known about OP[0].
The effect on cc0 is as follows:
Load 0 to any register : NONE
Load ld register with any value : NONE
Anything else: : CLOBBER */
static void static void
output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p) output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
...@@ -8914,7 +8920,7 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p) ...@@ -8914,7 +8920,7 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
xop[2] = clobber_reg; xop[2] = clobber_reg;
if (n >= 2 + (avr_current_arch->n_segments > 1)) if (n >= 2 + (avr_current_arch->n_segments > 1))
avr_asm_len ("clr %0", xop, len, 1); avr_asm_len ("mov %0,__zero_reg__", xop, len, 1);
else else
avr_asm_len (asm_code[n][ldreg_p], xop, len, ldreg_p ? 1 : 2); avr_asm_len (asm_code[n][ldreg_p], xop, len, ldreg_p ? 1 : 2);
continue; continue;
...@@ -8946,14 +8952,13 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p) ...@@ -8946,14 +8952,13 @@ output_reload_in_const (rtx *op, rtx clobber_reg, int *len, bool clear_p)
} }
} }
/* Use CLR to zero a value so that cc0 is set as expected /* Don't use CLR so that cc0 is set as expected. */
for zero. */
if (ival[n] == 0) if (ival[n] == 0)
{ {
if (!clear_p) if (!clear_p)
avr_asm_len ("clr %0", &xdest[n], len, 1); avr_asm_len (ldreg_p ? "ldi %0,0" : "mov %0,__zero_reg__",
&xdest[n], len, 1);
continue; continue;
} }
......
...@@ -649,7 +649,7 @@ ...@@ -649,7 +649,7 @@
} }
[(set_attr "length" "2,2,6,7,2,6,5,2") [(set_attr "length" "2,2,6,7,2,6,5,2")
(set_attr "adjust_len" "mov16") (set_attr "adjust_len" "mov16")
(set_attr "cc" "none,clobber,clobber,clobber,none,clobber,none,none")]) (set_attr "cc" "none,none,clobber,clobber,none,clobber,none,none")])
(define_peephole2 ; movw (define_peephole2 ; movw
[(set (match_operand:QI 0 "even_register_operand" "") [(set (match_operand:QI 0 "even_register_operand" "")
...@@ -752,7 +752,7 @@ ...@@ -752,7 +752,7 @@
} }
[(set_attr "length" "3,3,8,9,4,10") [(set_attr "length" "3,3,8,9,4,10")
(set_attr "adjust_len" "mov24") (set_attr "adjust_len" "mov24")
(set_attr "cc" "none,set_zn,clobber,clobber,clobber,clobber")]) (set_attr "cc" "none,none,clobber,clobber,none,clobber")])
;;========================================================================== ;;==========================================================================
;; move double word (32 bit) ;; move double word (32 bit)
...@@ -793,7 +793,7 @@ ...@@ -793,7 +793,7 @@
} }
[(set_attr "length" "4,4,8,9,4,10") [(set_attr "length" "4,4,8,9,4,10")
(set_attr "adjust_len" "mov32") (set_attr "adjust_len" "mov32")
(set_attr "cc" "none,set_zn,clobber,clobber,clobber,clobber")]) (set_attr "cc" "none,none,clobber,clobber,none,clobber")])
;; fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ;; fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
;; move floating point numbers (32 bit) ;; move floating point numbers (32 bit)
...@@ -809,7 +809,7 @@ ...@@ -809,7 +809,7 @@
} }
[(set_attr "length" "4,4,8,9,4,10") [(set_attr "length" "4,4,8,9,4,10")
(set_attr "adjust_len" "mov32") (set_attr "adjust_len" "mov32")
(set_attr "cc" "none,set_zn,clobber,clobber,clobber,clobber")]) (set_attr "cc" "none,none,clobber,clobber,none,clobber")])
(define_peephole2 ; *reload_insf (define_peephole2 ; *reload_insf
[(match_scratch:QI 2 "d") [(match_scratch:QI 2 "d")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment