This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] remove split condition from *fix_truncdi_1, *fix_truncsi_1
Hello!
- ""
+ "&& 1"
2004-11-12 Uros Bizjak <uros@kss-loka.si>
* configure/i386/i386.md: (*fix_truncdi_1, *fix_truncsi_1):
Remove unneeded "&& 1" from split constraint.
(two unnamed define_peephole2): Remove unneeded "&& 1" from
constraints.
Zack Weinberg wrote:
Looks good to me; check it in.
zw
Richard Henderson wrote:
NOT ok. See my previous reply.
r~
From the documentation, define_insn_and_split is equal to define_insn
and define_split of the same pattern.
This instruction (without "&& 1" in its split constraint):
(define_insn_and_split "*fix_truncdi_1"
[(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r")
(fix:DI (match_operand 1 "register_operand" "f,f")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1]))
&& !reload_completed && !reload_in_progress
&& (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)"
"#"
""
[(const_int 0)]
{
...
}
[(set_attr "type" "fistp")
(set_attr "i387_cw" "trunc")
(set_attr "mode" "DI")])
is then equal to:
(define_insn "*fix_truncdi_1"
[(set (match_operand:DI 0 "nonimmediate_operand" "=m,?r")
(fix:DI (match_operand 1 "register_operand" "f,f")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1]))
&& !reload_completed && !reload_in_progress
&& (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)"
"#"
[(set_attr "type" "fistp")
(set_attr "i387_cw" "trunc")
(set_attr "mode" "DI")])
with
(define_split
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(fix:DI (match_operand 1 "register_operand" "")))
(clobber (reg:CC FLAGS_REG))]
""
[(const_int 0)]
{
...
})
The instruction will only be generated, when its condition will match,
and will be splitted afterwards. However, there is a small (-> zero?)
possibility that combiner produces an exact pattern that match the split
pattern. In this case, instruction will be split without any split
constraints. To be safe, should "&& 1" be present in split condition?
Thanks,
Uros.