Hi,

This patch uses + in constraint and match_dup in xbegin_1.  OK for
trunk?

Andi, can you provide a run-time testcase patch with proper cpuid check?

Thanks.


H.J.
---
2012-05-11  Andrew Pinski  <apin...@cavium.com>
            H.J. Lu  <hongjiu...@intel.com>

        PR target/53315
        * config/i386/i386.md (xbegin_1): Use + in constraint and
        match_dup.
        (xbegin): Updated.

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index c825579..b64d1d3 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -18361,9 +18361,9 @@
 {
   rtx label = gen_label_rtx ();
 
-  operands[1] = force_reg (SImode, constm1_rtx);
+  operands[0] = force_reg (SImode, constm1_rtx);
 
-  emit_jump_insn (gen_xbegin_1 (operands[0], operands[1], label));
+  emit_jump_insn (gen_xbegin_1 (operands[0], label));
 
   emit_label (label);
   LABEL_NUSES (label) = 1;
@@ -18375,13 +18375,12 @@
   [(set (pc)
        (if_then_else (ne (unspec [(const_int 0)] UNSPEC_XBEGIN_ABORT)
                          (const_int 0))
-                     (label_ref (match_operand 2))
+                     (label_ref (match_operand 1))
                      (pc)))
-   (set (match_operand:SI 0 "register_operand" "=a")
-       (unspec_volatile:SI [(match_operand:SI 1 "register_operand" "0")]
-                           UNSPECV_XBEGIN))]
+   (set (match_operand:SI 0 "register_operand" "+a")
+       (unspec_volatile:SI [(match_dup 0)] UNSPECV_XBEGIN))]
   "TARGET_RTM"
-  "xbegin\t%l2"
+  "xbegin\t%l1"
   [(set_attr "type" "other")
    (set_attr "length" "6")])
 

Reply via email to