blob: 385e10e7baae86e70d609667d955e062162b55c3 [file] [log] [blame]
Matt Arsenault59b09ab2015-01-15 19:39:42 +00001; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Marek Olsak75170772015-01-27 17:27:15 +00002; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
Niels Ole Salscheider719fbc92013-08-08 16:06:15 +00003
Matt Arsenault59b09ab2015-01-15 19:39:42 +00004; FUNC-LABEL: {{^}}fptrunc_f64_to_f32:
5; SI: v_cvt_f32_f64_e32 {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}
6define void @fptrunc_f64_to_f32(float addrspace(1)* %out, double %in) {
Niels Ole Salscheider719fbc92013-08-08 16:06:15 +00007 %result = fptrunc double %in to float
8 store float %result, float addrspace(1)* %out
9 ret void
10}
Matt Arsenault59b09ab2015-01-15 19:39:42 +000011
12; FUNC-LABEL: {{^}}fptrunc_v2f64_to_v2f32:
13; SI: v_cvt_f32_f64_e32
14; SI: v_cvt_f32_f64_e32
15define void @fptrunc_v2f64_to_v2f32(<2 x float> addrspace(1)* %out, <2 x double> %in) {
16 %result = fptrunc <2 x double> %in to <2 x float>
17 store <2 x float> %result, <2 x float> addrspace(1)* %out
18 ret void
19}
20
21; FUNC-LABEL: {{^}}fptrunc_v4f64_to_v4f32:
22; SI: v_cvt_f32_f64_e32
23; SI: v_cvt_f32_f64_e32
24; SI: v_cvt_f32_f64_e32
25; SI: v_cvt_f32_f64_e32
26define void @fptrunc_v4f64_to_v4f32(<4 x float> addrspace(1)* %out, <4 x double> %in) {
27 %result = fptrunc <4 x double> %in to <4 x float>
28 store <4 x float> %result, <4 x float> addrspace(1)* %out
29 ret void
30}
31
32; FUNC-LABEL: {{^}}fptrunc_v8f64_to_v8f32:
33; SI: v_cvt_f32_f64_e32
34; SI: v_cvt_f32_f64_e32
35; SI: v_cvt_f32_f64_e32
36; SI: v_cvt_f32_f64_e32
37; SI: v_cvt_f32_f64_e32
38; SI: v_cvt_f32_f64_e32
39; SI: v_cvt_f32_f64_e32
40; SI: v_cvt_f32_f64_e32
41define void @fptrunc_v8f64_to_v8f32(<8 x float> addrspace(1)* %out, <8 x double> %in) {
42 %result = fptrunc <8 x double> %in to <8 x float>
43 store <8 x float> %result, <8 x float> addrspace(1)* %out
44 ret void
45}