121 lines · plain
1; RUN: llc -mtriple=amdgcn < %s | FileCheck -check-prefix=SI --check-prefix=FUNC %s2; RUN: llc -mtriple=amdgcn -mcpu=tonga -mattr=-flat-for-global < %s | FileCheck -check-prefix=SI --check-prefix=FUNC %s3; RUN: llc -mtriple=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG --check-prefix=FUNC %s4 5declare float @llvm.trunc.f32(float) nounwind readnone6declare <2 x float> @llvm.trunc.v2f32(<2 x float>) nounwind readnone7declare <3 x float> @llvm.trunc.v3f32(<3 x float>) nounwind readnone8declare <4 x float> @llvm.trunc.v4f32(<4 x float>) nounwind readnone9declare <8 x float> @llvm.trunc.v8f32(<8 x float>) nounwind readnone10declare <16 x float> @llvm.trunc.v16f32(<16 x float>) nounwind readnone11 12; FUNC-LABEL: {{^}}ftrunc_f32:13; EG: TRUNC14; SI: v_trunc_f32_e3215define amdgpu_kernel void @ftrunc_f32(ptr addrspace(1) %out, float %x) {16 %y = call float @llvm.trunc.f32(float %x) nounwind readnone17 store float %y, ptr addrspace(1) %out18 ret void19}20 21; FUNC-LABEL: {{^}}ftrunc_v2f32:22; EG: TRUNC23; EG: TRUNC24; SI: v_trunc_f32_e3225; SI: v_trunc_f32_e3226define amdgpu_kernel void @ftrunc_v2f32(ptr addrspace(1) %out, <2 x float> %x) {27 %y = call <2 x float> @llvm.trunc.v2f32(<2 x float> %x) nounwind readnone28 store <2 x float> %y, ptr addrspace(1) %out29 ret void30}31 32; FIXME-FUNC-LABEL: {{^}}ftrunc_v3f32:33; FIXME-EG: TRUNC34; FIXME-EG: TRUNC35; FIXME-EG: TRUNC36; FIXME-SI: v_trunc_f32_e3237; FIXME-SI: v_trunc_f32_e3238; FIXME-SI: v_trunc_f32_e3239; define amdgpu_kernel void @ftrunc_v3f32(ptr addrspace(1) %out, <3 x float> %x) {40; %y = call <3 x float> @llvm.trunc.v3f32(<3 x float> %x) nounwind readnone41; store <3 x float> %y, ptr addrspace(1) %out42; ret void43; }44 45; FUNC-LABEL: {{^}}ftrunc_v4f32:46; EG: TRUNC47; EG: TRUNC48; EG: TRUNC49; EG: TRUNC50; SI: v_trunc_f32_e3251; SI: v_trunc_f32_e3252; SI: v_trunc_f32_e3253; SI: v_trunc_f32_e3254define amdgpu_kernel void @ftrunc_v4f32(ptr addrspace(1) %out, <4 x float> %x) {55 %y = call <4 x float> @llvm.trunc.v4f32(<4 x float> %x) nounwind readnone56 store <4 x float> %y, ptr addrspace(1) %out57 ret void58}59 60; FUNC-LABEL: {{^}}ftrunc_v8f32:61; EG: TRUNC62; EG: TRUNC63; EG: TRUNC64; EG: TRUNC65; EG: TRUNC66; EG: TRUNC67; EG: TRUNC68; EG: TRUNC69; SI: v_trunc_f32_e3270; SI: v_trunc_f32_e3271; SI: v_trunc_f32_e3272; SI: v_trunc_f32_e3273; SI: v_trunc_f32_e3274; SI: v_trunc_f32_e3275; SI: v_trunc_f32_e3276; SI: v_trunc_f32_e3277define amdgpu_kernel void @ftrunc_v8f32(ptr addrspace(1) %out, <8 x float> %x) {78 %y = call <8 x float> @llvm.trunc.v8f32(<8 x float> %x) nounwind readnone79 store <8 x float> %y, ptr addrspace(1) %out80 ret void81}82 83; FUNC-LABEL: {{^}}ftrunc_v16f32:84; EG: TRUNC85; EG: TRUNC86; EG: TRUNC87; EG: TRUNC88; EG: TRUNC89; EG: TRUNC90; EG: TRUNC91; EG: TRUNC92; EG: TRUNC93; EG: TRUNC94; EG: TRUNC95; EG: TRUNC96; EG: TRUNC97; EG: TRUNC98; EG: TRUNC99; EG: TRUNC100; SI: v_trunc_f32_e32101; SI: v_trunc_f32_e32102; SI: v_trunc_f32_e32103; SI: v_trunc_f32_e32104; SI: v_trunc_f32_e32105; SI: v_trunc_f32_e32106; SI: v_trunc_f32_e32107; SI: v_trunc_f32_e32108; SI: v_trunc_f32_e32109; SI: v_trunc_f32_e32110; SI: v_trunc_f32_e32111; SI: v_trunc_f32_e32112; SI: v_trunc_f32_e32113; SI: v_trunc_f32_e32114; SI: v_trunc_f32_e32115; SI: v_trunc_f32_e32116define amdgpu_kernel void @ftrunc_v16f32(ptr addrspace(1) %out, <16 x float> %x) {117 %y = call <16 x float> @llvm.trunc.v16f32(<16 x float> %x) nounwind readnone118 store <16 x float> %y, ptr addrspace(1) %out119 ret void120}121