• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3
4; 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) {
7  %result = fptrunc double %in to float
8  store float %result, float addrspace(1)* %out
9  ret void
10}
11
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}
46