summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/avx512vl-vcvtps2ph-3.c
blob: c2e3f01050eef3b74b39ab861e23621560cb4cd8 (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
/* { dg-do compile { target { ! ia32 } } } */
/* { dg-options "-O2 -mf16c -mavx512vl -masm=att" } */

#include <x86intrin.h>

void
f1 (__m128 x)
{
  register __m128 a __asm ("xmm16");
  register __m128i b __asm ("xmm17");
  a = x;
  asm volatile ("" : "+v" (a));
  b = _mm_cvtps_ph (a, 1);
  asm volatile ("" : "+v" (b));
}

/* { dg-final { scan-assembler "vcvtps2ph\[^\n\r]*\\\$1\[^\n\r]*%xmm16\[^\n\r]*%xmm17" } } */

void
f2 (__m256 x)
{
  register __m256 a __asm ("xmm16");
  register __m128i b __asm ("xmm17");
  a = x;
  asm volatile ("" : "+v" (a));
  b = _mm256_cvtps_ph (a, 1);
  asm volatile ("" : "+v" (b));
}

/* { dg-final { scan-assembler "vcvtps2ph\[^\n\r]*\\\$1\[^\n\r]*%ymm16\[^\n\r]*%xmm17" } } */

void
f3 (__m256 x, __v8hi *y)
{
  register __m256 a __asm ("xmm16");
  a = x;
  asm volatile ("" : "+v" (a));
  *y = (__v8hi) _mm256_cvtps_ph (a, 1);
}

/* { dg-final { scan-assembler "vcvtps2ph\[^\n\r]*\\\$1\[^\n\r]*%ymm16\[^\n\r]*%\[re\]di" } } */