This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/65871] bzhi builtin/intrinsic wrongly assumes bzhi instruction doesn't set the ZF flag
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 21 Jun 2015 11:09:26 +0000
- Subject: [Bug target/65871] bzhi builtin/intrinsic wrongly assumes bzhi instruction doesn't set the ZF flag
- Auto-submitted: auto-generated
- References: <bug-65871-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65871
--- Comment #11 from UroÅ Bizjak <ubizjak at gmail dot com> ---
(In reply to UroÅ Bizjak from comment #10)
> Because of the cost model. Combine pass says:
Testing the patch:
--cut here--
Index: i386.c
===================================================================
--- i386.c (revision 224630)
+++ i386.c (working copy)
@@ -42533,6 +42533,12 @@ ix86_rtx_costs (rtx x, int code_i, int outer_code_
+ rtx_cost (const1_rtx, outer_code, opno, speed));
return true;
}
+
+ /* The embedded comparison operand is completely free. */
+ if (!general_operand (XEXP (x, 0), GET_MODE (XEXP (x, 0)))
+ && XEXP (x, 1) == const0_rtx)
+ *total = 0;
+
return false;
case FLOAT_EXTEND:
--cut here--