OSDN Git Service

* config/i386/i386.c (override_options): Don't accept
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / i386.md
index 9fd9f9a..da28f1c 100644 (file)
@@ -1,6 +1,6 @@
 ;; GCC machine description for IA-32 and x86-64.
 ;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 ;; Free Software Foundation, Inc.
 ;; Mostly by William Schelter.
 ;; x86_64 support added by Jan Hubicka
    (UNSPEC_XOP_TRUEFALSE       152)
    (UNSPEC_XOP_PERMUTE         153)
    (UNSPEC_FRCZ                        154)
-   (UNSPEC_LLWP_INTRINSIC      155)
-   (UNSPEC_SLWP_INTRINSIC      156)
-   (UNSPECV_LWPVAL_INTRINSIC   157)
-   (UNSPECV_LWPINS_INTRINSIC   158)
 
    ; For AES support
    (UNSPEC_AESENC              159)
    ; For AVX support
    (UNSPEC_PCMP                        166)
    (UNSPEC_VPERMIL             167)
-   (UNSPEC_VPERMIL2F128                168)
-   (UNSPEC_MASKLOAD            169)
-   (UNSPEC_MASKSTORE           170)
-   (UNSPEC_CAST                        171)
-   (UNSPEC_VTESTP              172)
+   (UNSPEC_VPERMIL2            168)
+   (UNSPEC_VPERMIL2F128                169)
+   (UNSPEC_MASKLOAD            170)
+   (UNSPEC_MASKSTORE           171)
+   (UNSPEC_CAST                        172)
+   (UNSPEC_VTESTP              173)
   ])
 
 (define_constants
    (UNSPECV_RDTSC              18)
    (UNSPECV_RDTSCP             19)
    (UNSPECV_RDPMC              20)
-   (UNSPECV_VSWAPMOV   21)
+   (UNSPECV_VSWAPMOV           21)
+   (UNSPECV_LLWP_INTRINSIC     22)
+   (UNSPECV_SLWP_INTRINSIC     23)
+   (UNSPECV_LWPVAL_INTRINSIC   24)
+   (UNSPECV_LWPINS_INTRINSIC   25)
   ])
 
 ;; Constants to represent pcomtrue/pcomfalse variants
 ;; if the instruction is complex.
 
 (define_attr "memory" "none,load,store,both,unknown"
-  (cond [(eq_attr "type" "other,multi,str")
+  (cond [(eq_attr "type" "other,multi,str,lwp")
           (const_string "unknown")
         (eq_attr "type" "lea,fcmov,fpspc")
           (const_string "none")
    (set_attr "type" "multi")])
 
 ;; All integer comparison codes.
-(define_code_iterator int_cond [ne eq ge gt le lt geu gtu leu ltu ])
+(define_code_iterator int_cond [ne eq ge gt le lt geu gtu leu ltu])
 
 ;; All floating-point comparison codes.
 (define_code_iterator fp_cond [unordered ordered
-                              uneq unge ungt unle unlt ltgt ])
+                              uneq unge ungt unle unlt ltgt])
 
 (define_code_iterator plusminus [plus minus])
 
                                 (umax "maxu") (umin "minu")])
 (define_code_attr maxminfprefix [(smax "max") (smin "min")])
 
-;; Mapping of parallel logic operators
-(define_code_iterator plogic [and ior xor])
+;; Mapping of logic operators
+(define_code_iterator any_logic [and ior xor])
+(define_code_iterator any_or [ior xor])
 
 ;; Base name for insn mnemonic.
-(define_code_attr plogicprefix [(and "and") (ior "or") (xor "xor")])
+(define_code_attr logicprefix [(and "and") (ior "or") (xor "xor")])
 
 ;; Mapping of abs neg operators
 (define_code_iterator absneg [abs neg])
 ;; Used in signed and unsigned widening multiplications.
 (define_code_iterator any_extend [sign_extend zero_extend])
 
-;; Used in signed and unsigned divisions.
-(define_code_iterator any_div [div udiv])
-
 ;; Various insn prefixes for signed and unsigned operations.
 (define_code_attr u [(sign_extend "") (zero_extend "u")
                     (div "") (udiv "u")])
 (define_code_attr s [(sign_extend "s") (zero_extend "u")])
 
+;; Used in signed and unsigned divisions.
+(define_code_iterator any_div [div udiv])
+
 ;; Instruction prefix for signed and unsigned operations.
 (define_code_attr sgnprefix [(sign_extend "i") (zero_extend "")
                             (div "i") (udiv "")])
   "TARGET_80387
    || ((<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
        && SSE_FLOAT_MODE_P (<X87MODEF:MODE>mode) && TARGET_SSE_MATH)"
-  "
 {
   if (!((<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
        && SSE_FLOAT_MODE_P (<X87MODEF:MODE>mode) && TARGET_SSE_MATH)
       emit_insn (insn);
       DONE;
     }
-}")
+})
 
 ;; Pre-reload splitter to add memory clobber to the pattern.
 (define_insn_and_split "*float<SSEMODEI24:mode><X87MODEF:mode>2_1"
    operands[1] = gen_lowpart (QImode, operands[1]);
    operands[2] = gen_lowpart (QImode, operands[2]);")
 \f
-;; Logical inclusive OR instructions
+;; Logical inclusive and exclusive OR instructions
 
 ;; %%% This used to optimize known byte-wide and operations to memory.
 ;; If this is considered useful, it should be done with splitters.
 
-(define_expand "ior<mode>3"
+(define_expand "<code><mode>3"
   [(set (match_operand:SWIM 0 "nonimmediate_operand" "")
-       (ior:SWIM (match_operand:SWIM 1 "nonimmediate_operand" "")
-                 (match_operand:SWIM 2 "<general_operand>" "")))]
+       (any_or:SWIM (match_operand:SWIM 1 "nonimmediate_operand" "")
+                    (match_operand:SWIM 2 "<general_operand>" "")))]
   ""
-  "ix86_expand_binary_operator (IOR, <MODE>mode, operands); DONE;")
+  "ix86_expand_binary_operator (<CODE>, <MODE>mode, operands); DONE;")
 
-(define_insn "*ior<mode>_1"
+(define_insn "*<code><mode>_1"
   [(set (match_operand:SWI248 0 "nonimmediate_operand" "=r,rm")
-       (ior:SWI248 (match_operand:SWI248 1 "nonimmediate_operand" "%0,0")
-                   (match_operand:SWI248 2 "<general_operand>" "<g>,r<i>")))
+       (any_or:SWI248
+        (match_operand:SWI248 1 "nonimmediate_operand" "%0,0")
+        (match_operand:SWI248 2 "<general_operand>" "<g>,r<i>")))
    (clobber (reg:CC FLAGS_REG))]
-  "ix86_binary_operator_ok (IOR, <MODE>mode, operands)"
-  "or{<imodesuffix>}\t{%2, %0|%0, %2}"
+  "ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+  "<logicprefix>{<imodesuffix>}\t{%2, %0|%0, %2}"
   [(set_attr "type" "alu")
    (set_attr "mode" "<MODE>")])
 
 ;; %%% Potential partial reg stall on alternative 2.  What to do?
-(define_insn "*iorqi_1"
+(define_insn "*<code>qi_1"
   [(set (match_operand:QI 0 "nonimmediate_operand" "=q,m,r")
-       (ior:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
-               (match_operand:QI 2 "general_operand" "qmn,qn,rn")))
+       (any_or:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
+                  (match_operand:QI 2 "general_operand" "qmn,qn,rn")))
    (clobber (reg:CC FLAGS_REG))]
-  "ix86_binary_operator_ok (IOR, QImode, operands)"
+  "ix86_binary_operator_ok (<CODE>, QImode, operands)"
   "@
-   or{b}\t{%2, %0|%0, %2}
-   or{b}\t{%2, %0|%0, %2}
-   or{l}\t{%k2, %k0|%k0, %k2}"
+   <logicprefix>{b}\t{%2, %0|%0, %2}
+   <logicprefix>{b}\t{%2, %0|%0, %2}
+   <logicprefix>{l}\t{%k2, %k0|%k0, %k2}"
   [(set_attr "type" "alu")
    (set_attr "mode" "QI,QI,SI")])
 
 ;; See comment for addsi_1_zext why we do use nonimmediate_operand
-(define_insn "*iorsi_1_zext"
+(define_insn "*<code>si_1_zext"
   [(set (match_operand:DI 0 "register_operand" "=r")
        (zero_extend:DI
-         (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
-                 (match_operand:SI 2 "general_operand" "g"))))
+        (any_or:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
+                   (match_operand:SI 2 "general_operand" "g"))))
    (clobber (reg:CC FLAGS_REG))]
-  "TARGET_64BIT && ix86_binary_operator_ok (IOR, SImode, operands)"
-  "or{l}\t{%2, %k0|%k0, %2}"
+  "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
+  "<logicprefix>{l}\t{%2, %k0|%k0, %2}"
   [(set_attr "type" "alu")
    (set_attr "mode" "SI")])
 
-(define_insn "*iorsi_1_zext_imm"
+(define_insn "*<code>si_1_zext_imm"
   [(set (match_operand:DI 0 "register_operand" "=r")
-       (ior:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "%0"))
-               (match_operand:DI 2 "x86_64_zext_immediate_operand" "Z")))
+       (any_or:DI
+        (zero_extend:DI (match_operand:SI 1 "register_operand" "%0"))
+        (match_operand:DI 2 "x86_64_zext_immediate_operand" "Z")))
    (clobber (reg:CC FLAGS_REG))]
-  "TARGET_64BIT && ix86_binary_operator_ok (IOR, SImode, operands)"
-  "or{l}\t{%2, %k0|%k0, %2}"
+  "TARGET_64BIT && ix86_binary_operator_ok (<CODE>, SImode, operands)"
+  "<logicprefix>{l}\t{%2, %k0|%k0, %2}"
   [(set_attr "type" "alu")
    (set_attr "mode" "SI")])
 
-(define_insn "*iorqi_1_slp"
+(define_insn "*<code>qi_1_slp"
   [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+q,m"))
-       (ior:QI (match_dup 0)
-               (match_operand:QI 1 "general_operand" "qmn,qn")))
+       (any_or:QI (match_dup 0)
+                  (match_operand:QI 1 "general_operand" "qmn,qn")))
    (clobber (reg:CC FLAGS_REG))]
   "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
    && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
-  "or{b}\t{%1, %0|%0, %1}"
+  "<logicprefix>{b}\t{%1, %0|%0, %1}"
   [(set_attr "type" "alu1")
    (set_attr "mode" "QI")])
 
-(define_insn "*ior<mode>_2"
+(define_insn "*<code><mode>_2"
   [(set (reg FLAGS_REG)
-       (compare (ior:SWI
+       (compare (any_or:SWI
                  (match_operand:SWI 1 "nonimmediate_operand" "%0,0")
                  (match_operand:SWI 2 "<general_operand>" "<g>,<r><i>"))
                 (const_int 0)))
    (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>,<r>m")
-       (ior:SWI (match_dup 1) (match_dup 2)))]
+       (any_or:SWI (match_dup 1) (match_dup 2)))]
   "ix86_match_ccmode (insn, CCNOmode)
-   && ix86_binary_operator_ok (IOR, <MODE>mode, operands)"
-  "or{<imodesuffix>}\t{%2, %0|%0, %2}"
+   && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+  "<logicprefix>{<imodesuffix>}\t{%2, %0|%0, %2}"
   [(set_attr "type" "alu")
    (set_attr "mode" "<MODE>")])
 
 ;; See comment for addsi_1_zext why we do use nonimmediate_operand
 ;; ??? Special case for immediate operand is missing - it is tricky.
-(define_insn "*iorsi_2_zext"
+(define_insn "*<code>si_2_zext"
   [(set (reg FLAGS_REG)
-       (compare (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
-                        (match_operand:SI 2 "general_operand" "g"))
+       (compare (any_or:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
+                           (match_operand:SI 2 "general_operand" "g"))
                 (const_int 0)))
    (set (match_operand:DI 0 "register_operand" "=r")
-       (zero_extend:DI (ior:SI (match_dup 1) (match_dup 2))))]
+       (zero_extend:DI (any_or:SI (match_dup 1) (match_dup 2))))]
   "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)
-   && ix86_binary_operator_ok (IOR, SImode, operands)"
-  "or{l}\t{%2, %k0|%k0, %2}"
+   && ix86_binary_operator_ok (<CODE>, SImode, operands)"
+  "<logicprefix>{l}\t{%2, %k0|%k0, %2}"
   [(set_attr "type" "alu")
    (set_attr "mode" "SI")])
 
-(define_insn "*iorsi_2_zext_imm"
+(define_insn "*<code>si_2_zext_imm"
   [(set (reg FLAGS_REG)
-       (compare (ior:SI
+       (compare (any_or:SI
                  (match_operand:SI 1 "nonimmediate_operand" "%0")
                  (match_operand:SI 2 "x86_64_zext_immediate_operand" "Z"))
                 (const_int 0)))
    (set (match_operand:DI 0 "register_operand" "=r")
-       (ior:DI (zero_extend:DI (match_dup 1)) (match_dup 2)))]
+       (any_or:DI (zero_extend:DI (match_dup 1)) (match_dup 2)))]
   "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)
-   && ix86_binary_operator_ok (IOR, SImode, operands)"
-  "or{l}\t{%2, %k0|%k0, %2}"
+   && ix86_binary_operator_ok (<CODE>, SImode, operands)"
+  "<logicprefix>{l}\t{%2, %k0|%k0, %2}"
   [(set_attr "type" "alu")
    (set_attr "mode" "SI")])
 
-(define_insn "*iorqi_2_slp"
+(define_insn "*<code>qi_2_slp"
   [(set (reg FLAGS_REG)
-       (compare (ior:QI (match_operand:QI 0 "nonimmediate_operand" "+q,qm")
-                        (match_operand:QI 1 "general_operand" "qmn,qn"))
+       (compare (any_or:QI (match_operand:QI 0 "nonimmediate_operand" "+q,qm")
+                           (match_operand:QI 1 "general_operand" "qmn,qn"))
                 (const_int 0)))
    (set (strict_low_part (match_dup 0))
-       (ior:QI (match_dup 0) (match_dup 1)))]
+       (any_or:QI (match_dup 0) (match_dup 1)))]
   "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
    && ix86_match_ccmode (insn, CCNOmode)
    && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
-  "or{b}\t{%1, %0|%0, %1}"
+  "<logicprefix>{b}\t{%1, %0|%0, %1}"
   [(set_attr "type" "alu1")
    (set_attr "mode" "QI")])
 
-(define_insn "*ior<mode>_3"
+(define_insn "*<code><mode>_3"
   [(set (reg FLAGS_REG)
-       (compare (ior:SWI
+       (compare (any_or:SWI
                  (match_operand:SWI 1 "nonimmediate_operand" "%0")
                  (match_operand:SWI 2 "<general_operand>" "<g>"))
                 (const_int 0)))
    (clobber (match_scratch:SWI 0 "=<r>"))]
   "ix86_match_ccmode (insn, CCNOmode)
-   && ix86_binary_operator_ok (IOR, <MODE>mode, operands)"
-  "or{<imodesuffix>}\t{%2, %0|%0, %2}"
+   && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+  "<logicprefix>{<imodesuffix>}\t{%2, %0|%0, %2}"
   [(set_attr "type" "alu")
    (set_attr "mode" "<MODE>")])
 
-(define_insn "*iorqi_ext_0"
+(define_insn "*<code>qi_ext_0"
   [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
                         (const_int 8)
                         (const_int 8))
-       (ior:SI
+       (any_or:SI
          (zero_extract:SI
            (match_operand 1 "ext_register_operand" "0")
            (const_int 8)
          (match_operand 2 "const_int_operand" "n")))
    (clobber (reg:CC FLAGS_REG))]
   "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
-  "or{b}\t{%2, %h0|%h0, %2}"
+  "<logicprefix>{b}\t{%2, %h0|%h0, %2}"
   [(set_attr "type" "alu")
    (set_attr "length_immediate" "1")
    (set_attr "modrm" "1")
    (set_attr "mode" "QI")])
 
-(define_insn "*iorqi_ext_1_rex64"
+(define_insn "*<code>qi_ext_1_rex64"
   [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
                         (const_int 8)
                         (const_int 8))
-       (ior:SI
+       (any_or:SI
          (zero_extract:SI
            (match_operand 1 "ext_register_operand" "0")
            (const_int 8)
    (clobber (reg:CC FLAGS_REG))]
   "TARGET_64BIT
    && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
-  "or{b}\t{%2, %h0|%h0, %2}"
+  "<logicprefix>{b}\t{%2, %h0|%h0, %2}"
   [(set_attr "type" "alu")
    (set_attr "length_immediate" "0")
    (set_attr "mode" "QI")])
 
-(define_insn "*iorqi_ext_1"
+(define_insn "*<code>qi_ext_1"
   [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
                         (const_int 8)
                         (const_int 8))
-       (ior:SI
+       (any_or:SI
          (zero_extract:SI
            (match_operand 1 "ext_register_operand" "0")
            (const_int 8)
    (clobber (reg:CC FLAGS_REG))]
   "!TARGET_64BIT
    && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
-  "or{b}\t{%2, %h0|%h0, %2}"
+  "<logicprefix>{b}\t{%2, %h0|%h0, %2}"
   [(set_attr "type" "alu")
    (set_attr "length_immediate" "0")
    (set_attr "mode" "QI")])
 
-(define_insn "*iorqi_ext_2"
+(define_insn "*<code>qi_ext_2"
   [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
                         (const_int 8)
                         (const_int 8))
-       (ior:SI
+       (any_or:SI
          (zero_extract:SI (match_operand 1 "ext_register_operand" "0")
                           (const_int 8)
                           (const_int 8))
                           (const_int 8))))
    (clobber (reg:CC FLAGS_REG))]
   "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
-  "ior{b}\t{%h2, %h0|%h0, %h2}"
+  "<logicprefix>{b}\t{%h2, %h0|%h0, %h2}"
   [(set_attr "type" "alu")
    (set_attr "length_immediate" "0")
    (set_attr "mode" "QI")])
 
 (define_split
   [(set (match_operand 0 "register_operand" "")
-       (ior (match_operand 1 "register_operand" "")
-            (match_operand 2 "const_int_operand" "")))
+       (any_or (match_operand 1 "register_operand" "")
+               (match_operand 2 "const_int_operand" "")))
    (clobber (reg:CC FLAGS_REG))]
    "reload_completed
     && QI_REG_P (operands[0])
     && !(INTVAL (operands[2]) & ~(255 << 8))
     && GET_MODE (operands[0]) != QImode"
   [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8))
-                  (ior:SI (zero_extract:SI (match_dup 1)
-                                           (const_int 8) (const_int 8))
-                          (match_dup 2)))
+                  (any_or:SI (zero_extract:SI (match_dup 1)
+                                              (const_int 8) (const_int 8))
+                             (match_dup 2)))
              (clobber (reg:CC FLAGS_REG))])]
   "operands[0] = gen_lowpart (SImode, operands[0]);
    operands[1] = gen_lowpart (SImode, operands[1]);
 ;; profitable when 7th bit is set.
 (define_split
   [(set (match_operand 0 "register_operand" "")
-       (ior (match_operand 1 "general_operand" "")
-            (match_operand 2 "const_int_operand" "")))
+       (any_or (match_operand 1 "general_operand" "")
+               (match_operand 2 "const_int_operand" "")))
    (clobber (reg:CC FLAGS_REG))]
    "reload_completed
     && ANY_QI_REG_P (operands[0])
     && (INTVAL (operands[2]) & 128)
     && GET_MODE (operands[0]) != QImode"
   [(parallel [(set (strict_low_part (match_dup 0))
-                  (ior:QI (match_dup 1)
-                          (match_dup 2)))
+                  (any_or:QI (match_dup 1)
+                             (match_dup 2)))
              (clobber (reg:CC FLAGS_REG))])]
   "operands[0] = gen_lowpart (QImode, operands[0]);
    operands[1] = gen_lowpart (QImode, operands[1]);
    operands[2] = gen_lowpart (QImode, operands[2]);")
-\f
-;; Logical XOR instructions
-
-;; %%% This used to optimize known byte-wide and operations to memory.
-;; If this is considered useful, it should be done with splitters.
-
-(define_expand "xor<mode>3"
-  [(set (match_operand:SWIM 0 "nonimmediate_operand" "")
-       (xor:SWIM (match_operand:SWIM 1 "nonimmediate_operand" "")
-                 (match_operand:SWIM 2 "<general_operand>" "")))]
-  ""
-  "ix86_expand_binary_operator (XOR, <MODE>mode, operands); DONE;")
-
-(define_insn "*xor<mode>_1"
-  [(set (match_operand:SWI248 0 "nonimmediate_operand" "=r,rm")
-       (xor:SWI248 (match_operand:SWI248 1 "nonimmediate_operand" "%0,0")
-                   (match_operand:SWI248 2 "<general_operand>" "<g>,r<i>")))
-   (clobber (reg:CC FLAGS_REG))]
-  "ix86_binary_operator_ok (XOR, <MODE>mode, operands)"
-  "xor{<imodesuffix>}\t{%2, %0|%0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "mode" "<MODE>")])
-
-;; %%% Potential partial reg stall on alternative 2.  What to do?
-(define_insn "*xorqi_1"
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=q,m,r")
-       (xor:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0,0")
-               (match_operand:QI 2 "general_operand" "qmn,qn,rn")))
-   (clobber (reg:CC FLAGS_REG))]
-  "ix86_binary_operator_ok (XOR, QImode, operands)"
-  "@
-   xor{b}\t{%2, %0|%0, %2}
-   xor{b}\t{%2, %0|%0, %2}
-   xor{l}\t{%k2, %k0|%k0, %k2}"
-  [(set_attr "type" "alu")
-   (set_attr "mode" "QI,QI,SI")])
-
-;; See comment for addsi_1_zext why we do use nonimmediate_operand
-;; Add speccase for immediates
-(define_insn "*xorsi_1_zext"
-  [(set (match_operand:DI 0 "register_operand" "=r")
-       (zero_extend:DI
-         (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
-                 (match_operand:SI 2 "general_operand" "g"))))
-   (clobber (reg:CC FLAGS_REG))]
-  "TARGET_64BIT && ix86_binary_operator_ok (XOR, SImode, operands)"
-  "xor{l}\t{%2, %k0|%k0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "mode" "SI")])
-
-(define_insn "*xorsi_1_zext_imm"
-  [(set (match_operand:DI 0 "register_operand" "=r")
-       (xor:DI (zero_extend:DI (match_operand:SI 1 "register_operand" "%0"))
-               (match_operand:DI 2 "x86_64_zext_immediate_operand" "Z")))
-   (clobber (reg:CC FLAGS_REG))]
-  "TARGET_64BIT && ix86_binary_operator_ok (XOR, SImode, operands)"
-  "xor{l}\t{%2, %k0|%k0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "mode" "SI")])
-
-(define_insn "*xorqi_1_slp"
-  [(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q"))
-       (xor:QI (match_dup 0)
-               (match_operand:QI 1 "general_operand" "qn,qmn")))
-   (clobber (reg:CC FLAGS_REG))]
-  "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
-   && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
-  "xor{b}\t{%1, %0|%0, %1}"
-  [(set_attr "type" "alu1")
-   (set_attr "mode" "QI")])
-
-(define_insn "*xor<mode>_2"
-  [(set (reg FLAGS_REG)
-       (compare (xor:SWI
-                 (match_operand:SWI 1 "nonimmediate_operand" "%0,0")
-                 (match_operand:SWI 2 "<general_operand>" "<g>,<r><i>"))
-                (const_int 0)))
-   (set (match_operand:SWI 0 "nonimmediate_operand" "=<r>,<r>m")
-       (xor:SWI (match_dup 1) (match_dup 2)))]
-  "ix86_match_ccmode (insn, CCNOmode)
-   && ix86_binary_operator_ok (XOR, <MODE>mode, operands)"
-  "xor{<imodesuffix>}\t{%2, %0|%0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "mode" "<MODE>")])
-
-;; See comment for addsi_1_zext why we do use nonimmediate_operand
-;; ??? Special case for immediate operand is missing - it is tricky.
-(define_insn "*xorsi_2_zext"
-  [(set (reg FLAGS_REG)
-       (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
-                        (match_operand:SI 2 "general_operand" "g"))
-                (const_int 0)))
-   (set (match_operand:DI 0 "register_operand" "=r")
-       (zero_extend:DI (xor:SI (match_dup 1) (match_dup 2))))]
-  "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)
-   && ix86_binary_operator_ok (XOR, SImode, operands)"
-  "xor{l}\t{%2, %k0|%k0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "mode" "SI")])
-
-(define_insn "*xorsi_2_zext_imm"
-  [(set (reg FLAGS_REG)
-       (compare (xor:SI (match_operand:SI 1 "nonimmediate_operand" "%0")
-                        (match_operand 2 "x86_64_zext_immediate_operand" "Z"))
-                (const_int 0)))
-   (set (match_operand:DI 0 "register_operand" "=r")
-       (xor:DI (zero_extend:DI (match_dup 1)) (match_dup 2)))]
-  "TARGET_64BIT && ix86_match_ccmode (insn, CCNOmode)
-   && ix86_binary_operator_ok (XOR, SImode, operands)"
-  "xor{l}\t{%2, %k0|%k0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "mode" "SI")])
-
-(define_insn "*xorqi_2_slp"
-  [(set (reg FLAGS_REG)
-       (compare (xor:QI (match_operand:QI 0 "nonimmediate_operand" "+q,qm")
-                        (match_operand:QI 1 "general_operand" "qmn,qn"))
-                (const_int 0)))
-   (set (strict_low_part (match_dup 0))
-       (xor:QI (match_dup 0) (match_dup 1)))]
-  "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
-   && ix86_match_ccmode (insn, CCNOmode)
-   && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
-  "xor{b}\t{%1, %0|%0, %1}"
-  [(set_attr "type" "alu1")
-   (set_attr "mode" "QI")])
-
-(define_insn "*xor<mode>_3"
-  [(set (reg FLAGS_REG)
-       (compare (xor:SWI
-                 (match_operand:SWI 1 "nonimmediate_operand" "%0")
-                 (match_operand:SWI 2 "<general_operand>" "<g>"))
-                (const_int 0)))
-   (clobber (match_scratch:SWI 0 "=<r>"))]
-  "ix86_match_ccmode (insn, CCNOmode)
-   && ix86_binary_operator_ok (XOR, <MODE>mode, operands)"
-  "xor{<imodesuffix>}\t{%2, %0|%0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "mode" "<MODE>")])
-
-(define_insn "*xorqi_ext_0"
-  [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
-                        (const_int 8)
-                        (const_int 8))
-       (xor:SI
-         (zero_extract:SI
-           (match_operand 1 "ext_register_operand" "0")
-           (const_int 8)
-           (const_int 8))
-         (match_operand 2 "const_int_operand" "n")))
-   (clobber (reg:CC FLAGS_REG))]
-  "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
-  "xor{b}\t{%2, %h0|%h0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "length_immediate" "1")
-   (set_attr "modrm" "1")
-   (set_attr "mode" "QI")])
-
-(define_insn "*xorqi_ext_1_rex64"
-  [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
-                        (const_int 8)
-                        (const_int 8))
-       (xor:SI
-         (zero_extract:SI
-           (match_operand 1 "ext_register_operand" "0")
-           (const_int 8)
-           (const_int 8))
-         (zero_extend:SI
-           (match_operand 2 "ext_register_operand" "Q"))))
-   (clobber (reg:CC FLAGS_REG))]
-  "TARGET_64BIT
-   && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
-  "xor{b}\t{%2, %h0|%h0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "length_immediate" "0")
-   (set_attr "mode" "QI")])
-
-(define_insn "*xorqi_ext_1"
-  [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
-                        (const_int 8)
-                        (const_int 8))
-       (xor:SI
-         (zero_extract:SI
-           (match_operand 1 "ext_register_operand" "0")
-           (const_int 8)
-           (const_int 8))
-         (zero_extend:SI
-           (match_operand:QI 2 "general_operand" "Qm"))))
-   (clobber (reg:CC FLAGS_REG))]
-  "!TARGET_64BIT
-   && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
-  "xor{b}\t{%2, %h0|%h0, %2}"
-  [(set_attr "type" "alu")
-   (set_attr "length_immediate" "0")
-   (set_attr "mode" "QI")])
-
-(define_insn "*xorqi_ext_2"
-  [(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
-                        (const_int 8)
-                        (const_int 8))
-       (xor:SI
-         (zero_extract:SI (match_operand 1 "ext_register_operand" "0")
-                          (const_int 8)
-                          (const_int 8))
-         (zero_extract:SI (match_operand 2 "ext_register_operand" "Q")
-                          (const_int 8)
-                          (const_int 8))))
-   (clobber (reg:CC FLAGS_REG))]
-  "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
-  "xor{b}\t{%h2, %h0|%h0, %h2}"
-  [(set_attr "type" "alu")
-   (set_attr "length_immediate" "0")
-   (set_attr "mode" "QI")])
 
 (define_expand "xorqi_cc_ext_1"
   [(parallel [
   [(set_attr "type" "alu")
    (set_attr "modrm" "1")
    (set_attr "mode" "QI")])
-
-(define_split
-  [(set (match_operand 0 "register_operand" "")
-       (xor (match_operand 1 "register_operand" "")
-            (match_operand 2 "const_int_operand" "")))
-   (clobber (reg:CC FLAGS_REG))]
-   "reload_completed
-    && QI_REG_P (operands[0])
-    && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
-    && !(INTVAL (operands[2]) & ~(255 << 8))
-    && GET_MODE (operands[0]) != QImode"
-  [(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8))
-                  (xor:SI (zero_extract:SI (match_dup 1)
-                                           (const_int 8) (const_int 8))
-                          (match_dup 2)))
-             (clobber (reg:CC FLAGS_REG))])]
-  "operands[0] = gen_lowpart (SImode, operands[0]);
-   operands[1] = gen_lowpart (SImode, operands[1]);
-   operands[2] = gen_int_mode ((INTVAL (operands[2]) >> 8) & 0xff, SImode);")
-
-;; Since XOR can be encoded with sign extended immediate, this is only
-;; profitable when 7th bit is set.
-(define_split
-  [(set (match_operand 0 "register_operand" "")
-       (xor (match_operand 1 "general_operand" "")
-            (match_operand 2 "const_int_operand" "")))
-   (clobber (reg:CC FLAGS_REG))]
-   "reload_completed
-    && ANY_QI_REG_P (operands[0])
-    && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
-    && !(INTVAL (operands[2]) & ~255)
-    && (INTVAL (operands[2]) & 128)
-    && GET_MODE (operands[0]) != QImode"
-  [(parallel [(set (strict_low_part (match_dup 0))
-                  (xor:QI (match_dup 1)
-                          (match_dup 2)))
-             (clobber (reg:CC FLAGS_REG))])]
-  "operands[0] = gen_lowpart (QImode, operands[0]);
-   operands[1] = gen_lowpart (QImode, operands[1]);
-   operands[2] = gen_lowpart (QImode, operands[2]);")
 \f
 ;; Negation instructions
 
   "TARGET_64BIT"
   "ix86_expand_binary_operator (ASHIFT, TImode, operands); DONE;")
 
-;; This pattern must be defined before *ashlti3_1 to prevent
-;; combine pass from converting sse2_ashlti3 to *ashlti3_1.
-
-(define_insn "*avx_ashlti3"
-  [(set (match_operand:TI 0 "register_operand" "=x")
-       (ashift:TI (match_operand:TI 1 "register_operand" "x")
-                  (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))]
-  "TARGET_AVX"
-{
-  operands[2] = GEN_INT (INTVAL (operands[2]) / 8);
-  return "vpslldq\t{%2, %1, %0|%0, %1, %2}";
-}
-  [(set_attr "type" "sseishft")
-   (set_attr "prefix" "vex")
-   (set_attr "length_immediate" "1")
-   (set_attr "mode" "TI")])
-
-(define_insn "sse2_ashlti3"
-  [(set (match_operand:TI 0 "register_operand" "=x")
-       (ashift:TI (match_operand:TI 1 "register_operand" "0")
-                  (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))]
-  "TARGET_SSE2"
-{
-  operands[2] = GEN_INT (INTVAL (operands[2]) / 8);
-  return "pslldq\t{%2, %0|%0, %2}";
-}
-  [(set_attr "type" "sseishft")
-   (set_attr "prefix_data16" "1")
-   (set_attr "length_immediate" "1")
-   (set_attr "mode" "TI")])
-
 (define_insn "*ashlti3_1"
   [(set (match_operand:TI 0 "register_operand" "=&r,r")
        (ashift:TI (match_operand:TI 1 "reg_or_pm1_operand" "n,0")
   "TARGET_64BIT"
   "ix86_expand_binary_operator (LSHIFTRT, TImode, operands); DONE;")
 
-;; This pattern must be defined before *lshrti3_1 to prevent
-;; combine pass from converting sse2_lshrti3 to *lshrti3_1.
-
-(define_insn "*avx_lshrti3"
-  [(set (match_operand:TI 0 "register_operand" "=x")
-       (lshiftrt:TI (match_operand:TI 1 "register_operand" "x")
-                    (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))]
-  "TARGET_AVX"
-{
-  operands[2] = GEN_INT (INTVAL (operands[2]) / 8);
-  return "vpsrldq\t{%2, %1, %0|%0, %1, %2}";
-}
-  [(set_attr "type" "sseishft")
-   (set_attr "prefix" "vex")
-   (set_attr "length_immediate" "1")
-   (set_attr "mode" "TI")])
-
-(define_insn "sse2_lshrti3"
-  [(set (match_operand:TI 0 "register_operand" "=x")
-       (lshiftrt:TI (match_operand:TI 1 "register_operand" "0")
-                    (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))]
-  "TARGET_SSE2"
-{
-  operands[2] = GEN_INT (INTVAL (operands[2]) / 8);
-  return "psrldq\t{%2, %0|%0, %2}";
-}
-  [(set_attr "type" "sseishft")
-   (set_attr "prefix_data16" "1")
-   (set_attr "length_immediate" "1")
-   (set_attr "mode" "TI")])
-
 (define_insn "*lshrti3_1"
   [(set (match_operand:TI 0 "register_operand" "=r")
        (lshiftrt:TI (match_operand:TI 1 "register_operand" "0")
   [(set_attr "type" "multi")
    (set_attr "length" "12")])
 
-(define_insn "*tls_global_dynamic_32_sun"
-  [(set (match_operand:SI 0 "register_operand" "=a")
-       (unspec:SI [(match_operand:SI 1 "register_operand" "b")
-                   (match_operand:SI 2 "tls_symbolic_operand" "")
-                   (match_operand:SI 3 "call_insn_operand" "")]
-                   UNSPEC_TLS_GD))
-   (clobber (match_scratch:SI 4 "=d"))
-   (clobber (match_scratch:SI 5 "=c"))
-   (clobber (reg:CC FLAGS_REG))]
-  "!TARGET_64BIT && TARGET_SUN_TLS"
-  "lea{l}\t{%a2@DTLNDX(%1), %4|%4, %a2@DTLNDX[%1]}
-       push{l}\t%4\;call\t%a2@TLSPLT\;pop{l}\t%4\;nop"
-  [(set_attr "type" "multi")
-   (set_attr "length" "14")])
-
 (define_expand "tls_global_dynamic_32"
   [(parallel [(set (match_operand:SI 0 "register_operand" "")
                   (unspec:SI
   [(set_attr "type" "multi")
    (set_attr "length" "11")])
 
-(define_insn "*tls_local_dynamic_base_32_sun"
-  [(set (match_operand:SI 0 "register_operand" "=a")
-       (unspec:SI [(match_operand:SI 1 "register_operand" "b")
-                    (match_operand:SI 2 "call_insn_operand" "")]
-                  UNSPEC_TLS_LD_BASE))
-   (clobber (match_scratch:SI 3 "=d"))
-   (clobber (match_scratch:SI 4 "=c"))
-   (clobber (reg:CC FLAGS_REG))]
-  "!TARGET_64BIT && TARGET_SUN_TLS"
-  "lea{l}\t{%&@TMDNX(%1), %3|%3, %&@TMDNX[%1]}
-       push{l}\t%3\;call\t%&@TLSPLT\;pop{l}\t%3"
-  [(set_attr "type" "multi")
-   (set_attr "length" "13")])
-
 (define_expand "tls_local_dynamic_base_32"
   [(parallel [(set (match_operand:SI 0 "register_operand" "")
                   (unspec:SI [(match_dup 1) (match_dup 2)]
 ;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(define_insn "lwp_llwpcbhi1"
-  [(unspec [(match_operand:HI 0 "register_operand" "r")]
-          UNSPEC_LLWP_INTRINSIC)]
-  "TARGET_LWP"
-  "llwpcb\t%0"
-  [(set_attr "type" "lwp")
-   (set_attr "mode" "HI")])
-
-(define_insn "lwp_llwpcbsi1"
-  [(unspec [(match_operand:SI 0 "register_operand" "r")]
-          UNSPEC_LLWP_INTRINSIC)]
+(define_expand "lwp_llwpcb"
+  [(unspec_volatile [(match_operand 0 "register_operand" "r")]
+                   UNSPECV_LLWP_INTRINSIC)]
   "TARGET_LWP"
-  "llwpcb\t%0"
-  [(set_attr "type" "lwp")
-   (set_attr "mode" "SI")])
+  "")
 
-(define_insn "lwp_llwpcbdi1"
-  [(unspec [(match_operand:DI 0 "register_operand" "r")]
-          UNSPEC_LLWP_INTRINSIC)]
+(define_insn "*lwp_llwpcb<mode>1"
+  [(unspec_volatile [(match_operand:P 0 "register_operand" "r")]
+                   UNSPECV_LLWP_INTRINSIC)]
   "TARGET_LWP"
   "llwpcb\t%0"
   [(set_attr "type" "lwp")
-   (set_attr "mode" "DI")])
-
-(define_insn "lwp_slwpcbhi1"
-  [(unspec [(match_operand:HI 0 "register_operand" "r")]
-          UNSPEC_SLWP_INTRINSIC)]
-  "TARGET_LWP"
-  "slwpcb\t%0"
-  [(set_attr "type" "lwp")
-   (set_attr "mode" "HI")])
+   (set_attr "mode" "<MODE>")
+   (set_attr "length" "5")])
 
-(define_insn "lwp_slwpcbsi1"
-  [(unspec [(match_operand:SI 0 "register_operand" "r")]
-          UNSPEC_SLWP_INTRINSIC)]
+(define_expand "lwp_slwpcb"
+  [(set (match_operand 0 "register_operand" "=r")
+       (unspec_volatile [(const_int 0)] UNSPECV_SLWP_INTRINSIC))]
   "TARGET_LWP"
-  "slwpcb\t%0"
-  [(set_attr "type" "lwp")
-   (set_attr "mode" "SI")])
-
-(define_insn "lwp_slwpcbdi1"
-  [(unspec [(match_operand:DI 0 "register_operand" "r")]
-          UNSPEC_SLWP_INTRINSIC)]
+  {
+    if (TARGET_64BIT)
+      emit_insn (gen_lwp_slwpcbdi (operands[0]));
+    else
+      emit_insn (gen_lwp_slwpcbsi (operands[0]));
+    DONE;
+  })
+
+(define_insn "lwp_slwpcb<mode>"
+  [(set (match_operand:P 0 "register_operand" "=r")
+       (unspec_volatile:P [(const_int 0)] UNSPECV_SLWP_INTRINSIC))]
   "TARGET_LWP"
   "slwpcb\t%0"
   [(set_attr "type" "lwp")
-   (set_attr "mode" "DI")])
-
-(define_insn "lwp_lwpvalhi3"
-  [(unspec_volatile [(match_operand:HI 0 "register_operand" "r")
-                    (match_operand:SI 1 "nonimmediate_operand" "rm")
-                    (match_operand:HI 2 "const_int_operand" "")]
-                   UNSPECV_LWPVAL_INTRINSIC)]
-  "TARGET_LWP"
-  "lwpval\t{%2, %1, %0|%0, %1, %2}"
-  [(set_attr "type" "lwp")
-   (set_attr "mode" "HI")])
+   (set_attr "mode" "<MODE>")
+   (set_attr "length" "5")])
 
-(define_insn "lwp_lwpvalsi3"
-  [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")
-                    (match_operand:SI 1 "nonimmediate_operand" "rm")
-                    (match_operand:SI 2 "const_int_operand" "")]
+(define_expand "lwp_lwpval<mode>3"
+  [(unspec_volatile [(match_operand:SWI48 1 "register_operand" "r")
+                    (match_operand:SI 2 "nonimmediate_operand" "rm")
+                    (match_operand:SI 3 "const_int_operand" "i")]
                    UNSPECV_LWPVAL_INTRINSIC)]
   "TARGET_LWP"
-  "lwpval\t{%2, %1, %0|%0, %1, %2}"
-  [(set_attr "type" "lwp")
-   (set_attr "mode" "SI")])
+  "/* Avoid unused variable warning.  */
+   (void) operand0;")
 
-(define_insn "lwp_lwpvaldi3"
-  [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")
-                    (match_operand:SI 1 "nonimmediate_operand" "rm")
-                    (match_operand:SI 2 "const_int_operand" "")]
+(define_insn "*lwp_lwpval<mode>3_1"
+  [(unspec_volatile [(match_operand:SWI48 0 "register_operand" "r")
+                    (match_operand:SI 1 "nonimmediate_operand" "rm")
+                    (match_operand:SI 2 "const_int_operand" "i")]
                    UNSPECV_LWPVAL_INTRINSIC)]
   "TARGET_LWP"
   "lwpval\t{%2, %1, %0|%0, %1, %2}"
   [(set_attr "type" "lwp")
-   (set_attr "mode" "DI")])
-
-(define_insn "lwp_lwpinshi3"
-  [(unspec_volatile [(match_operand:HI 0 "register_operand" "r")
-                    (match_operand:SI 1 "nonimmediate_operand" "rm")
-                    (match_operand:HI 2 "const_int_operand" "")]
-                   UNSPECV_LWPINS_INTRINSIC)]
-  "TARGET_LWP"
-  "lwpins\t{%2, %1, %0|%0, %1, %2}"
-  [(set_attr "type" "lwp")
-   (set_attr "mode" "HI")])
+   (set_attr "mode" "<MODE>")
+   (set (attr "length")
+        (symbol_ref "ix86_attr_length_address_default (insn) + 9"))])
 
-(define_insn "lwp_lwpinssi3"
-  [(unspec_volatile [(match_operand:SI 0 "register_operand" "r")
-                    (match_operand:SI 1 "nonimmediate_operand" "rm")
-                    (match_operand:SI 2 "const_int_operand" "")]
-                   UNSPECV_LWPINS_INTRINSIC)]
+(define_expand "lwp_lwpins<mode>3"
+  [(set (reg:CCC FLAGS_REG)
+       (unspec_volatile:CCC [(match_operand:SWI48 1 "register_operand" "r")
+                             (match_operand:SI 2 "nonimmediate_operand" "rm")
+                             (match_operand:SI 3 "const_int_operand" "i")]
+                            UNSPECV_LWPINS_INTRINSIC))
+   (set (match_operand:QI 0 "nonimmediate_operand" "=qm")
+       (eq:QI (reg:CCC FLAGS_REG) (const_int 0)))]
   "TARGET_LWP"
-  "lwpins\t{%2, %1, %0|%0, %1, %2}"
-  [(set_attr "type" "lwp")
-   (set_attr "mode" "SI")])
+  "")
 
-(define_insn "lwp_lwpinsdi3"
-  [(unspec_volatile [(match_operand:DI 0 "register_operand" "r")
-                    (match_operand:SI 1 "nonimmediate_operand" "rm")
-                    (match_operand:SI 2 "const_int_operand" "")]
-                   UNSPECV_LWPINS_INTRINSIC)]
+(define_insn "*lwp_lwpins<mode>3_1"
+  [(set (reg:CCC FLAGS_REG)
+       (unspec_volatile:CCC [(match_operand:SWI48 0 "register_operand" "r")
+                             (match_operand:SI 1 "nonimmediate_operand" "rm")
+                             (match_operand:SI 2 "const_int_operand" "i")]
+                            UNSPECV_LWPINS_INTRINSIC))]
   "TARGET_LWP"
   "lwpins\t{%2, %1, %0|%0, %1, %2}"
   [(set_attr "type" "lwp")
-   (set_attr "mode" "DI")])
+   (set_attr "mode" "<MODE>")
+   (set (attr "length")
+        (symbol_ref "ix86_attr_length_address_default (insn) + 9"))])
 
 (include "mmx.md")
 (include "sse.md")