2014-08-19 H.J. Lu <hongjiu.lu@intel.com>
+ * config/i386/i386.md (*ctz<mode>2_falsedep_1): Don't clear
+ destination if it is used in source.
+ (*clz<mode>2_lzcnt_falsedep_1): Likewise.
+ (*popcount<mode>2_falsedep_1): Likewise.
+
+2014-08-19 H.J. Lu <hongjiu.lu@intel.com>
+
PR other/62168
* configure.ac: Set install_gold_as_default to no first.
* configure: Regenerated.
(match_operand:SWI248 1 "nonimmediate_operand")))
(clobber (reg:CC FLAGS_REG))])])
+; False dependency happens when destination is only updated by tzcnt,
+; lzcnt or popcnt. There is no false dependency when destination is
+; also used in source.
(define_insn_and_split "*ctz<mode>2_falsedep_1"
- [(set (match_operand:SWI48 0 "register_operand" "=&r")
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
(ctz:SWI48
(match_operand:SWI48 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
(ctz:SWI48 (match_dup 1)))
(unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP)
(clobber (reg:CC FLAGS_REG))])]
- "ix86_expand_clear (operands[0]);")
+{
+ if (!reg_mentioned_p (operands[0], operands[1]))
+ ix86_expand_clear (operands[0]);
+})
(define_insn "*ctz<mode>2_falsedep"
[(set (match_operand:SWI48 0 "register_operand" "=r")
"TARGET_LZCNT")
(define_insn_and_split "*clz<mode>2_lzcnt_falsedep_1"
- [(set (match_operand:SWI48 0 "register_operand" "=&r")
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
(clz:SWI48
(match_operand:SWI48 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
(clz:SWI48 (match_dup 1)))
(unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP)
(clobber (reg:CC FLAGS_REG))])]
- "ix86_expand_clear (operands[0]);")
+{
+ if (!reg_mentioned_p (operands[0], operands[1]))
+ ix86_expand_clear (operands[0]);
+})
(define_insn "*clz<mode>2_lzcnt_falsedep"
[(set (match_operand:SWI48 0 "register_operand" "=r")
"TARGET_POPCNT")
(define_insn_and_split "*popcount<mode>2_falsedep_1"
- [(set (match_operand:SWI48 0 "register_operand" "=&r")
+ [(set (match_operand:SWI48 0 "register_operand" "=r")
(popcount:SWI48
(match_operand:SWI48 1 "nonimmediate_operand" "rm")))
(clobber (reg:CC FLAGS_REG))]
(popcount:SWI48 (match_dup 1)))
(unspec [(match_dup 0)] UNSPEC_INSN_FALSE_DEP)
(clobber (reg:CC FLAGS_REG))])]
- "ix86_expand_clear (operands[0]);")
+{
+ if (!reg_mentioned_p (operands[0], operands[1]))
+ ix86_expand_clear (operands[0]);
+})
(define_insn "*popcount<mode>2_falsedep"
[(set (match_operand:SWI48 0 "register_operand" "=r")