aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512fp16-13.c
blob: 1cd9a07b8350f4f284c1768b3f3c4d2b344be5ca (plain)
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* { dg-do compile} */
/* { dg-options "-O2 -mavx512fp16 -mavx512vl" } */

#include <immintrin.h>
void
__attribute__ ((noinline, noclone))
store512_ph (void *p, __m512h a)
{
  _mm512_store_ph (p, a);
}

/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*\\)" 1 } } */

void
__attribute__ ((noinline, noclone))
store256_ph (void *p, __m256h a)
{
  _mm256_store_ph (p, a);
}

/* { dg-final { scan-assembler-times "vmovdqa\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*\\)" 1 } } */

void
__attribute__ ((noinline, noclone))
store_ph (void *p, __m128h a)
{
  _mm_store_ph (p, a);
}

/* { dg-final { scan-assembler-times "vmovdqa\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*\\)" 1 } } */

__m512h
__attribute__ ((noinline, noclone))
load512_ph (void const *p)
{
  return _mm512_load_ph (p);
}

/* { dg-final { scan-assembler-times "vmovdqa64\[ \\t\]+\[^\{\n\]*%zmm\[0-9\]+\[^\n\]*\\)" 1 } } */

__m256h
__attribute__ ((noinline, noclone))
load256_ph (void const *p)
{
  return _mm256_load_ph (p);
}

/* { dg-final { scan-assembler-times "vmovdqa\[ \\t\]+\[^\{\n\]*%ymm\[0-9\]+\[^\n\]*\\)" 1 } } */

__m128h
__attribute__ ((noinline, noclone))
load_ph (void const *p)
{
  return _mm_load_ph (p);
}
/* { dg-final { scan-assembler-times "vmovdqa\[ \\t\]+\[^\{\n\]*%xmm\[0-9\]+\[^\n\]*\\)" 1 } } */

__m512h
__attribute__ ((noinline, noclone))
load512u_ph (void const *p)
{
  return _mm512_loadu_ph (p);
}

/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]*\[^,\]*,\[^\{\n\]*%zmm\[0-9\]" 1 } } */

__m256h
__attribute__ ((noinline, noclone))
load256u_ph (void const *p)
{
  return _mm256_loadu_ph (p);
}

/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]*\[^,\]*,\[^\{\n\]*%ymm\[0-9\]" 1 } } */

__m128h
__attribute__ ((noinline, noclone))
load128u_ph (void const *p)
{
  return _mm_loadu_ph (p);
}

/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]*\[^,\]*,\[^\{\n\]*%xmm\[0-9\]" 1 } } */

void
__attribute__ ((noinline, noclone))
store512u_ph (void *p, __m512h a)
{
  return _mm512_storeu_ph (p, a);
}

/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]*\[^\{\n\]*%zmm\[0-9\], *\[^,\]*" 1 } } */

void
__attribute__ ((noinline, noclone))
store256u_ph (void *p, __m256h a)
{
  return _mm256_storeu_ph (p, a);
}

/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]*\[^\{\n\]*%ymm\[0-9\], *\[^,\]*" 1 } } */

void
__attribute__ ((noinline, noclone))
storeu_ph (void *p, __m128h a)
{
  return _mm_storeu_ph (p, a);
}

/* { dg-final { scan-assembler-times "vmovdqu16\[ \\t\]*\[^\{\n\]*%xmm\[0-9\], *\[^,\]*" 1 } } */

__m512h
__attribute__ ((noinline, noclone))
abs512_ph (__m512h a)
{
  return _mm512_abs_ph (a);
}

/* { dg-final { scan-assembler-times "vpandd\[^\n\]*%zmm\[0-9\]+" 1 } } */

__m256h
__attribute__ ((noinline, noclone))
abs256_ph (__m256h a)
{
  return _mm256_abs_ph (a);
}

/* { dg-final { scan-assembler-times "vpand\[^\n\]*%ymm\[0-9\]+" 1 } } */

__m128h
__attribute__ ((noinline, noclone))
abs_ph (__m128h a)
{
  return _mm_abs_ph (a);
}

/* { dg-final { scan-assembler-times "vpand\[^\n\]*%xmm\[0-9\]+" 1 } } */