int desired_align = 0;
enum stringop_alg alg;
int dynamic_check;
- /* Precise placement on cld depends whether stringops will be emit in
- prologue, main copying body or epilogue. This variable keeps track
- if cld was already needed. */
- bool cld_done = false;
if (GET_CODE (align_exp) == CONST_INT)
align = INTVAL (align_exp);
&& !count)
{
int size = MAX (size_needed - 1, desired_align - align);
- if (TARGET_SINGLE_STRINGOP)
- emit_insn (gen_cld ()), cld_done = true;
+
label = gen_label_rtx ();
emit_cmp_and_jump_insns (count_exp,
GEN_INT (size),
the info early. */
src = change_address (src, BLKmode, srcreg);
dst = change_address (dst, BLKmode, destreg);
- if (TARGET_SINGLE_STRINGOP && !cld_done)
- emit_insn (gen_cld ()), cld_done = true;
expand_movmem_prologue (dst, src, destreg, srcreg, count_exp, align,
desired_align);
}
expected_size);
break;
case rep_prefix_8_byte:
- if (!cld_done)
- emit_insn (gen_cld ()), cld_done = true;
expand_movmem_via_rep_mov (dst, src, destreg, srcreg, count_exp,
DImode);
break;
case rep_prefix_4_byte:
- if (!cld_done)
- emit_insn (gen_cld ()), cld_done = true;
expand_movmem_via_rep_mov (dst, src, destreg, srcreg, count_exp,
SImode);
break;
case rep_prefix_1_byte:
- if (!cld_done)
- emit_insn (gen_cld ()), cld_done = true;
expand_movmem_via_rep_mov (dst, src, destreg, srcreg, count_exp,
QImode);
break;
LABEL_NUSES (label) = 1;
}
if (count_exp != const0_rtx && size_needed > 1)
- {
- if (TARGET_SINGLE_STRINGOP && !cld_done)
- emit_insn (gen_cld ()), cld_done = true;
- expand_movmem_epilogue (dst, src, destreg, srcreg, count_exp,
- size_needed);
- }
+ expand_movmem_epilogue (dst, src, destreg, srcreg, count_exp,
+ size_needed);
if (jump_around_label)
emit_label (jump_around_label);
return 1;
int size_needed = 0;
int desired_align = 0;
enum stringop_alg alg;
- /* Precise placement on cld depends whether stringops will be emit in
- prologue, main copying body or epilogue. This variable keeps track
- if cld was already needed. */
- bool cld_done = false;
rtx promoted_val = val_exp;
bool force_loopy_epilogue = false;
int dynamic_check;
code, so we need to use QImode accesses in epilogue. */
if (GET_CODE (val_exp) != CONST_INT && size_needed > 1)
force_loopy_epilogue = true;
- else if (TARGET_SINGLE_STRINGOP)
- emit_insn (gen_cld ()), cld_done = true;
label = gen_label_rtx ();
emit_cmp_and_jump_insns (count_exp,
GEN_INT (size),
&& !count && !label)
{
int size = MAX (size_needed - 1, desired_align - align);
- if (TARGET_SINGLE_STRINGOP)
- emit_insn (gen_cld ()), cld_done = true;
+
label = gen_label_rtx ();
emit_cmp_and_jump_insns (count_exp,
GEN_INT (size),
the pain to maintain it for the first move, so throw away
the info early. */
dst = change_address (dst, BLKmode, destreg);
- if (TARGET_SINGLE_STRINGOP && !cld_done)
- emit_insn (gen_cld ()), cld_done = true;
expand_setmem_prologue (dst, destreg, promoted_val, count_exp, align,
desired_align);
}
count_exp, Pmode, 4, expected_size);
break;
case rep_prefix_8_byte:
- if (!cld_done)
- emit_insn (gen_cld ()), cld_done = true;
expand_setmem_via_rep_stos (dst, destreg, promoted_val, count_exp,
DImode);
break;
case rep_prefix_4_byte:
- if (!cld_done)
- emit_insn (gen_cld ()), cld_done = true;
expand_setmem_via_rep_stos (dst, destreg, promoted_val, count_exp,
SImode);
break;
case rep_prefix_1_byte:
- if (!cld_done)
- emit_insn (gen_cld ()), cld_done = true;
expand_setmem_via_rep_stos (dst, destreg, promoted_val, count_exp,
QImode);
break;
expand_setmem_epilogue_via_loop (dst, destreg, val_exp, count_exp,
size_needed);
else
- {
- if (TARGET_SINGLE_STRINGOP && !cld_done)
- emit_insn (gen_cld ()), cld_done = true;
- expand_setmem_epilogue (dst, destreg, promoted_val, count_exp,
- size_needed);
- }
+ expand_setmem_epilogue (dst, destreg, promoted_val, count_exp,
+ size_needed);
}
if (jump_around_label)
emit_label (jump_around_label);
emit_move_insn (scratch3, addr);
eoschar = force_reg (QImode, eoschar);
- emit_insn (gen_cld ());
src = replace_equiv_address_nv (src, scratch3);
/* If .md starts supporting :P, this can be done in .md. */
(FLAGS_REG 17)
(FPSR_REG 18)
(FPCR_REG 19)
- (DIRFLAG_REG 20)
(R10_REG 40)
(R11_REG 41)
])
incdec,ishift,ishift1,rotate,rotate1,imul,idiv,
icmp,test,ibr,setcc,icmov,
push,pop,call,callv,leave,
- str,cld,
+ str,
fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,fistp,fisttp,frndint,
sselog,sselog1,sseiadd,sseishft,sseimul,
sse,ssemov,sseadd,ssemul,ssecmp,ssecomi,ssecvt,sseicvt,ssediv,
;; The (bounding maximum) length of an instruction immediate.
(define_attr "length_immediate" ""
- (cond [(eq_attr "type" "incdec,setcc,icmov,str,cld,lea,other,multi,idiv,leave")
+ (cond [(eq_attr "type" "incdec,setcc,icmov,str,lea,other,multi,idiv,leave")
(const_int 0)
(eq_attr "unit" "i387,sse,mmx")
(const_int 0)
;; The (bounding maximum) length of an instruction address.
(define_attr "length_address" ""
- (cond [(eq_attr "type" "str,cld,other,multi,fxch")
+ (cond [(eq_attr "type" "str,other,multi,fxch")
(const_int 0)
(and (eq_attr "type" "call")
(match_operand 0 "constant_call_address_operand" ""))
;; Set when modrm byte is used.
(define_attr "modrm" ""
- (cond [(eq_attr "type" "str,cld,leave")
+ (cond [(eq_attr "type" "str,leave")
(const_int 0)
(eq_attr "unit" "i387")
(const_int 0)
(define_attr "memory" "none,load,store,both,unknown"
(cond [(eq_attr "type" "other,multi,str")
(const_string "unknown")
- (eq_attr "type" "lea,fcmov,fpspc,cld")
+ (eq_attr "type" "lea,fcmov,fpspc")
(const_string "none")
(eq_attr "type" "fistp,leave")
(const_string "both")
\f
;; Block operation instructions
-(define_insn "cld"
- [(set (reg:SI DIRFLAG_REG) (const_int 0))]
- ""
- "cld"
- [(set_attr "type" "cld")])
-
(define_expand "movmemsi"
[(use (match_operand:BLK 0 "memory_operand" ""))
(use (match_operand:BLK 1 "memory_operand" ""))
(set (match_operand 0 "register_operand" "")
(match_operand 4 "" ""))
(set (match_operand 2 "register_operand" "")
- (match_operand 5 "" ""))
- (use (reg:SI DIRFLAG_REG))])]
+ (match_operand 5 "" ""))])]
"TARGET_SINGLE_STRINGOP || optimize_size"
"")
(const_int 8)))
(set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_dup 3)
- (const_int 8)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 8)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"movsq"
[(set_attr "type" "str")
(const_int 4)))
(set (match_operand:SI 1 "register_operand" "=S")
(plus:SI (match_dup 3)
- (const_int 4)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 4)))]
"!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"{movsl|movsd}"
[(set_attr "type" "str")
(const_int 4)))
(set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_dup 3)
- (const_int 4)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 4)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"{movsl|movsd}"
[(set_attr "type" "str")
(const_int 2)))
(set (match_operand:SI 1 "register_operand" "=S")
(plus:SI (match_dup 3)
- (const_int 2)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 2)))]
"!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"movsw"
[(set_attr "type" "str")
(const_int 2)))
(set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_dup 3)
- (const_int 2)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 2)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"movsw"
[(set_attr "type" "str")
(const_int 1)))
(set (match_operand:SI 1 "register_operand" "=S")
(plus:SI (match_dup 3)
- (const_int 1)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 1)))]
"!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"movsb"
[(set_attr "type" "str")
(const_int 1)))
(set (match_operand:DI 1 "register_operand" "=S")
(plus:DI (match_dup 3)
- (const_int 1)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 1)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"movsb"
[(set_attr "type" "str")
(match_operand 6 "" ""))
(set (match_operand 1 "memory_operand" "")
(match_operand 3 "memory_operand" ""))
- (use (match_dup 4))
- (use (reg:SI DIRFLAG_REG))])]
+ (use (match_dup 4))])]
""
"")
(match_operand:DI 4 "register_operand" "1")))
(set (mem:BLK (match_dup 3))
(mem:BLK (match_dup 4)))
- (use (match_dup 5))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 5))]
"TARGET_64BIT"
"{rep\;movsq|rep movsq}"
[(set_attr "type" "str")
(match_operand:SI 4 "register_operand" "1")))
(set (mem:BLK (match_dup 3))
(mem:BLK (match_dup 4)))
- (use (match_dup 5))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 5))]
"!TARGET_64BIT"
"{rep\;movsl|rep movsd}"
[(set_attr "type" "str")
(match_operand:DI 4 "register_operand" "1")))
(set (mem:BLK (match_dup 3))
(mem:BLK (match_dup 4)))
- (use (match_dup 5))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 5))]
"TARGET_64BIT"
"{rep\;movsl|rep movsd}"
[(set_attr "type" "str")
(plus:SI (match_operand:SI 4 "register_operand" "1") (match_dup 5)))
(set (mem:BLK (match_dup 3))
(mem:BLK (match_dup 4)))
- (use (match_dup 5))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 5))]
"!TARGET_64BIT"
"{rep\;movsb|rep movsb}"
[(set_attr "type" "str")
(plus:DI (match_operand:DI 4 "register_operand" "1") (match_dup 5)))
(set (mem:BLK (match_dup 3))
(mem:BLK (match_dup 4)))
- (use (match_dup 5))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 5))]
"TARGET_64BIT"
"{rep\;movsb|rep movsb}"
[(set_attr "type" "str")
[(parallel [(set (match_operand 1 "memory_operand" "")
(match_operand 2 "register_operand" ""))
(set (match_operand 0 "register_operand" "")
- (match_operand 3 "" ""))
- (use (reg:SI DIRFLAG_REG))])]
+ (match_operand 3 "" ""))])]
"TARGET_SINGLE_STRINGOP || optimize_size"
"")
(match_operand:DI 2 "register_operand" "a"))
(set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_dup 1)
- (const_int 8)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 8)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"stosq"
[(set_attr "type" "str")
(match_operand:SI 2 "register_operand" "a"))
(set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (match_dup 1)
- (const_int 4)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 4)))]
"!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"{stosl|stosd}"
[(set_attr "type" "str")
(match_operand:SI 2 "register_operand" "a"))
(set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_dup 1)
- (const_int 4)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 4)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"{stosl|stosd}"
[(set_attr "type" "str")
(match_operand:HI 2 "register_operand" "a"))
(set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (match_dup 1)
- (const_int 2)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 2)))]
"!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"stosw"
[(set_attr "type" "str")
(match_operand:HI 2 "register_operand" "a"))
(set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_dup 1)
- (const_int 2)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 2)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"stosw"
[(set_attr "type" "str")
(match_operand:QI 2 "register_operand" "a"))
(set (match_operand:SI 0 "register_operand" "=D")
(plus:SI (match_dup 1)
- (const_int 1)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 1)))]
"!TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"stosb"
[(set_attr "type" "str")
(match_operand:QI 2 "register_operand" "a"))
(set (match_operand:DI 0 "register_operand" "=D")
(plus:DI (match_dup 1)
- (const_int 1)))
- (use (reg:SI DIRFLAG_REG))]
+ (const_int 1)))]
"TARGET_64BIT && (TARGET_SINGLE_STRINGOP || optimize_size)"
"stosb"
[(set_attr "type" "str")
(match_operand 4 "" ""))
(set (match_operand 2 "memory_operand" "") (const_int 0))
(use (match_operand 3 "register_operand" ""))
- (use (match_dup 1))
- (use (reg:SI DIRFLAG_REG))])]
+ (use (match_dup 1))])]
""
"")
(set (mem:BLK (match_dup 3))
(const_int 0))
(use (match_operand:DI 2 "register_operand" "a"))
- (use (match_dup 4))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 4))]
"TARGET_64BIT"
"{rep\;stosq|rep stosq}"
[(set_attr "type" "str")
(set (mem:BLK (match_dup 3))
(const_int 0))
(use (match_operand:SI 2 "register_operand" "a"))
- (use (match_dup 4))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 4))]
"!TARGET_64BIT"
"{rep\;stosl|rep stosd}"
[(set_attr "type" "str")
(set (mem:BLK (match_dup 3))
(const_int 0))
(use (match_operand:SI 2 "register_operand" "a"))
- (use (match_dup 4))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 4))]
"TARGET_64BIT"
"{rep\;stosl|rep stosd}"
[(set_attr "type" "str")
(set (mem:BLK (match_dup 3))
(const_int 0))
(use (match_operand:QI 2 "register_operand" "a"))
- (use (match_dup 4))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 4))]
"!TARGET_64BIT"
"{rep\;stosb|rep stosb}"
[(set_attr "type" "str")
(set (mem:BLK (match_dup 3))
(const_int 0))
(use (match_operand:QI 2 "register_operand" "a"))
- (use (match_dup 4))
- (use (reg:SI DIRFLAG_REG))]
+ (use (match_dup 4))]
"TARGET_64BIT"
"{rep\;stosb|rep stosb}"
[(set_attr "type" "str")
once cc0 is dead. */
align = operands[4];
- emit_insn (gen_cld ());
if (GET_CODE (count) == CONST_INT)
{
if (INTVAL (count) == 0)
(match_operand 5 "memory_operand" "")))
(use (match_operand 2 "register_operand" ""))
(use (match_operand:SI 3 "immediate_operand" ""))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand 0 "register_operand" ""))
(clobber (match_operand 1 "register_operand" ""))
(clobber (match_dup 2))])]
(mem:BLK (match_operand:SI 5 "register_operand" "1"))))
(use (match_operand:SI 6 "register_operand" "2"))
(use (match_operand:SI 3 "immediate_operand" "i"))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand:SI 0 "register_operand" "=S"))
(clobber (match_operand:SI 1 "register_operand" "=D"))
(clobber (match_operand:SI 2 "register_operand" "=c"))]
(mem:BLK (match_operand:DI 5 "register_operand" "1"))))
(use (match_operand:DI 6 "register_operand" "2"))
(use (match_operand:SI 3 "immediate_operand" "i"))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand:DI 0 "register_operand" "=S"))
(clobber (match_operand:DI 1 "register_operand" "=D"))
(clobber (match_operand:DI 2 "register_operand" "=c"))]
(const_int 0)))
(use (match_operand:SI 3 "immediate_operand" ""))
(use (reg:CC FLAGS_REG))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand 0 "register_operand" ""))
(clobber (match_operand 1 "register_operand" ""))
(clobber (match_dup 2))])]
(const_int 0)))
(use (match_operand:SI 3 "immediate_operand" "i"))
(use (reg:CC FLAGS_REG))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand:SI 0 "register_operand" "=S"))
(clobber (match_operand:SI 1 "register_operand" "=D"))
(clobber (match_operand:SI 2 "register_operand" "=c"))]
(const_int 0)))
(use (match_operand:SI 3 "immediate_operand" "i"))
(use (reg:CC FLAGS_REG))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand:DI 0 "register_operand" "=S"))
(clobber (match_operand:DI 1 "register_operand" "=D"))
(clobber (match_operand:DI 2 "register_operand" "=c"))]
(define_expand "strlenqi_1"
[(parallel [(set (match_operand 0 "register_operand" "") (match_operand 2 "" ""))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand 1 "register_operand" ""))
(clobber (reg:CC FLAGS_REG))])]
""
(match_operand:QI 2 "register_operand" "a")
(match_operand:SI 3 "immediate_operand" "i")
(match_operand:SI 4 "register_operand" "0")] UNSPEC_SCAS))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand:SI 1 "register_operand" "=D"))
(clobber (reg:CC FLAGS_REG))]
"!TARGET_64BIT"
(match_operand:QI 2 "register_operand" "a")
(match_operand:DI 3 "immediate_operand" "i")
(match_operand:DI 4 "register_operand" "0")] UNSPEC_SCAS))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand:DI 1 "register_operand" "=D"))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT"
(mem:BLK (match_operand 5 "register_operand" ""))))
(use (match_operand 6 "register_operand" ""))
(use (match_operand:SI 3 "immediate_operand" ""))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand 0 "register_operand" ""))
(clobber (match_operand 1 "register_operand" ""))
(clobber (match_operand 2 "register_operand" ""))])
(mem:BLK (match_dup 5))))
(use (match_dup 6))
(use (match_dup 3))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_dup 0))
(clobber (match_dup 1))
(clobber (match_dup 2))])]
(const_int 0)))
(use (match_operand:SI 3 "immediate_operand" ""))
(use (reg:CC FLAGS_REG))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_operand 0 "register_operand" ""))
(clobber (match_operand 1 "register_operand" ""))
(clobber (match_operand 2 "register_operand" ""))])
(const_int 0)))
(use (match_dup 3))
(use (reg:CC FLAGS_REG))
- (use (reg:SI DIRFLAG_REG))
(clobber (match_dup 0))
(clobber (match_dup 1))
(clobber (match_dup 2))])]