Commit 06f4e35d by H.J. Lu Committed by Uros Bizjak

i386.h (enum reg_class): New.

        * config/i386/i386.h (enum reg_class) [SSE_FIRST_REG]: New.
        (SSE_CLASS_P): Use reg_class_subset_p between SSE_REGS.
        (REG_CLASS_NAMES): Add "FIRST_SSE_REG" string.
        (REG_CLASS_CONTENTS): Add members of FIRST_SSE_REG class.
        * config/i386/constraints.md ("z"): New register constraint
        for members of SSE_FIRST_REG class.
        * config/i386/i386-modes.def (CCA, CCC, CCO, CCS): New compare modes.
        * config/i386/i386.c (regclass_map): Change class of %xmm0 to
        SSE_FIRST_REG class.
        (put_condition_code) [EQ, NE]: Output suffixes for new compare modes.
        (ix86_cc_modes_compatible): Handle CCA, CCC, CCO and CCS modes.
        (IX86_BUILTIN_PCMPESTRI128): New for SSE4.2.
        (IX86_BUILTIN_PCMPESTRM128): Likewise.
        (IX86_BUILTIN_PCMPESTRA128): Likewise.
        (IX86_BUILTIN_PCMPESTRC128): Likewise.
        (IX86_BUILTIN_PCMPESTRO128): Likewise.
        (IX86_BUILTIN_PCMPESTRS128): Likewise.
        (IX86_BUILTIN_PCMPESTRZ128): Likewise.
        (IX86_BUILTIN_PCMPISTRI128): Likewise.
        (IX86_BUILTIN_PCMPISTRM128): Likewise.
        (IX86_BUILTIN_PCMPISTRA128): Likewise.
        (IX86_BUILTIN_PCMPISTRC128): Likewise.
        (IX86_BUILTIN_PCMPISTRO128): Likewise.
        (IX86_BUILTIN_PCMPISTRS128): Likewise.
        (IX86_BUILTIN_PCMPISTRZ128): Likewise.
        (struct builtin_description): Change "flag" field to unsigned.
        (bdesc_pcmpestr): New builtin description table.
        (bdesc_pcmpistr): Likewise.
        (ix86_init_mmx_sse_builtins): Define int_ftype_v16qi_int_v16qi_int_int,
        v16qi_ftype_v16qi_int_v16qi_int_int and int_ftype_v16qi_v16qi_int.
        Initialize pcmp[ei]str[im] insns for SSE4.2.
        (ix86_expand_sse_pcmpestr): New subroutine of ix86_expand_builtin.
        (ix86_expand_sse_pcmpistr): Likewise.
        (ix86_expand_builtin): Expand pcmp[ei]str[im] builtins for SSE4.2.
        * config/i386/i386.md (UNSPEC_PCMPESTR): New for SSE4.2.
        (UNSPEC_PCMPISTR): Likewise.
        * config/i386/sse.md (sse4_2_pcmpestr): New insn patern and splitter.
        (sse4_2_pcmpestri):New isns pattern.
        (sse4_2_pcmpestrm): Likewise.
        (sse4_2_pcmpestr_cconly): Likewise.
        (sse4_2_pcmpistr): New insn patern and splitter.
        (sse4_2_pcmpistri):New isns pattern.
        (sse4_2_pcmpistrm): Likewise.
        (sse4_2_pcmpistr_cconly): Likewise.
        * config/i386/smmintrin.h: Enable pcmp[ei]str[im] intrinsics
        in SSE4.2.


Co-Authored-By: Uros Bizjak <ubizjak@gmail.com>

From-SVN: r125279
parent 82a6cadf
2007-06-02 H.J. Lu <hongjiu.lu@intel.com>
Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.h (enum reg_class) [SSE_FIRST_REG]: New.
(SSE_CLASS_P): Use reg_class_subset_p between SSE_REGS.
(REG_CLASS_NAMES): Add "FIRST_SSE_REG" string.
(REG_CLASS_CONTENTS): Add members of FIRST_SSE_REG class.
* config/i386/constraints.md ("z"): New register constraint
for members of SSE_FIRST_REG class.
* config/i386/i386-modes.def (CCA, CCC, CCO, CCS): New compare modes.
* config/i386/i386.c (regclass_map): Change class of %xmm0 to
SSE_FIRST_REG class.
(put_condition_code) [EQ, NE]: Output suffixes for new compare modes.
(ix86_cc_modes_compatible): Handle CCA, CCC, CCO and CCS modes.
(IX86_BUILTIN_PCMPESTRI128): New for SSE4.2.
(IX86_BUILTIN_PCMPESTRM128): Likewise.
(IX86_BUILTIN_PCMPESTRA128): Likewise.
(IX86_BUILTIN_PCMPESTRC128): Likewise.
(IX86_BUILTIN_PCMPESTRO128): Likewise.
(IX86_BUILTIN_PCMPESTRS128): Likewise.
(IX86_BUILTIN_PCMPESTRZ128): Likewise.
(IX86_BUILTIN_PCMPISTRI128): Likewise.
(IX86_BUILTIN_PCMPISTRM128): Likewise.
(IX86_BUILTIN_PCMPISTRA128): Likewise.
(IX86_BUILTIN_PCMPISTRC128): Likewise.
(IX86_BUILTIN_PCMPISTRO128): Likewise.
(IX86_BUILTIN_PCMPISTRS128): Likewise.
(IX86_BUILTIN_PCMPISTRZ128): Likewise.
(struct builtin_description): Change "flag" field to unsigned.
(bdesc_pcmpestr): New builtin description table.
(bdesc_pcmpistr): Likewise.
(ix86_init_mmx_sse_builtins): Define int_ftype_v16qi_int_v16qi_int_int,
v16qi_ftype_v16qi_int_v16qi_int_int and int_ftype_v16qi_v16qi_int.
Initialize pcmp[ei]str[im] insns for SSE4.2.
(ix86_expand_sse_pcmpestr): New subroutine of ix86_expand_builtin.
(ix86_expand_sse_pcmpistr): Likewise.
(ix86_expand_builtin): Expand pcmp[ei]str[im] builtins for SSE4.2.
* config/i386/i386.md (UNSPEC_PCMPESTR): New for SSE4.2.
(UNSPEC_PCMPISTR): Likewise.
* config/i386/sse.md (sse4_2_pcmpestr): New insn patern and splitter.
(sse4_2_pcmpestri):New isns pattern.
(sse4_2_pcmpestrm): Likewise.
(sse4_2_pcmpestr_cconly): Likewise.
(sse4_2_pcmpistr): New insn patern and splitter.
(sse4_2_pcmpistri):New isns pattern.
(sse4_2_pcmpistrm): Likewise.
(sse4_2_pcmpistr_cconly): Likewise.
* config/i386/smmintrin.h: Enable pcmp[ei]str[im] intrinsics
in SSE4.2.
2007-06-01 David Daney <ddaney@avtrex.com> 2007-06-01 David Daney <ddaney@avtrex.com>
* config/mips/mips.c (mips_output_mi_thunk): Only load gp if not * config/mips/mips.c (mips_output_mi_thunk): Only load gp if not
...@@ -48,10 +98,8 @@ ...@@ -48,10 +98,8 @@
2007-05-31 H.J. Lu <hongjiu.lu@intel.com> 2007-05-31 H.J. Lu <hongjiu.lu@intel.com>
* config.gcc (i[34567]86-*-*): Add nmmintrin.h to * config.gcc (i[34567]86-*-*): Add nmmintrin.h to extra_headers.
extra_headers.
(x86_64-*-*): Likewise. (x86_64-*-*): Likewise.
* config/i386/i386.c (OPTION_MASK_ISA_MMX_UNSET): New. * config/i386/i386.c (OPTION_MASK_ISA_MMX_UNSET): New.
(OPTION_MASK_ISA_3DNOW_UNSET): Likewise. (OPTION_MASK_ISA_3DNOW_UNSET): Likewise.
(OPTION_MASK_ISA_SSE_UNSET): Likewise. (OPTION_MASK_ISA_SSE_UNSET): Likewise.
...@@ -63,8 +111,7 @@ ...@@ -63,8 +111,7 @@
(OPTION_MASK_ISA_SSE4): Likewise. (OPTION_MASK_ISA_SSE4): Likewise.
(OPTION_MASK_ISA_SSE4_UNSET): Likewise. (OPTION_MASK_ISA_SSE4_UNSET): Likewise.
(OPTION_MASK_ISA_SSE4A_UNSET): Likewise. (OPTION_MASK_ISA_SSE4A_UNSET): Likewise.
(ix86_handle_option): Use OPTION_MASK_ISA_*_UNSET. Handle (ix86_handle_option): Use OPTION_MASK_ISA_*_UNSET. Handle SSE4.2.
SSE4.2.
(override_options): Support SSE4.2. (override_options): Support SSE4.2.
(ix86_build_const_vector): Support SImode and DImode. (ix86_build_const_vector): Support SImode and DImode.
(ix86_build_signbit_mask): Likewise. (ix86_build_signbit_mask): Likewise.
...@@ -79,32 +126,22 @@ ...@@ -79,32 +126,22 @@
(ix86_expand_crc32): Likewise. (ix86_expand_crc32): Likewise.
(ix86_init_mmx_sse_builtins): Support SSE4.2. (ix86_init_mmx_sse_builtins): Support SSE4.2.
(ix86_expand_builtin): Likewise. (ix86_expand_builtin): Likewise.
* config/i386/i386.h (TARGET_CPU_CPP_BUILTINS): Define * config/i386/i386.h (TARGET_CPU_CPP_BUILTINS): Define
__SSE4_2__ for -msse4.2. __SSE4_2__ for -msse4.2.
* config/i386/i386.md (UNSPEC_CRC32): New for SSE4.2. * config/i386/i386.md (UNSPEC_CRC32): New for SSE4.2.
(CRC32MODE): Likewise. (CRC32MODE): Likewise.
(crc32modesuffix): Likewise. (crc32modesuffix): Likewise.
(crc32modeconstraint): Likewise. (crc32modeconstraint): Likewise.
(sse4_2_crc32<mode>): Likewise. (sse4_2_crc32<mode>): Likewise.
(sse4_2_crc32di): Likewise. (sse4_2_crc32di): Likewise.
* config/i386/i386.opt (msse4.2): New for SSE4.2. * config/i386/i386.opt (msse4.2): New for SSE4.2.
(msse4): Likewise. (msse4): Likewise.
* config/i386/nmmintrin.h: New. The dummy SSE4.2 intrinsic header file.
* config/i386/nmmintrin.h: New. The dummy SSE4.2 intrinsic header
file.
* config/i386/smmintrin.h: Add SSE4.2 intrinsics. * config/i386/smmintrin.h: Add SSE4.2 intrinsics.
* config/i386/sse.md (sse4_2_gtv2di3): New pattern for SSE4.2.
* config/i386/sse.md (sse4_2_gtv2di3): New pattern for
SSE4.2.
(vcond<mode>): Use SSEMODEI instead of SSEMODE124. (vcond<mode>): Use SSEMODEI instead of SSEMODE124.
(vcondu<mode>): Likewise. (vcondu<mode>): Likewise.
* doc/extend.texi: Document SSE4.2 built-in functions. * doc/extend.texi: Document SSE4.2 built-in functions.
* doc/invoke.texi: Document -msse4.2/-msse4. * doc/invoke.texi: Document -msse4.2/-msse4.
2007-05-31 Zdenek Dvorak <dvorakz@suse.cz> 2007-05-31 Zdenek Dvorak <dvorakz@suse.cz>
......
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
;; Boston, MA 02110-1301, USA. ;; Boston, MA 02110-1301, USA.
;;; Unused letters: ;;; Unused letters:
;;; B H TU W ;;; B H TU W
;;; h jk vw z ;;; h jk vw
;; Integer register constraints. ;; Integer register constraints.
;; It is not necessary to define 'r' here. ;; It is not necessary to define 'r' here.
...@@ -83,6 +83,9 @@ ...@@ -83,6 +83,9 @@
(define_register_constraint "x" "TARGET_SSE ? SSE_REGS : NO_REGS" (define_register_constraint "x" "TARGET_SSE ? SSE_REGS : NO_REGS"
"Any SSE register.") "Any SSE register.")
(define_register_constraint "z" "TARGET_SSE ? SSE_FIRST_REG : NO_REGS"
"First SSE register (@code{%xmm0}).")
;; We use the Y prefix to denote any number of conditional register sets: ;; We use the Y prefix to denote any number of conditional register sets:
;; 2 SSE2 enabled ;; 2 SSE2 enabled
;; i SSE2 inter-unit moves enabled ;; i SSE2 inter-unit moves enabled
......
...@@ -53,11 +53,19 @@ ADJUST_ALIGNMENT (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 4); ...@@ -53,11 +53,19 @@ ADJUST_ALIGNMENT (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 4);
mode is used to simulate comparisons of (a-b) and (a+b) mode is used to simulate comparisons of (a-b) and (a+b)
against zero using sub/cmp/add operations. against zero using sub/cmp/add operations.
Add CCA to indicate that only the Above flag is valid.
Add CCC to indicate that only the Carry flag is valid.
Add CCO to indicate that only the Overflow flag is valid.
Add CCS to indicate that only the Sign flag is valid.
Add CCZ to indicate that only the Zero flag is valid. */ Add CCZ to indicate that only the Zero flag is valid. */
CC_MODE (CCGC); CC_MODE (CCGC);
CC_MODE (CCGOC); CC_MODE (CCGOC);
CC_MODE (CCNO); CC_MODE (CCNO);
CC_MODE (CCA);
CC_MODE (CCC);
CC_MODE (CCO);
CC_MODE (CCS);
CC_MODE (CCZ); CC_MODE (CCZ);
CC_MODE (CCFP); CC_MODE (CCFP);
CC_MODE (CCFPU); CC_MODE (CCFPU);
......
...@@ -1268,6 +1268,7 @@ enum reg_class ...@@ -1268,6 +1268,7 @@ enum reg_class
GENERAL_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp %esp %r8 - %r15*/ GENERAL_REGS, /* %eax %ebx %ecx %edx %esi %edi %ebp %esp %r8 - %r15*/
FP_TOP_REG, FP_SECOND_REG, /* %st(0) %st(1) */ FP_TOP_REG, FP_SECOND_REG, /* %st(0) %st(1) */
FLOAT_REGS, FLOAT_REGS,
SSE_FIRST_REG,
SSE_REGS, SSE_REGS,
MMX_REGS, MMX_REGS,
FP_TOP_SSE_REGS, FP_TOP_SSE_REGS,
...@@ -1286,7 +1287,7 @@ enum reg_class ...@@ -1286,7 +1287,7 @@ enum reg_class
#define FLOAT_CLASS_P(CLASS) \ #define FLOAT_CLASS_P(CLASS) \
reg_class_subset_p ((CLASS), FLOAT_REGS) reg_class_subset_p ((CLASS), FLOAT_REGS)
#define SSE_CLASS_P(CLASS) \ #define SSE_CLASS_P(CLASS) \
((CLASS) == SSE_REGS) reg_class_subset_p ((CLASS), SSE_REGS)
#define MMX_CLASS_P(CLASS) \ #define MMX_CLASS_P(CLASS) \
((CLASS) == MMX_REGS) ((CLASS) == MMX_REGS)
#define MAYBE_INTEGER_CLASS_P(CLASS) \ #define MAYBE_INTEGER_CLASS_P(CLASS) \
...@@ -1314,6 +1315,7 @@ enum reg_class ...@@ -1314,6 +1315,7 @@ enum reg_class
"GENERAL_REGS", \ "GENERAL_REGS", \
"FP_TOP_REG", "FP_SECOND_REG", \ "FP_TOP_REG", "FP_SECOND_REG", \
"FLOAT_REGS", \ "FLOAT_REGS", \
"FIRST_SSE_REG", \
"SSE_REGS", \ "SSE_REGS", \
"MMX_REGS", \ "MMX_REGS", \
"FP_TOP_SSE_REGS", \ "FP_TOP_SSE_REGS", \
...@@ -1341,6 +1343,7 @@ enum reg_class ...@@ -1341,6 +1343,7 @@ enum reg_class
{ 0x1100ff, 0x1fe0 }, /* GENERAL_REGS */ \ { 0x1100ff, 0x1fe0 }, /* GENERAL_REGS */ \
{ 0x100, 0x0 }, { 0x0200, 0x0 },/* FP_TOP_REG, FP_SECOND_REG */\ { 0x100, 0x0 }, { 0x0200, 0x0 },/* FP_TOP_REG, FP_SECOND_REG */\
{ 0xff00, 0x0 }, /* FLOAT_REGS */ \ { 0xff00, 0x0 }, /* FLOAT_REGS */ \
{ 0x200000, 0x0 }, /* FIRST_SSE_REG */ \
{ 0x1fe00000,0x1fe000 }, /* SSE_REGS */ \ { 0x1fe00000,0x1fe000 }, /* SSE_REGS */ \
{ 0xe0000000, 0x1f }, /* MMX_REGS */ \ { 0xe0000000, 0x1f }, /* MMX_REGS */ \
{ 0x1fe00100,0x1fe000 }, /* FP_TOP_SSE_REG */ \ { 0x1fe00100,0x1fe000 }, /* FP_TOP_SSE_REG */ \
......
...@@ -176,6 +176,8 @@ ...@@ -176,6 +176,8 @@
; For SSE4.2 support ; For SSE4.2 support
(UNSPEC_CRC32 143) (UNSPEC_CRC32 143)
(UNSPEC_PCMPESTR 144)
(UNSPEC_PCMPISTR 145)
]) ])
(define_constants (define_constants
......
...@@ -603,7 +603,7 @@ _mm_stream_load_si128 (__m128i *__X) ...@@ -603,7 +603,7 @@ _mm_stream_load_si128 (__m128i *__X)
/* Intrinsics for text/string processing. */ /* Intrinsics for text/string processing. */
#if 0 #ifdef __OPTIMIZE__
static __inline __m128i __attribute__((__always_inline__)) static __inline __m128i __attribute__((__always_inline__))
_mm_cmpistrm (__m128i __X, __m128i __Y, const int __M) _mm_cmpistrm (__m128i __X, __m128i __Y, const int __M)
{ {
...@@ -652,7 +652,7 @@ _mm_cmpestri (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M) ...@@ -652,7 +652,7 @@ _mm_cmpestri (__m128i __X, int __LX, __m128i __Y, int __LY, const int __M)
/* Intrinsics for text/string processing and reading values of /* Intrinsics for text/string processing and reading values of
EFlags. */ EFlags. */
#if 0 #ifdef __OPTIMIZE__
static __inline int __attribute__((__always_inline__)) static __inline int __attribute__((__always_inline__))
_mm_cmpistra (__m128i __X, __m128i __Y, const int __M) _mm_cmpistra (__m128i __X, __m128i __Y, const int __M)
{ {
......
...@@ -6383,3 +6383,246 @@ ...@@ -6383,3 +6383,246 @@
[(set_attr "type" "ssecvt") [(set_attr "type" "ssecvt")
(set_attr "prefix_extra" "1") (set_attr "prefix_extra" "1")
(set_attr "mode" "V4SF")]) (set_attr "mode" "V4SF")])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; Intel SSE4.2 string/text processing instructions
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define_insn_and_split "sse4_2_pcmpestr"
[(set (match_operand:SI 0 "register_operand" "=c,c")
(unspec:SI
[(match_operand:V16QI 2 "register_operand" "x,x")
(match_operand:SI 3 "register_operand" "a,a")
(match_operand:V16QI 4 "nonimmediate_operand" "x,m")
(match_operand:SI 5 "register_operand" "d,d")
(match_operand:SI 6 "const_0_to_255_operand" "n,n")]
UNSPEC_PCMPESTR))
(set (match_operand:V16QI 1 "register_operand" "=z,z")
(unspec:V16QI
[(match_dup 2)
(match_dup 3)
(match_dup 4)
(match_dup 5)
(match_dup 6)]
UNSPEC_PCMPESTR))
(set (reg:CC FLAGS_REG)
(unspec:CC
[(match_dup 2)
(match_dup 3)
(match_dup 4)
(match_dup 5)
(match_dup 6)]
UNSPEC_PCMPESTR))]
"TARGET_SSE4_2
&& !(reload_completed || reload_in_progress)"
"#"
"&& 1"
[(const_int 0)]
{
int ecx = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[0]));
int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[1]));
int flags = !find_regno_note (curr_insn, REG_UNUSED, FLAGS_REG);
if (ecx)
emit_insn (gen_sse4_2_pcmpestri (operands[0], operands[2],
operands[3], operands[4],
operands[5], operands[6]));
if (xmm0)
emit_insn (gen_sse4_2_pcmpestrm (operands[1], operands[2],
operands[3], operands[4],
operands[5], operands[6]));
if (flags && !(ecx || xmm0))
emit_insn (gen_sse4_2_pcmpestr_cconly (operands[2], operands[3],
operands[4], operands[5],
operands[6]));
DONE;
}
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
(define_insn "sse4_2_pcmpestri"
[(set (match_operand:SI 0 "register_operand" "=c,c")
(unspec:SI
[(match_operand:V16QI 1 "register_operand" "x,x")
(match_operand:SI 2 "register_operand" "a,a")
(match_operand:V16QI 3 "nonimmediate_operand" "x,m")
(match_operand:SI 4 "register_operand" "d,d")
(match_operand:SI 5 "const_0_to_255_operand" "n,n")]
UNSPEC_PCMPESTR))
(set (reg:CC FLAGS_REG)
(unspec:CC
[(match_dup 1)
(match_dup 2)
(match_dup 3)
(match_dup 4)
(match_dup 5)]
UNSPEC_PCMPESTR))]
"TARGET_SSE4_2"
"pcmpestri\t{%5, %3, %1|%1, %3, %5}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
(define_insn "sse4_2_pcmpestrm"
[(set (match_operand:V16QI 0 "register_operand" "=z,z")
(unspec:V16QI
[(match_operand:V16QI 1 "register_operand" "x,x")
(match_operand:SI 2 "register_operand" "a,a")
(match_operand:V16QI 3 "nonimmediate_operand" "x,m")
(match_operand:SI 4 "register_operand" "d,d")
(match_operand:SI 5 "const_0_to_255_operand" "n,n")]
UNSPEC_PCMPESTR))
(set (reg:CC FLAGS_REG)
(unspec:CC
[(match_dup 1)
(match_dup 2)
(match_dup 3)
(match_dup 4)
(match_dup 5)]
UNSPEC_PCMPESTR))]
"TARGET_SSE4_2"
"pcmpestrm\t{%5, %3, %1|%1, %3, %5}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
(define_insn "sse4_2_pcmpestr_cconly"
[(set (reg:CC FLAGS_REG)
(unspec:CC
[(match_operand:V16QI 0 "register_operand" "x,x,x,x")
(match_operand:SI 1 "register_operand" "a,a,a,a")
(match_operand:V16QI 2 "nonimmediate_operand" "x,m,x,m")
(match_operand:SI 3 "register_operand" "d,d,d,d")
(match_operand:SI 4 "const_0_to_255_operand" "n,n,n,n")]
UNSPEC_PCMPESTR))
(clobber (match_scratch:SI 5 "=c,c,X,X"))
(clobber (match_scratch:V16QI 6 "=X,X,z,z"))]
"TARGET_SSE4_2"
"@
pcmpestri\t{%4, %2, %0|%0, %2, %4}
pcmpestri\t{%4, %2, %0|%0, %2, %4}
pcmpestrm\t{%4, %2, %0|%0, %2, %4}
pcmpestrm\t{%4, %2, %0|%0, %2, %4}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load,none,load")
(set_attr "mode" "TI")])
(define_insn_and_split "sse4_2_pcmpistr"
[(set (match_operand:SI 0 "register_operand" "=c,c")
(unspec:SI
[(match_operand:V16QI 2 "register_operand" "x,x")
(match_operand:V16QI 3 "nonimmediate_operand" "x,m")
(match_operand:SI 4 "const_0_to_255_operand" "n,n")]
UNSPEC_PCMPISTR))
(set (match_operand:V16QI 1 "register_operand" "=z,z")
(unspec:V16QI
[(match_dup 2)
(match_dup 3)
(match_dup 4)]
UNSPEC_PCMPISTR))
(set (reg:CC FLAGS_REG)
(unspec:CC
[(match_dup 2)
(match_dup 3)
(match_dup 4)]
UNSPEC_PCMPISTR))]
"TARGET_SSE4_2
&& !(reload_completed || reload_in_progress)"
"#"
"&& 1"
[(const_int 0)]
{
int ecx = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[0]));
int xmm0 = !find_regno_note (curr_insn, REG_UNUSED, REGNO (operands[1]));
int flags = !find_regno_note (curr_insn, REG_UNUSED, FLAGS_REG);
if (ecx)
emit_insn (gen_sse4_2_pcmpistri (operands[0], operands[2],
operands[3], operands[4]));
if (xmm0)
emit_insn (gen_sse4_2_pcmpistrm (operands[1], operands[2],
operands[3], operands[4]));
if (flags && !(ecx || xmm0))
emit_insn (gen_sse4_2_pcmpistr_cconly (operands[2], operands[3],
operands[4]));
DONE;
}
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
(define_insn "sse4_2_pcmpistri"
[(set (match_operand:SI 0 "register_operand" "=c,c")
(unspec:SI
[(match_operand:V16QI 1 "register_operand" "x,x")
(match_operand:V16QI 2 "nonimmediate_operand" "x,m")
(match_operand:SI 3 "const_0_to_255_operand" "n,n")]
UNSPEC_PCMPISTR))
(set (reg:CC FLAGS_REG)
(unspec:CC
[(match_dup 1)
(match_dup 2)
(match_dup 3)]
UNSPEC_PCMPISTR))]
"TARGET_SSE4_2"
"pcmpistri\t{%3, %2, %1|%1, %2, %3}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
(define_insn "sse4_2_pcmpistrm"
[(set (match_operand:V16QI 0 "register_operand" "=z,z")
(unspec:V16QI
[(match_operand:V16QI 1 "register_operand" "x,x")
(match_operand:V16QI 2 "nonimmediate_operand" "x,m")
(match_operand:SI 3 "const_0_to_255_operand" "n,n")]
UNSPEC_PCMPISTR))
(set (reg:CC FLAGS_REG)
(unspec:CC
[(match_dup 1)
(match_dup 2)
(match_dup 3)]
UNSPEC_PCMPISTR))]
"TARGET_SSE4_2"
"pcmpistrm\t{%3, %2, %1|%1, %2, %3}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
(define_insn "sse4_2_pcmpistr_cconly"
[(set (reg:CC FLAGS_REG)
(unspec:CC
[(match_operand:V16QI 0 "register_operand" "x,x,x,x")
(match_operand:V16QI 1 "nonimmediate_operand" "x,m,x,m")
(match_operand:SI 2 "const_0_to_255_operand" "n,n,n,n")]
UNSPEC_PCMPISTR))
(clobber (match_scratch:SI 3 "=c,c,X,X"))
(clobber (match_scratch:V16QI 4 "=X,X,z,z"))]
"TARGET_SSE4_2"
"@
pcmpistri\t{%2, %1, %0|%0, %1, %2}
pcmpistri\t{%2, %1, %0|%0, %1, %2}
pcmpistrm\t{%2, %1, %0|%0, %1, %2}
pcmpistrm\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load,none,load")
(set_attr "mode" "TI")])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment