Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=-avx,+sse4.2 | FileCheck %s
      2 
      3 define i32 @test_x86_sse42_pcmpestri128(<16 x i8> %a0, <16 x i8> %a2) {
      4   ; CHECK: movl $7
      5   ; CHECK: movl $7
      6   ; CHECK: pcmpestri $7
      7   ; CHECK: movl
      8   %res = call i32 @llvm.x86.sse42.pcmpestri128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; <i32> [#uses=1]
      9   ret i32 %res
     10 }
     11 declare i32 @llvm.x86.sse42.pcmpestri128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
     12 
     13 
     14 define i32 @test_x86_sse42_pcmpestri128_load(<16 x i8>* %a0, <16 x i8>* %a2) {
     15   ; CHECK: movl $7
     16   ; CHECK: movl $7
     17   ; CHECK: pcmpestri $7, (
     18   ; CHECK: movl
     19   %1 = load <16 x i8>, <16 x i8>* %a0
     20   %2 = load <16 x i8>, <16 x i8>* %a2
     21   %res = call i32 @llvm.x86.sse42.pcmpestri128(<16 x i8> %1, i32 7, <16 x i8> %2, i32 7, i8 7) ; <i32> [#uses=1]
     22   ret i32 %res
     23 }
     24 
     25 
     26 define i32 @test_x86_sse42_pcmpestria128(<16 x i8> %a0, <16 x i8> %a2) {
     27   ; CHECK: movl
     28   ; CHECK: movl
     29   ; CHECK: pcmpestri
     30   ; CHECK: seta
     31   %res = call i32 @llvm.x86.sse42.pcmpestria128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; <i32> [#uses=1]
     32   ret i32 %res
     33 }
     34 declare i32 @llvm.x86.sse42.pcmpestria128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
     35 
     36 
     37 define i32 @test_x86_sse42_pcmpestric128(<16 x i8> %a0, <16 x i8> %a2) {
     38   ; CHECK: movl
     39   ; CHECK: movl
     40   ; CHECK: pcmpestri
     41   ; CHECK: sbbl
     42   %res = call i32 @llvm.x86.sse42.pcmpestric128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; <i32> [#uses=1]
     43   ret i32 %res
     44 }
     45 declare i32 @llvm.x86.sse42.pcmpestric128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
     46 
     47 
     48 define i32 @test_x86_sse42_pcmpestrio128(<16 x i8> %a0, <16 x i8> %a2) {
     49   ; CHECK: movl
     50   ; CHECK: movl
     51   ; CHECK: pcmpestri
     52   ; CHECK: seto
     53   %res = call i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; <i32> [#uses=1]
     54   ret i32 %res
     55 }
     56 declare i32 @llvm.x86.sse42.pcmpestrio128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
     57 
     58 
     59 define i32 @test_x86_sse42_pcmpestris128(<16 x i8> %a0, <16 x i8> %a2) {
     60   ; CHECK: movl
     61   ; CHECK: movl
     62   ; CHECK: pcmpestri
     63   ; CHECK: sets
     64   %res = call i32 @llvm.x86.sse42.pcmpestris128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; <i32> [#uses=1]
     65   ret i32 %res
     66 }
     67 declare i32 @llvm.x86.sse42.pcmpestris128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
     68 
     69 
     70 define i32 @test_x86_sse42_pcmpestriz128(<16 x i8> %a0, <16 x i8> %a2) {
     71   ; CHECK: movl
     72   ; CHECK: movl
     73   ; CHECK: pcmpestri
     74   ; CHECK: sete
     75   %res = call i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; <i32> [#uses=1]
     76   ret i32 %res
     77 }
     78 declare i32 @llvm.x86.sse42.pcmpestriz128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
     79 
     80 
     81 define <16 x i8> @test_x86_sse42_pcmpestrm128(<16 x i8> %a0, <16 x i8> %a2) {
     82   ; CHECK: movl
     83   ; CHECK: movl
     84   ; CHECK: pcmpestrm
     85   ; CHECK-NOT: vmov
     86   %res = call <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8> %a0, i32 7, <16 x i8> %a2, i32 7, i8 7) ; <<16 x i8>> [#uses=1]
     87   ret <16 x i8> %res
     88 }
     89 declare <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8>, i32, <16 x i8>, i32, i8) nounwind readnone
     90 
     91 
     92 define <16 x i8> @test_x86_sse42_pcmpestrm128_load(<16 x i8> %a0, <16 x i8>* %a2) {
     93   ; CHECK: movl $7
     94   ; CHECK: movl $7
     95   ; CHECK: pcmpestrm $7,
     96   ; CHECK-NOT: vmov
     97   %1 = load <16 x i8>, <16 x i8>* %a2
     98   %res = call <16 x i8> @llvm.x86.sse42.pcmpestrm128(<16 x i8> %a0, i32 7, <16 x i8> %1, i32 7, i8 7) ; <<16 x i8>> [#uses=1]
     99   ret <16 x i8> %res
    100 }
    101 
    102 
    103 define i32 @test_x86_sse42_pcmpistri128(<16 x i8> %a0, <16 x i8> %a1) {
    104   ; CHECK: pcmpistri $7
    105   ; CHECK: movl
    106   %res = call i32 @llvm.x86.sse42.pcmpistri128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; <i32> [#uses=1]
    107   ret i32 %res
    108 }
    109 declare i32 @llvm.x86.sse42.pcmpistri128(<16 x i8>, <16 x i8>, i8) nounwind readnone
    110 
    111 
    112 define i32 @test_x86_sse42_pcmpistri128_load(<16 x i8>* %a0, <16 x i8>* %a1) {
    113   ; CHECK: pcmpistri $7, (
    114   ; CHECK: movl
    115   %1 = load <16 x i8>, <16 x i8>* %a0
    116   %2 = load <16 x i8>, <16 x i8>* %a1
    117   %res = call i32 @llvm.x86.sse42.pcmpistri128(<16 x i8> %1, <16 x i8> %2, i8 7) ; <i32> [#uses=1]
    118   ret i32 %res
    119 }
    120 
    121 
    122 define i32 @test_x86_sse42_pcmpistria128(<16 x i8> %a0, <16 x i8> %a1) {
    123   ; CHECK: pcmpistri
    124   ; CHECK: seta
    125   %res = call i32 @llvm.x86.sse42.pcmpistria128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; <i32> [#uses=1]
    126   ret i32 %res
    127 }
    128 declare i32 @llvm.x86.sse42.pcmpistria128(<16 x i8>, <16 x i8>, i8) nounwind readnone
    129 
    130 
    131 define i32 @test_x86_sse42_pcmpistric128(<16 x i8> %a0, <16 x i8> %a1) {
    132   ; CHECK: pcmpistri
    133   ; CHECK: sbbl
    134   %res = call i32 @llvm.x86.sse42.pcmpistric128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; <i32> [#uses=1]
    135   ret i32 %res
    136 }
    137 declare i32 @llvm.x86.sse42.pcmpistric128(<16 x i8>, <16 x i8>, i8) nounwind readnone
    138 
    139 
    140 define i32 @test_x86_sse42_pcmpistrio128(<16 x i8> %a0, <16 x i8> %a1) {
    141   ; CHECK: pcmpistri
    142   ; CHECK: seto
    143   %res = call i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; <i32> [#uses=1]
    144   ret i32 %res
    145 }
    146 declare i32 @llvm.x86.sse42.pcmpistrio128(<16 x i8>, <16 x i8>, i8) nounwind readnone
    147 
    148 
    149 define i32 @test_x86_sse42_pcmpistris128(<16 x i8> %a0, <16 x i8> %a1) {
    150   ; CHECK: pcmpistri
    151   ; CHECK: sets
    152   %res = call i32 @llvm.x86.sse42.pcmpistris128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; <i32> [#uses=1]
    153   ret i32 %res
    154 }
    155 declare i32 @llvm.x86.sse42.pcmpistris128(<16 x i8>, <16 x i8>, i8) nounwind readnone
    156 
    157 
    158 define i32 @test_x86_sse42_pcmpistriz128(<16 x i8> %a0, <16 x i8> %a1) {
    159   ; CHECK: pcmpistri
    160   ; CHECK: sete
    161   %res = call i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; <i32> [#uses=1]
    162   ret i32 %res
    163 }
    164 declare i32 @llvm.x86.sse42.pcmpistriz128(<16 x i8>, <16 x i8>, i8) nounwind readnone
    165 
    166 
    167 define <16 x i8> @test_x86_sse42_pcmpistrm128(<16 x i8> %a0, <16 x i8> %a1) {
    168   ; CHECK: pcmpistrm $7
    169   ; CHECK-NOT: vmov
    170   %res = call <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8> %a0, <16 x i8> %a1, i8 7) ; <<16 x i8>> [#uses=1]
    171   ret <16 x i8> %res
    172 }
    173 declare <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8>, <16 x i8>, i8) nounwind readnone
    174 
    175 
    176 define <16 x i8> @test_x86_sse42_pcmpistrm128_load(<16 x i8> %a0, <16 x i8>* %a1) {
    177   ; CHECK: pcmpistrm $7, (
    178   ; CHECK-NOT: vmov
    179   %1 = load <16 x i8>, <16 x i8>* %a1
    180   %res = call <16 x i8> @llvm.x86.sse42.pcmpistrm128(<16 x i8> %a0, <16 x i8> %1, i8 7) ; <<16 x i8>> [#uses=1]
    181   ret <16 x i8> %res
    182 }
    183