111 lines · plain
1; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=tahiti < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s2; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=bonaire < %s | FileCheck -check-prefix=CI -check-prefix=FUNC %s3; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=tonga < %s | FileCheck -check-prefix=CI -check-prefix=FUNC %s4 5declare double @llvm.trunc.f64(double) nounwind readnone6declare <2 x double> @llvm.trunc.v2f64(<2 x double>) nounwind readnone7declare <3 x double> @llvm.trunc.v3f64(<3 x double>) nounwind readnone8declare <4 x double> @llvm.trunc.v4f64(<4 x double>) nounwind readnone9declare <8 x double> @llvm.trunc.v8f64(<8 x double>) nounwind readnone10declare <16 x double> @llvm.trunc.v16f64(<16 x double>) nounwind readnone11 12; FUNC-LABEL: {{^}}v_ftrunc_f64:13; CI: v_trunc_f6414; SI: s_bfe_u32 {{s[0-9]+}}, {{s[0-9]+}}, 0xb001415; SI: s_endpgm16define amdgpu_kernel void @v_ftrunc_f64(ptr addrspace(1) %out, ptr addrspace(1) %in) {17 %x = load double, ptr addrspace(1) %in, align 818 %y = call double @llvm.trunc.f64(double %x) nounwind readnone19 store double %y, ptr addrspace(1) %out, align 820 ret void21}22 23; FUNC-LABEL: {{^}}ftrunc_f64:24; CI: v_trunc_f64_e3225 26; SI: s_bfe_u32 [[SEXP:s[0-9]+]], {{s[0-9]+}}, 0xb001427; SI-DAG: s_and_b32 s{{[0-9]+}}, s{{[0-9]+}}, 0x8000000028; SI-DAG: s_add_i32 [[SEXP1:s[0-9]+]], [[SEXP]], 0xfffffc0129; SI-DAG: s_lshr_b64 s[{{[0-9]+:[0-9]+}}], s[{{[0-9]+:[0-9]+}}], [[SEXP1]]30; SI-DAG: s_andn2_b6431; SI-DAG: cmp_gt_i3232; SI-DAG: s_cselect_b3233; SI-DAG: s_cselect_b3234; SI-DAG: cmp_lt_i3235; SI-DAG: s_cselect_b3236; SI-DAG: s_cselect_b3237; SI: s_endpgm38define amdgpu_kernel void @ftrunc_f64(ptr addrspace(1) %out, double %x) {39 %y = call double @llvm.trunc.f64(double %x) nounwind readnone40 store double %y, ptr addrspace(1) %out41 ret void42}43 44; FUNC-LABEL: {{^}}ftrunc_v2f64:45; CI: v_trunc_f64_e3246; CI: v_trunc_f64_e3247define amdgpu_kernel void @ftrunc_v2f64(ptr addrspace(1) %out, <2 x double> %x) {48 %y = call <2 x double> @llvm.trunc.v2f64(<2 x double> %x) nounwind readnone49 store <2 x double> %y, ptr addrspace(1) %out50 ret void51}52 53; FIXME-FUNC-LABEL: {{^}}ftrunc_v3f64:54; FIXME-CI: v_trunc_f64_e3255; FIXME-CI: v_trunc_f64_e3256; FIXME-CI: v_trunc_f64_e3257; define amdgpu_kernel void @ftrunc_v3f64(ptr addrspace(1) %out, <3 x double> %x) {58; %y = call <3 x double> @llvm.trunc.v3f64(<3 x double> %x) nounwind readnone59; store <3 x double> %y, ptr addrspace(1) %out60; ret void61; }62 63; FUNC-LABEL: {{^}}ftrunc_v4f64:64; CI: v_trunc_f64_e3265; CI: v_trunc_f64_e3266; CI: v_trunc_f64_e3267; CI: v_trunc_f64_e3268define amdgpu_kernel void @ftrunc_v4f64(ptr addrspace(1) %out, <4 x double> %x) {69 %y = call <4 x double> @llvm.trunc.v4f64(<4 x double> %x) nounwind readnone70 store <4 x double> %y, ptr addrspace(1) %out71 ret void72}73 74; FUNC-LABEL: {{^}}ftrunc_v8f64:75; CI: v_trunc_f64_e3276; CI: v_trunc_f64_e3277; CI: v_trunc_f64_e3278; CI: v_trunc_f64_e3279; CI: v_trunc_f64_e3280; CI: v_trunc_f64_e3281; CI: v_trunc_f64_e3282; CI: v_trunc_f64_e3283define amdgpu_kernel void @ftrunc_v8f64(ptr addrspace(1) %out, <8 x double> %x) {84 %y = call <8 x double> @llvm.trunc.v8f64(<8 x double> %x) nounwind readnone85 store <8 x double> %y, ptr addrspace(1) %out86 ret void87}88 89; FUNC-LABEL: {{^}}ftrunc_v16f64:90; CI: v_trunc_f64_e3291; CI: v_trunc_f64_e3292; CI: v_trunc_f64_e3293; CI: v_trunc_f64_e3294; CI: v_trunc_f64_e3295; CI: v_trunc_f64_e3296; CI: v_trunc_f64_e3297; CI: v_trunc_f64_e3298; CI: v_trunc_f64_e3299; CI: v_trunc_f64_e32100; CI: v_trunc_f64_e32101; CI: v_trunc_f64_e32102; CI: v_trunc_f64_e32103; CI: v_trunc_f64_e32104; CI: v_trunc_f64_e32105; CI: v_trunc_f64_e32106define amdgpu_kernel void @ftrunc_v16f64(ptr addrspace(1) %out, <16 x double> %x) {107 %y = call <16 x double> @llvm.trunc.v16f64(<16 x double> %x) nounwind readnone108 store <16 x double> %y, ptr addrspace(1) %out109 ret void110}111