]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGen/X86/sse3-intrinsics-x86.ll
Vendor import of llvm trunk r291274:
[FreeBSD/FreeBSD.git] / test / CodeGen / X86 / sse3-intrinsics-x86.ll
1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=-avx,+sse3 -show-mc-encoding | FileCheck %s --check-prefix=SSE
3 ; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+avx2 -show-mc-encoding | FileCheck %s --check-prefix=VCHECK --check-prefix=AVX2
4 ; RUN: llc < %s -mtriple=i386-apple-darwin -mcpu=skx -show-mc-encoding | FileCheck %s --check-prefix=VCHECK --check-prefix=SKX
5
6 define <2 x double> @test_x86_sse3_addsub_pd(<2 x double> %a0, <2 x double> %a1) {
7 ; SSE-LABEL: test_x86_sse3_addsub_pd:
8 ; SSE:       ## BB#0:
9 ; SSE-NEXT:    addsubpd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0xd0,0xc1]
10 ; SSE-NEXT:    retl ## encoding: [0xc3]
11 ;
12 ; VCHECK-LABEL: test_x86_sse3_addsub_pd:
13 ; VCHECK:       ## BB#0:
14 ; VCHECK-NEXT:    vaddsubpd %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xf9,0xd0,0xc1]
15 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
16   %res = call <2 x double> @llvm.x86.sse3.addsub.pd(<2 x double> %a0, <2 x double> %a1) ; <<2 x double>> [#uses=1]
17   ret <2 x double> %res
18 }
19 declare <2 x double> @llvm.x86.sse3.addsub.pd(<2 x double>, <2 x double>) nounwind readnone
20
21
22 define <4 x float> @test_x86_sse3_addsub_ps(<4 x float> %a0, <4 x float> %a1) {
23 ; SSE-LABEL: test_x86_sse3_addsub_ps:
24 ; SSE:       ## BB#0:
25 ; SSE-NEXT:    addsubps %xmm1, %xmm0 ## encoding: [0xf2,0x0f,0xd0,0xc1]
26 ; SSE-NEXT:    retl ## encoding: [0xc3]
27 ;
28 ; VCHECK-LABEL: test_x86_sse3_addsub_ps:
29 ; VCHECK:       ## BB#0:
30 ; VCHECK-NEXT:    vaddsubps %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xfb,0xd0,0xc1]
31 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
32   %res = call <4 x float> @llvm.x86.sse3.addsub.ps(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
33   ret <4 x float> %res
34 }
35 declare <4 x float> @llvm.x86.sse3.addsub.ps(<4 x float>, <4 x float>) nounwind readnone
36
37
38 define <2 x double> @test_x86_sse3_hadd_pd(<2 x double> %a0, <2 x double> %a1) {
39 ; SSE-LABEL: test_x86_sse3_hadd_pd:
40 ; SSE:       ## BB#0:
41 ; SSE-NEXT:    haddpd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x7c,0xc1]
42 ; SSE-NEXT:    retl ## encoding: [0xc3]
43 ;
44 ; VCHECK-LABEL: test_x86_sse3_hadd_pd:
45 ; VCHECK:       ## BB#0:
46 ; VCHECK-NEXT:    vhaddpd %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xf9,0x7c,0xc1]
47 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
48   %res = call <2 x double> @llvm.x86.sse3.hadd.pd(<2 x double> %a0, <2 x double> %a1) ; <<2 x double>> [#uses=1]
49   ret <2 x double> %res
50 }
51 declare <2 x double> @llvm.x86.sse3.hadd.pd(<2 x double>, <2 x double>) nounwind readnone
52
53
54 define <4 x float> @test_x86_sse3_hadd_ps(<4 x float> %a0, <4 x float> %a1) {
55 ; SSE-LABEL: test_x86_sse3_hadd_ps:
56 ; SSE:       ## BB#0:
57 ; SSE-NEXT:    haddps %xmm1, %xmm0 ## encoding: [0xf2,0x0f,0x7c,0xc1]
58 ; SSE-NEXT:    retl ## encoding: [0xc3]
59 ;
60 ; VCHECK-LABEL: test_x86_sse3_hadd_ps:
61 ; VCHECK:       ## BB#0:
62 ; VCHECK-NEXT:    vhaddps %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xfb,0x7c,0xc1]
63 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
64   %res = call <4 x float> @llvm.x86.sse3.hadd.ps(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
65   ret <4 x float> %res
66 }
67 declare <4 x float> @llvm.x86.sse3.hadd.ps(<4 x float>, <4 x float>) nounwind readnone
68
69
70 define <2 x double> @test_x86_sse3_hsub_pd(<2 x double> %a0, <2 x double> %a1) {
71 ; SSE-LABEL: test_x86_sse3_hsub_pd:
72 ; SSE:       ## BB#0:
73 ; SSE-NEXT:    hsubpd %xmm1, %xmm0 ## encoding: [0x66,0x0f,0x7d,0xc1]
74 ; SSE-NEXT:    retl ## encoding: [0xc3]
75 ;
76 ; VCHECK-LABEL: test_x86_sse3_hsub_pd:
77 ; VCHECK:       ## BB#0:
78 ; VCHECK-NEXT:    vhsubpd %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xf9,0x7d,0xc1]
79 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
80   %res = call <2 x double> @llvm.x86.sse3.hsub.pd(<2 x double> %a0, <2 x double> %a1) ; <<2 x double>> [#uses=1]
81   ret <2 x double> %res
82 }
83 declare <2 x double> @llvm.x86.sse3.hsub.pd(<2 x double>, <2 x double>) nounwind readnone
84
85
86 define <4 x float> @test_x86_sse3_hsub_ps(<4 x float> %a0, <4 x float> %a1) {
87 ; SSE-LABEL: test_x86_sse3_hsub_ps:
88 ; SSE:       ## BB#0:
89 ; SSE-NEXT:    hsubps %xmm1, %xmm0 ## encoding: [0xf2,0x0f,0x7d,0xc1]
90 ; SSE-NEXT:    retl ## encoding: [0xc3]
91 ;
92 ; VCHECK-LABEL: test_x86_sse3_hsub_ps:
93 ; VCHECK:       ## BB#0:
94 ; VCHECK-NEXT:    vhsubps %xmm1, %xmm0, %xmm0 ## encoding: [0xc5,0xfb,0x7d,0xc1]
95 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
96   %res = call <4 x float> @llvm.x86.sse3.hsub.ps(<4 x float> %a0, <4 x float> %a1) ; <<4 x float>> [#uses=1]
97   ret <4 x float> %res
98 }
99 declare <4 x float> @llvm.x86.sse3.hsub.ps(<4 x float>, <4 x float>) nounwind readnone
100
101
102 define <16 x i8> @test_x86_sse3_ldu_dq(i8* %a0) {
103 ; SSE-LABEL: test_x86_sse3_ldu_dq:
104 ; SSE:       ## BB#0:
105 ; SSE-NEXT:    movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
106 ; SSE-NEXT:    lddqu (%eax), %xmm0 ## encoding: [0xf2,0x0f,0xf0,0x00]
107 ; SSE-NEXT:    retl ## encoding: [0xc3]
108 ;
109 ; VCHECK-LABEL: test_x86_sse3_ldu_dq:
110 ; VCHECK:       ## BB#0:
111 ; VCHECK-NEXT:    movl {{[0-9]+}}(%esp), %eax ## encoding: [0x8b,0x44,0x24,0x04]
112 ; VCHECK-NEXT:    vlddqu (%eax), %xmm0 ## encoding: [0xc5,0xfb,0xf0,0x00]
113 ; VCHECK-NEXT:    retl ## encoding: [0xc3]
114   %res = call <16 x i8> @llvm.x86.sse3.ldu.dq(i8* %a0) ; <<16 x i8>> [#uses=1]
115   ret <16 x i8> %res
116 }
117 declare <16 x i8> @llvm.x86.sse3.ldu.dq(i8*) nounwind readonly