1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx,+f16c -show-mc-encoding -disable-peephole | FileCheck %s --check-prefixes=AVX,X86
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx,+f16c -show-mc-encoding -disable-peephole | FileCheck %s --check-prefixes=AVX,X64
4 ; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512vl -show-mc-encoding -disable-peephole | FileCheck %s --check-prefixes=AVX512VL,X86-AVX512VL
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512vl -show-mc-encoding -disable-peephole | FileCheck %s --check-prefixes=AVX512VL,X64-AVX512VL
7 define <4 x float> @test_x86_vcvtph2ps_128(<8 x i16> %a0) {
8 ; AVX-LABEL: test_x86_vcvtph2ps_128:
10 ; AVX-NEXT: vcvtph2ps %xmm0, %xmm0 # encoding: [0xc4,0xe2,0x79,0x13,0xc0]
11 ; AVX-NEXT: ret{{[l|q]}} # encoding: [0xc3]
13 ; AVX512VL-LABEL: test_x86_vcvtph2ps_128:
15 ; AVX512VL-NEXT: vcvtph2ps %xmm0, %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x13,0xc0]
16 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
17 %res = call <4 x float> @llvm.x86.vcvtph2ps.128(<8 x i16> %a0) ; <<4 x float>> [#uses=1]
20 declare <4 x float> @llvm.x86.vcvtph2ps.128(<8 x i16>) nounwind readonly
22 define <4 x float> @test_x86_vcvtph2ps_128_m(ptr nocapture %a) {
23 ; X86-LABEL: test_x86_vcvtph2ps_128_m:
25 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
26 ; X86-NEXT: vcvtph2ps (%eax), %xmm0 # encoding: [0xc4,0xe2,0x79,0x13,0x00]
27 ; X86-NEXT: retl # encoding: [0xc3]
29 ; X64-LABEL: test_x86_vcvtph2ps_128_m:
31 ; X64-NEXT: vcvtph2ps (%rdi), %xmm0 # encoding: [0xc4,0xe2,0x79,0x13,0x07]
32 ; X64-NEXT: retq # encoding: [0xc3]
34 ; X86-AVX512VL-LABEL: test_x86_vcvtph2ps_128_m:
35 ; X86-AVX512VL: # %bb.0:
36 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
37 ; X86-AVX512VL-NEXT: vcvtph2ps (%eax), %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x13,0x00]
38 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
40 ; X64-AVX512VL-LABEL: test_x86_vcvtph2ps_128_m:
41 ; X64-AVX512VL: # %bb.0:
42 ; X64-AVX512VL-NEXT: vcvtph2ps (%rdi), %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x13,0x07]
43 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
44 %load = load <8 x i16>, ptr %a
45 %res = call <4 x float> @llvm.x86.vcvtph2ps.128(<8 x i16> %load) ; <<4 x float>> [#uses=1]
49 define <8 x float> @test_x86_vcvtph2ps_256(<8 x i16> %a0) {
50 ; AVX-LABEL: test_x86_vcvtph2ps_256:
52 ; AVX-NEXT: vcvtph2ps %xmm0, %ymm0 # encoding: [0xc4,0xe2,0x7d,0x13,0xc0]
53 ; AVX-NEXT: ret{{[l|q]}} # encoding: [0xc3]
55 ; AVX512VL-LABEL: test_x86_vcvtph2ps_256:
57 ; AVX512VL-NEXT: vcvtph2ps %xmm0, %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x13,0xc0]
58 ; AVX512VL-NEXT: ret{{[l|q]}} # encoding: [0xc3]
59 %res = call <8 x float> @llvm.x86.vcvtph2ps.256(<8 x i16> %a0) ; <<8 x float>> [#uses=1]
62 declare <8 x float> @llvm.x86.vcvtph2ps.256(<8 x i16>) nounwind readonly
64 define <8 x float> @test_x86_vcvtph2ps_256_m(ptr nocapture %a) nounwind {
65 ; X86-LABEL: test_x86_vcvtph2ps_256_m:
67 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
68 ; X86-NEXT: vcvtph2ps (%eax), %ymm0 # encoding: [0xc4,0xe2,0x7d,0x13,0x00]
69 ; X86-NEXT: retl # encoding: [0xc3]
71 ; X64-LABEL: test_x86_vcvtph2ps_256_m:
73 ; X64-NEXT: vcvtph2ps (%rdi), %ymm0 # encoding: [0xc4,0xe2,0x7d,0x13,0x07]
74 ; X64-NEXT: retq # encoding: [0xc3]
76 ; X86-AVX512VL-LABEL: test_x86_vcvtph2ps_256_m:
77 ; X86-AVX512VL: # %bb.0:
78 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
79 ; X86-AVX512VL-NEXT: vcvtph2ps (%eax), %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x13,0x00]
80 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
82 ; X64-AVX512VL-LABEL: test_x86_vcvtph2ps_256_m:
83 ; X64-AVX512VL: # %bb.0:
84 ; X64-AVX512VL-NEXT: vcvtph2ps (%rdi), %ymm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x7d,0x13,0x07]
85 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
86 %load = load <8 x i16>, ptr %a
87 %res = tail call <8 x float> @llvm.x86.vcvtph2ps.256(<8 x i16> %load)
91 define <4 x float> @test_x86_vcvtph2ps_128_scalar(ptr %ptr) {
92 ; X86-LABEL: test_x86_vcvtph2ps_128_scalar:
94 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
95 ; X86-NEXT: vcvtph2ps (%eax), %xmm0 # encoding: [0xc4,0xe2,0x79,0x13,0x00]
96 ; X86-NEXT: retl # encoding: [0xc3]
98 ; X64-LABEL: test_x86_vcvtph2ps_128_scalar:
100 ; X64-NEXT: vcvtph2ps (%rdi), %xmm0 # encoding: [0xc4,0xe2,0x79,0x13,0x07]
101 ; X64-NEXT: retq # encoding: [0xc3]
103 ; X86-AVX512VL-LABEL: test_x86_vcvtph2ps_128_scalar:
104 ; X86-AVX512VL: # %bb.0:
105 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
106 ; X86-AVX512VL-NEXT: vcvtph2ps (%eax), %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x13,0x00]
107 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
109 ; X64-AVX512VL-LABEL: test_x86_vcvtph2ps_128_scalar:
110 ; X64-AVX512VL: # %bb.0:
111 ; X64-AVX512VL-NEXT: vcvtph2ps (%rdi), %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x13,0x07]
112 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
113 %load = load i64, ptr %ptr
114 %ins1 = insertelement <2 x i64> undef, i64 %load, i32 0
115 %ins2 = insertelement <2 x i64> %ins1, i64 0, i32 1
116 %bc = bitcast <2 x i64> %ins2 to <8 x i16>
117 %res = tail call <4 x float> @llvm.x86.vcvtph2ps.128(<8 x i16> %bc) #2
121 define <4 x float> @test_x86_vcvtph2ps_128_scalar2(ptr %ptr) {
122 ; X86-LABEL: test_x86_vcvtph2ps_128_scalar2:
124 ; X86-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
125 ; X86-NEXT: vcvtph2ps (%eax), %xmm0 # encoding: [0xc4,0xe2,0x79,0x13,0x00]
126 ; X86-NEXT: retl # encoding: [0xc3]
128 ; X64-LABEL: test_x86_vcvtph2ps_128_scalar2:
130 ; X64-NEXT: vcvtph2ps (%rdi), %xmm0 # encoding: [0xc4,0xe2,0x79,0x13,0x07]
131 ; X64-NEXT: retq # encoding: [0xc3]
133 ; X86-AVX512VL-LABEL: test_x86_vcvtph2ps_128_scalar2:
134 ; X86-AVX512VL: # %bb.0:
135 ; X86-AVX512VL-NEXT: movl {{[0-9]+}}(%esp), %eax # encoding: [0x8b,0x44,0x24,0x04]
136 ; X86-AVX512VL-NEXT: vcvtph2ps (%eax), %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x13,0x00]
137 ; X86-AVX512VL-NEXT: retl # encoding: [0xc3]
139 ; X64-AVX512VL-LABEL: test_x86_vcvtph2ps_128_scalar2:
140 ; X64-AVX512VL: # %bb.0:
141 ; X64-AVX512VL-NEXT: vcvtph2ps (%rdi), %xmm0 # EVEX TO VEX Compression encoding: [0xc4,0xe2,0x79,0x13,0x07]
142 ; X64-AVX512VL-NEXT: retq # encoding: [0xc3]
143 %load = load i64, ptr %ptr
144 %ins = insertelement <2 x i64> undef, i64 %load, i32 0
145 %bc = bitcast <2 x i64> %ins to <8 x i16>
146 %res = tail call <4 x float> @llvm.x86.vcvtph2ps.128(<8 x i16> %bc)