x86-GCC-inline-asm-Y-constraints.c
1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// RUN: %clang_cc1 -ffreestanding -triple=x86_64-apple-darwin -target-cpu skx %s -emit-llvm -o - | FileCheck %s
#include <xmmintrin.h>
// This test is complimented by the .ll test under llvm/test/MC/X86/.
// At this level we can only check if the constarints are passed correctly
// from inline asm to llvm IR.
// CHECK-LABEL: @f_Ym
void f_Ym(__m64 m)
{
// CHECK: movq $0, %mm1
// CHECK-SAME: "=^Ym,~{dirflag},~{fpsr},~{flags}"
__asm__ volatile ("movq %0, %%mm1\n\t"
:"=Ym" (m));
}
// CHECK-LABEL: f_Yi
void f_Yi(__m128 x, __m128 y, __m128 z)
{
// CHECK: vpaddq
// CHECK-SAME: "=^Yi,^Yi,^Yi,~{dirflag},~{fpsr},~{flags}"
__asm__ volatile ("vpaddq %0, %1, %2\n\t"
:"=Yi" (x)
:"Yi" (y),"Yi"(z));
}
// CHECK-LABEL: f_Yt
void f_Yt(__m128 x, __m128 y, __m128 z)
{
// CHECK: vpaddq
// CHECK-SAME: "=^Yt,^Yt,^Yt,~{dirflag},~{fpsr},~{flags}"
__asm__ volatile ("vpaddq %0, %1, %2\n\t"
:"=Yt" (x)
:"Yt" (y),"Yt"(z));
}
// CHECK-LABEL: f_Y2
void f_Y2(__m128 x, __m128 y, __m128 z)
{
// CHECK: vpaddq
// CHECK-SAME: "=^Y2,^Y2,^Y2,~{dirflag},~{fpsr},~{flags}"
__asm__ volatile ("vpaddq %0, %1, %2\n\t"
:"=Y2" (x)
:"Y2" (y),"Y2"(z));
}
// CHECK-LABEL: f_Yz
void f_Yz(__m128 x, __m128 y, __m128 z)
{
// CHECK: vpaddq
// CHECK-SAME: vpaddq
// CHECK-SAME: "=^Yi,=^Yz,^Yi,0,~{dirflag},~{fpsr},~{flags}"
__asm__ volatile ("vpaddq %0,%2,%1\n\t"
"vpaddq %1,%0,%2\n\t"
:"+Yi"(z),"=Yz" (x)
:"Yi" (y) );
}
// CHECK-LABEL: f_Y0
void f_Y0(__m128 x, __m128 y, __m128 z)
{
// CHECK: vpaddq
// CHECK-SAME: "=^Yi,=^Y0,^Yi,0,~{dirflag},~{fpsr},~{flags}"
__asm__ volatile ("vpaddq %0,%2,%1\n\t"
"vpaddq %1,%0,%2\n\t"
:"+Yi"(z),"=Y0" (x)
:"Yi" (y) );
}