xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/3dnow-builtins.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -O3 -triple=x86_64-unknown-unknown -target-feature +3dnow -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // Don't include mm_malloc.h, it's system specific.
4*f4a2713aSLionel Sambuc #define __MM_MALLOC_H
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc #include <x86intrin.h>
7*f4a2713aSLionel Sambuc 
test_m_pavgusb(__m64 m1,__m64 m2)8*f4a2713aSLionel Sambuc __m64 test_m_pavgusb(__m64 m1, __m64 m2) {
9*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pavgusb
10*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pavgusb
11*f4a2713aSLionel Sambuc   return _m_pavgusb(m1, m2);
12*f4a2713aSLionel Sambuc }
13*f4a2713aSLionel Sambuc 
test_m_pf2id(__m64 m)14*f4a2713aSLionel Sambuc __m64 test_m_pf2id(__m64 m) {
15*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pf2id
16*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pf2id
17*f4a2713aSLionel Sambuc   return _m_pf2id(m);
18*f4a2713aSLionel Sambuc }
19*f4a2713aSLionel Sambuc 
test_m_pfacc(__m64 m1,__m64 m2)20*f4a2713aSLionel Sambuc __m64 test_m_pfacc(__m64 m1, __m64 m2) {
21*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfacc
22*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfacc
23*f4a2713aSLionel Sambuc   return _m_pfacc(m1, m2);
24*f4a2713aSLionel Sambuc }
25*f4a2713aSLionel Sambuc 
test_m_pfadd(__m64 m1,__m64 m2)26*f4a2713aSLionel Sambuc __m64 test_m_pfadd(__m64 m1, __m64 m2) {
27*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfadd
28*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfadd
29*f4a2713aSLionel Sambuc   return _m_pfadd(m1, m2);
30*f4a2713aSLionel Sambuc }
31*f4a2713aSLionel Sambuc 
test_m_pfcmpeq(__m64 m1,__m64 m2)32*f4a2713aSLionel Sambuc __m64 test_m_pfcmpeq(__m64 m1, __m64 m2) {
33*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfcmpeq
34*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfcmpeq
35*f4a2713aSLionel Sambuc   return _m_pfcmpeq(m1, m2);
36*f4a2713aSLionel Sambuc }
37*f4a2713aSLionel Sambuc 
test_m_pfcmpge(__m64 m1,__m64 m2)38*f4a2713aSLionel Sambuc __m64 test_m_pfcmpge(__m64 m1, __m64 m2) {
39*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfcmpge
40*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfcmpge
41*f4a2713aSLionel Sambuc   return _m_pfcmpge(m1, m2);
42*f4a2713aSLionel Sambuc }
43*f4a2713aSLionel Sambuc 
test_m_pfcmpgt(__m64 m1,__m64 m2)44*f4a2713aSLionel Sambuc __m64 test_m_pfcmpgt(__m64 m1, __m64 m2) {
45*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfcmpgt
46*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfcmpgt
47*f4a2713aSLionel Sambuc   return _m_pfcmpgt(m1, m2);
48*f4a2713aSLionel Sambuc }
49*f4a2713aSLionel Sambuc 
test_m_pfmax(__m64 m1,__m64 m2)50*f4a2713aSLionel Sambuc __m64 test_m_pfmax(__m64 m1, __m64 m2) {
51*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfmax
52*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfmax
53*f4a2713aSLionel Sambuc   return _m_pfmax(m1, m2);
54*f4a2713aSLionel Sambuc }
55*f4a2713aSLionel Sambuc 
test_m_pfmin(__m64 m1,__m64 m2)56*f4a2713aSLionel Sambuc __m64 test_m_pfmin(__m64 m1, __m64 m2) {
57*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfmin
58*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfmin
59*f4a2713aSLionel Sambuc   return _m_pfmin(m1, m2);
60*f4a2713aSLionel Sambuc }
61*f4a2713aSLionel Sambuc 
test_m_pfmul(__m64 m1,__m64 m2)62*f4a2713aSLionel Sambuc __m64 test_m_pfmul(__m64 m1, __m64 m2) {
63*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfmul
64*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfmul
65*f4a2713aSLionel Sambuc   return _m_pfmul(m1, m2);
66*f4a2713aSLionel Sambuc }
67*f4a2713aSLionel Sambuc 
test_m_pfrcp(__m64 m)68*f4a2713aSLionel Sambuc __m64 test_m_pfrcp(__m64 m) {
69*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfrcp
70*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfrcp
71*f4a2713aSLionel Sambuc   return _m_pfrcp(m);
72*f4a2713aSLionel Sambuc }
73*f4a2713aSLionel Sambuc 
test_m_pfrcpit1(__m64 m1,__m64 m2)74*f4a2713aSLionel Sambuc __m64 test_m_pfrcpit1(__m64 m1, __m64 m2) {
75*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfrcpit1
76*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfrcpit1
77*f4a2713aSLionel Sambuc   return _m_pfrcpit1(m1, m2);
78*f4a2713aSLionel Sambuc }
79*f4a2713aSLionel Sambuc 
test_m_pfrcpit2(__m64 m1,__m64 m2)80*f4a2713aSLionel Sambuc __m64 test_m_pfrcpit2(__m64 m1, __m64 m2) {
81*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfrcpit2
82*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfrcpit2
83*f4a2713aSLionel Sambuc   return _m_pfrcpit2(m1, m2);
84*f4a2713aSLionel Sambuc }
85*f4a2713aSLionel Sambuc 
test_m_pfrsqrt(__m64 m)86*f4a2713aSLionel Sambuc __m64 test_m_pfrsqrt(__m64 m) {
87*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfrsqrt
88*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfrsqrt
89*f4a2713aSLionel Sambuc   return _m_pfrsqrt(m);
90*f4a2713aSLionel Sambuc }
91*f4a2713aSLionel Sambuc 
test_m_pfrsqrtit1(__m64 m1,__m64 m2)92*f4a2713aSLionel Sambuc __m64 test_m_pfrsqrtit1(__m64 m1, __m64 m2) {
93*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfrsqrtit1
94*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfrsqit1
95*f4a2713aSLionel Sambuc   return _m_pfrsqrtit1(m1, m2);
96*f4a2713aSLionel Sambuc }
97*f4a2713aSLionel Sambuc 
test_m_pfsub(__m64 m1,__m64 m2)98*f4a2713aSLionel Sambuc __m64 test_m_pfsub(__m64 m1, __m64 m2) {
99*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfsub
100*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfsub
101*f4a2713aSLionel Sambuc   return _m_pfsub(m1, m2);
102*f4a2713aSLionel Sambuc }
103*f4a2713aSLionel Sambuc 
test_m_pfsubr(__m64 m1,__m64 m2)104*f4a2713aSLionel Sambuc __m64 test_m_pfsubr(__m64 m1, __m64 m2) {
105*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfsubr
106*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pfsubr
107*f4a2713aSLionel Sambuc   return _m_pfsubr(m1, m2);
108*f4a2713aSLionel Sambuc }
109*f4a2713aSLionel Sambuc 
test_m_pi2fd(__m64 m)110*f4a2713aSLionel Sambuc __m64 test_m_pi2fd(__m64 m) {
111*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pi2fd
112*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pi2fd
113*f4a2713aSLionel Sambuc   return _m_pi2fd(m);
114*f4a2713aSLionel Sambuc }
115*f4a2713aSLionel Sambuc 
test_m_pmulhrw(__m64 m1,__m64 m2)116*f4a2713aSLionel Sambuc __m64 test_m_pmulhrw(__m64 m1, __m64 m2) {
117*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pmulhrw
118*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnow.pmulhrw
119*f4a2713aSLionel Sambuc   return _m_pmulhrw(m1, m2);
120*f4a2713aSLionel Sambuc }
121*f4a2713aSLionel Sambuc 
test_m_pf2iw(__m64 m)122*f4a2713aSLionel Sambuc __m64 test_m_pf2iw(__m64 m) {
123*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pf2iw
124*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnowa.pf2iw
125*f4a2713aSLionel Sambuc   return _m_pf2iw(m);
126*f4a2713aSLionel Sambuc }
127*f4a2713aSLionel Sambuc 
test_m_pfnacc(__m64 m1,__m64 m2)128*f4a2713aSLionel Sambuc __m64 test_m_pfnacc(__m64 m1, __m64 m2) {
129*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfnacc
130*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnowa.pfnacc
131*f4a2713aSLionel Sambuc   return _m_pfnacc(m1, m2);
132*f4a2713aSLionel Sambuc }
133*f4a2713aSLionel Sambuc 
test_m_pfpnacc(__m64 m1,__m64 m2)134*f4a2713aSLionel Sambuc __m64 test_m_pfpnacc(__m64 m1, __m64 m2) {
135*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pfpnacc
136*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnowa.pfpnacc
137*f4a2713aSLionel Sambuc   return _m_pfpnacc(m1, m2);
138*f4a2713aSLionel Sambuc }
139*f4a2713aSLionel Sambuc 
test_m_pi2fw(__m64 m)140*f4a2713aSLionel Sambuc __m64 test_m_pi2fw(__m64 m) {
141*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pi2fw
142*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnowa.pi2fw
143*f4a2713aSLionel Sambuc   return _m_pi2fw(m);
144*f4a2713aSLionel Sambuc }
145*f4a2713aSLionel Sambuc 
test_m_pswapdsf(__m64 m)146*f4a2713aSLionel Sambuc __m64 test_m_pswapdsf(__m64 m) {
147*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pswapdsf
148*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnowa.pswapd
149*f4a2713aSLionel Sambuc   return _m_pswapdsf(m);
150*f4a2713aSLionel Sambuc }
151*f4a2713aSLionel Sambuc 
test_m_pswapdsi(__m64 m)152*f4a2713aSLionel Sambuc __m64 test_m_pswapdsi(__m64 m) {
153*f4a2713aSLionel Sambuc   // CHECK-LABEL: define i64 @test_m_pswapdsi
154*f4a2713aSLionel Sambuc   // CHECK: @llvm.x86.3dnowa.pswapd
155*f4a2713aSLionel Sambuc   return _m_pswapdsi(m);
156*f4a2713aSLionel Sambuc }
157