This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/65871] bzhi builtin/intrinsic wrongly assumes bzhi instruction doesn't set the ZF flag


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--

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]