Changeset View
Changeset View
Standalone View
Standalone View
llvm/test/CodeGen/AMDGPU/mad-mix-lo.ll
; RUN: llc -march=amdgcn -mcpu=gfx906 -verify-machineinstrs -enable-misched=false < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9,GFX906 %s | ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||||
; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -enable-misched=false < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9,GFX900 %s | ; RUN: llc -march=amdgcn -mcpu=gfx906 -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=GFX906 %s | ||||
; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs -enable-misched=false < %s | FileCheck -enable-var-scope -check-prefixes=GCN,CIVI %s | ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=GFX900 %s | ||||
; RUN: llc -march=amdgcn -mcpu=hawaii -verify-machineinstrs -enable-misched=false < %s | FileCheck -enable-var-scope -check-prefixes=GCN,CIVI,CI %s | ; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=VI %s | ||||
; RUN: llc -march=amdgcn -mcpu=hawaii -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=CI %s | |||||
; GCN-LABEL: mixlo_simple: | |||||
; GCN: s_waitcnt | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v0, v0, v1, v2{{$}} | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v0, v0, v1, v2{{$}} | |||||
; GFX9-NEXT: s_setpc_b64 | |||||
; CIVI: v_mac_f32_e32 | |||||
; CIVI: v_cvt_f16_f32_e32 | |||||
define half @mixlo_simple(float %src0, float %src1, float %src2) #0 { | define half @mixlo_simple(float %src0, float %src1, float %src2) #0 { | ||||
; GFX906-LABEL: mixlo_simple: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v0, v0, v1, v2 | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: mixlo_simple: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v0, v0, v1, v2 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: mixlo_simple: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v0, v2 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: mixlo_simple: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%result = call float @llvm.fmuladd.f32(float %src0, float %src1, float %src2) | %result = call float @llvm.fmuladd.f32(float %src0, float %src1, float %src2) | ||||
%cvt.result = fptrunc float %result to half | %cvt.result = fptrunc float %result to half | ||||
ret half %cvt.result | ret half %cvt.result | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mixlo_f16_f16lo_f16lo_f16lo: | |||||
; GFX900: v_mad_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,1]{{$}} | |||||
; GFX906: v_fma_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,1]{{$}} | |||||
; CI: v_mac_f32 | |||||
; CIVI: v_cvt_f16_f32 | |||||
define half @v_mad_mixlo_f16_f16lo_f16lo_f16lo(half %src0, half %src1, half %src2) #0 { | define half @v_mad_mixlo_f16_f16lo_f16lo_f16lo(half %src0, half %src1, half %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f16lo: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,1] | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f16lo: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f16lo: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v0, v2 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f16lo: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext half %src0 to float | %src0.ext = fpext half %src0 to float | ||||
%src1.ext = fpext half %src1 to float | %src1.ext = fpext half %src1 to float | ||||
%src2.ext = fpext half %src2 to float | %src2.ext = fpext half %src2 to float | ||||
%result = tail call float @llvm.fmuladd.f32(float %src0.ext, float %src1.ext, float %src2.ext) | %result = tail call float @llvm.fmuladd.f32(float %src0.ext, float %src1.ext, float %src2.ext) | ||||
%cvt.result = fptrunc float %result to half | %cvt.result = fptrunc float %result to half | ||||
ret half %cvt.result | ret half %cvt.result | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mixlo_f16_f16lo_f16lo_f32: | |||||
; GCN: s_waitcnt | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,0]{{$}} | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,0]{{$}} | |||||
; GFX9-NEXT: s_setpc_b64 | |||||
; CIVI: v_mac_f32 | |||||
define half @v_mad_mixlo_f16_f16lo_f16lo_f32(half %src0, half %src1, float %src2) #0 { | define half @v_mad_mixlo_f16_f16lo_f16lo_f32(half %src0, half %src1, float %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,0] | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,0] | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v0, v2 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext half %src0 to float | %src0.ext = fpext half %src0 to float | ||||
%src1.ext = fpext half %src1 to float | %src1.ext = fpext half %src1 to float | ||||
%result = tail call float @llvm.fmuladd.f32(float %src0.ext, float %src1.ext, float %src2) | %result = tail call float @llvm.fmuladd.f32(float %src0.ext, float %src1.ext, float %src2) | ||||
%cvt.result = fptrunc float %result to half | %cvt.result = fptrunc float %result to half | ||||
ret half %cvt.result | ret half %cvt.result | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_post_cvt: | |||||
; GCN: s_waitcnt | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,0] clamp{{$}} | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,0] clamp{{$}} | |||||
; GFX9-NEXT: s_setpc_b64 | |||||
; CIVI: v_mac_f32_e32 v{{[0-9]}}, v{{[0-9]}}, v{{[0-9]$}} | |||||
define half @v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_post_cvt(half %src0, half %src1, float %src2) #0 { | define half @v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_post_cvt(half %src0, half %src1, float %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_post_cvt: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,0] clamp | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_post_cvt: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v0, v0, v1, v2 op_sel_hi:[1,1,0] clamp | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_post_cvt: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_e64 v0, v2 clamp | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_post_cvt: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v0, v0 clamp | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext half %src0 to float | %src0.ext = fpext half %src0 to float | ||||
%src1.ext = fpext half %src1 to float | %src1.ext = fpext half %src1 to float | ||||
%result = tail call float @llvm.fmuladd.f32(float %src0.ext, float %src1.ext, float %src2) | %result = tail call float @llvm.fmuladd.f32(float %src0.ext, float %src1.ext, float %src2) | ||||
%cvt.result = fptrunc float %result to half | %cvt.result = fptrunc float %result to half | ||||
%max = call half @llvm.maxnum.f16(half %cvt.result, half 0.0) | %max = call half @llvm.maxnum.f16(half %cvt.result, half 0.0) | ||||
%clamp = call half @llvm.minnum.f16(half %max, half 1.0) | %clamp = call half @llvm.minnum.f16(half %max, half 1.0) | ||||
ret half %clamp | ret half %clamp | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_pre_cvt: | |||||
; GCN: s_waitcnt | |||||
; GFX900-NEXT: v_mad_mix_f32 v0, v0, v1, v2 op_sel_hi:[1,1,0] clamp{{$}} | |||||
; GFX906-NEXT: v_fma_mix_f32 v0, v0, v1, v2 op_sel_hi:[1,1,0] clamp{{$}} | |||||
; GFX9-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX9-NEXT: s_setpc_b64 | |||||
; CIVI: v_mad_f32 v{{[0-9]}}, v{{[0-9]}}, v{{[0-9]}}, v{{[0-9]}} clamp{{$}} | |||||
define half @v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_pre_cvt(half %src0, half %src1, float %src2) #0 { | define half @v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_pre_cvt(half %src0, half %src1, float %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_pre_cvt: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mix_f32 v0, v0, v1, v2 op_sel_hi:[1,1,0] clamp | |||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_pre_cvt: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mix_f32 v0, v0, v1, v2 op_sel_hi:[1,1,0] clamp | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_pre_cvt: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_mad_f32 v0, v0, v1, v2 clamp | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mixlo_f16_f16lo_f16lo_f32_clamp_pre_cvt: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_mad_f32 v0, v0, v1, v2 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext half %src0 to float | %src0.ext = fpext half %src0 to float | ||||
%src1.ext = fpext half %src1 to float | %src1.ext = fpext half %src1 to float | ||||
%result = tail call float @llvm.fmuladd.f32(float %src0.ext, float %src1.ext, float %src2) | %result = tail call float @llvm.fmuladd.f32(float %src0.ext, float %src1.ext, float %src2) | ||||
%max = call float @llvm.maxnum.f32(float %result, float 0.0) | %max = call float @llvm.maxnum.f32(float %result, float 0.0) | ||||
%clamp = call float @llvm.minnum.f32(float %max, float 1.0) | %clamp = call float @llvm.minnum.f32(float %max, float 1.0) | ||||
%cvt.result = fptrunc float %clamp to half | %cvt.result = fptrunc float %clamp to half | ||||
ret half %cvt.result | ret half %cvt.result | ||||
} | } | ||||
; FIXME: Should abe able to avoid extra register because first | ; FIXME(DAG): Should abe able to avoid extra register because first | ||||
; operation only clobbers relevant lane. | ; operation only clobbers relevant lane. | ||||
; GCN-LABEL: {{^}}v_mad_mix_v2f32: | |||||
; GCN: s_waitcnt | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1]{{$}} | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1]{{$}} | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1]{{$}} | |||||
; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1]{{$}} | |||||
; GFX9-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX9-NEXT: s_setpc_b64 | |||||
define <2 x half> @v_mad_mix_v2f32(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | define <2 x half> @v_mad_mix_v2f32(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mix_v2f32: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] | |||||
; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX906-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mix_v2f32: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v2f32: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v3, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_mac_f32_e32 v5, v3, v4 | |||||
; VI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v0, v5 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v1, v2 | |||||
; VI-NEXT: v_or_b32_e32 v0, v1, v0 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v2f32: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_mac_f32_e32 v4, v0, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v4 | |||||
; CI-NEXT: v_mac_f32_e32 v5, v1, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <2 x half> %src0 to <2 x float> | %src0.ext = fpext <2 x half> %src0 to <2 x float> | ||||
%src1.ext = fpext <2 x half> %src1 to <2 x float> | %src1.ext = fpext <2 x half> %src1 to <2 x float> | ||||
%src2.ext = fpext <2 x half> %src2 to <2 x float> | %src2.ext = fpext <2 x half> %src2 to <2 x float> | ||||
%result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | %result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | ||||
%cvt.result = fptrunc <2 x float> %result to <2 x half> | %cvt.result = fptrunc <2 x float> %result to <2 x half> | ||||
ret <2 x half> %cvt.result | ret <2 x half> %cvt.result | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mix_v3f32: | define <3 x half> @v_mad_mix_v3f32(<3 x half> %src0, <3 x half> %src1, <3 x half> %src2) #0 { | ||||
; GCN: s_waitcnt | ; GFX906-LABEL: v_mad_mix_v3f32: | ||||
; GFX900-NEXT: v_mad_mixlo_f16 v1, v1, v3, v5 op_sel_hi:[1,1,1] | ; GFX906: ; %bb.0: | ||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v2, v4 op_sel_hi:[1,1,1] | ; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v1, v1, v3, v5 op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixlo_f16 v1, v1, v3, v5 op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v2, v4 op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v2, v4 op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX9-NEXT: v_mov_b32_e32 v0, v3 | ; GFX906-NEXT: s_setpc_b64 s[30:31] | ||||
; GFX9-NEXT: s_setpc_b64 | ; | ||||
define <3 x half> @v_mad_mix_v3f32(<3 x half> %src0, <3 x half> %src1, <3 x half> %src2) #0 { | ; GFX900-LABEL: v_mad_mix_v3f32: | ||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v1, v1, v3, v5 op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v2, v4 op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v3f32: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v7, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v8, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; VI-NEXT: v_mac_f32_e32 v8, v6, v7 | |||||
; VI-NEXT: v_mac_f32_e32 v4, v0, v2 | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v0, v8 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_mac_f32_e32 v5, v1, v3 | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v2, v4 | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v1, v5 | |||||
; VI-NEXT: v_or_b32_e32 v0, v2, v0 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v3f32: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_mac_f32_e32 v7, v1, v4 | |||||
; CI-NEXT: v_mac_f32_e32 v6, v0, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v6 | |||||
; CI-NEXT: v_mac_f32_e32 v8, v2, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v7 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v8 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <3 x half> %src0 to <3 x float> | %src0.ext = fpext <3 x half> %src0 to <3 x float> | ||||
%src1.ext = fpext <3 x half> %src1 to <3 x float> | %src1.ext = fpext <3 x half> %src1 to <3 x float> | ||||
%src2.ext = fpext <3 x half> %src2 to <3 x float> | %src2.ext = fpext <3 x half> %src2 to <3 x float> | ||||
%result = tail call <3 x float> @llvm.fmuladd.v3f32(<3 x float> %src0.ext, <3 x float> %src1.ext, <3 x float> %src2.ext) | %result = tail call <3 x float> @llvm.fmuladd.v3f32(<3 x float> %src0.ext, <3 x float> %src1.ext, <3 x float> %src2.ext) | ||||
%cvt.result = fptrunc <3 x float> %result to <3 x half> | %cvt.result = fptrunc <3 x float> %result to <3 x half> | ||||
ret <3 x half> %cvt.result | ret <3 x half> %cvt.result | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mix_v4f32: | define <4 x half> @v_mad_mix_v4f32(<4 x half> %src0, <4 x half> %src1, <4 x half> %src2) #0 { | ||||
; GCN: s_waitcnt | ; GFX906-LABEL: v_mad_mix_v4f32: | ||||
; GFX900-NEXT: v_mad_mixlo_f16 v6, v1, v3, v5 op_sel_hi:[1,1,1] | ; GFX906: ; %bb.0: | ||||
; GFX900-NEXT: v_mad_mixlo_f16 v7, v0, v2, v4 op_sel_hi:[1,1,1] | ; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||||
; GFX900-NEXT: v_mad_mixhi_f16 v7, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v6, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v6, v1, v3, v5 op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixlo_f16 v6, v1, v3, v5 op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_fma_mixlo_f16 v7, v0, v2, v4 op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixlo_f16 v7, v0, v2, v4 op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_fma_mixhi_f16 v7, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixhi_f16 v7, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_fma_mixhi_f16 v6, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixhi_f16 v6, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_mov_b32_e32 v0, v7 | |||||
; GFX9-NEXT: v_mov_b32_e32 v0, v7 | ; GFX906-NEXT: v_mov_b32_e32 v1, v6 | ||||
; GFX9-NEXT: v_mov_b32_e32 v1, v6 | ; GFX906-NEXT: s_setpc_b64 s[30:31] | ||||
; GFX9-NEXT: s_setpc_b64 | ; | ||||
define <4 x half> @v_mad_mix_v4f32(<4 x half> %src0, <4 x half> %src1, <4 x half> %src2) #0 { | ; GFX900-LABEL: v_mad_mix_v4f32: | ||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v6, v1, v3, v5 op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v7, v0, v2, v4 op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v7, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v6, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mov_b32_e32 v0, v7 | |||||
; GFX900-NEXT: v_mov_b32_e32 v1, v6 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v4f32: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v6, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v7, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v8, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v9, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v10, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v11, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; VI-NEXT: v_mac_f32_e32 v10, v6, v8 | |||||
; VI-NEXT: v_mac_f32_e32 v11, v7, v9 | |||||
; VI-NEXT: v_mac_f32_e32 v5, v1, v3 | |||||
; VI-NEXT: v_mac_f32_e32 v4, v0, v2 | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v1, v10 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v0, v11 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v2, v5 | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v3, v4 | |||||
; VI-NEXT: v_or_b32_e32 v1, v2, v1 | |||||
; VI-NEXT: v_or_b32_e32 v0, v3, v0 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v4f32: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v9, v9 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v10, v10 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v11, v11 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v9, v9 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v10, v10 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v11, v11 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_mac_f32_e32 v10, v2, v6 | |||||
; CI-NEXT: v_mac_f32_e32 v9, v1, v5 | |||||
; CI-NEXT: v_mac_f32_e32 v8, v0, v4 | |||||
; CI-NEXT: v_mac_f32_e32 v11, v3, v7 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v8 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v9 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v10 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v11 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <4 x half> %src0 to <4 x float> | %src0.ext = fpext <4 x half> %src0 to <4 x float> | ||||
%src1.ext = fpext <4 x half> %src1 to <4 x float> | %src1.ext = fpext <4 x half> %src1 to <4 x float> | ||||
%src2.ext = fpext <4 x half> %src2 to <4 x float> | %src2.ext = fpext <4 x half> %src2 to <4 x float> | ||||
%result = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %src0.ext, <4 x float> %src1.ext, <4 x float> %src2.ext) | %result = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %src0.ext, <4 x float> %src1.ext, <4 x float> %src2.ext) | ||||
%cvt.result = fptrunc <4 x float> %result to <4 x half> | %cvt.result = fptrunc <4 x float> %result to <4 x half> | ||||
ret <4 x half> %cvt.result | ret <4 x half> %cvt.result | ||||
} | } | ||||
; FIXME: Fold clamp | ; FIXME (DAG): Fold clamp | ||||
; GCN-LABEL: {{^}}v_mad_mix_v2f32_clamp_postcvt: | |||||
; GFX900: v_mad_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] clamp{{$}} | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp{{$}} | |||||
; GFX906: v_fma_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] clamp{{$}} | |||||
; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp{{$}} | |||||
; GFX9-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX9-NEXT: s_setpc_b64 | |||||
define <2 x half> @v_mad_mix_v2f32_clamp_postcvt(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | define <2 x half> @v_mad_mix_v2f32_clamp_postcvt(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mix_v2f32_clamp_postcvt: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mix_v2f32_clamp_postcvt: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v2f32_clamp_postcvt: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v3, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_mac_f32_e32 v5, v3, v4 | |||||
; VI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v0, v5 clamp dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_e64 v1, v2 clamp | |||||
; VI-NEXT: v_or_b32_e32 v0, v1, v0 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v2f32_clamp_postcvt: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_mac_f32_e32 v5, v1, v3 | |||||
; CI-NEXT: v_mac_f32_e32 v4, v0, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v1, v0 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v0, v0 clamp | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <2 x half> %src0 to <2 x float> | %src0.ext = fpext <2 x half> %src0 to <2 x float> | ||||
%src1.ext = fpext <2 x half> %src1 to <2 x float> | %src1.ext = fpext <2 x half> %src1 to <2 x float> | ||||
%src2.ext = fpext <2 x half> %src2 to <2 x float> | %src2.ext = fpext <2 x half> %src2 to <2 x float> | ||||
%result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | %result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | ||||
%cvt.result = fptrunc <2 x float> %result to <2 x half> | %cvt.result = fptrunc <2 x float> %result to <2 x half> | ||||
%max = call <2 x half> @llvm.maxnum.v2f16(<2 x half> %cvt.result, <2 x half> zeroinitializer) | %max = call <2 x half> @llvm.maxnum.v2f16(<2 x half> %cvt.result, <2 x half> zeroinitializer) | ||||
%clamp = call <2 x half> @llvm.minnum.v2f16(<2 x half> %max, <2 x half> <half 1.0, half 1.0>) | %clamp = call <2 x half> @llvm.minnum.v2f16(<2 x half> %max, <2 x half> <half 1.0, half 1.0>) | ||||
ret <2 x half> %clamp | ret <2 x half> %clamp | ||||
} | } | ||||
; FIXME: Should be packed into 2 registers per argument? | ; FIXME (DAG): Should be packed into 2 registers per argument? | ||||
; GCN-LABEL: {{^}}v_mad_mix_v3f32_clamp_postcvt: | |||||
; GCN: s_waitcnt | |||||
; GFX900-DAG: v_mad_mixlo_f16 v{{[0-9]+}}, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-DAG: v_mad_mixhi_f16 v{{[0-9]+}}, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-DAG: v_mad_mixlo_f16 v{{[0-9]+}}, v1, v3, v5 op_sel_hi:[1,1,1] | |||||
; GFX906-DAG: v_fma_mixlo_f16 v{{[0-9]+}}, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX906-DAG: v_fma_mixhi_f16 v{{[0-9]+}}, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906-DAG: v_fma_mixlo_f16 v{{[0-9]+}}, v1, v3, v5 op_sel_hi:[1,1,1] | |||||
; GFX9-DAG: v_pk_max_f16 v1, v1, v1 clamp | |||||
; GFX9: v_mov_b32_e32 v0, v{{[0-9]+}} | |||||
; GFX9-NEXT: s_setpc_b64 | |||||
define <3 x half> @v_mad_mix_v3f32_clamp_postcvt(<3 x half> %src0, <3 x half> %src1, <3 x half> %src2) #0 { | define <3 x half> @v_mad_mix_v3f32_clamp_postcvt(<3 x half> %src0, <3 x half> %src1, <3 x half> %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mix_v3f32_clamp_postcvt: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v1, v1, v3, v5 op_sel_hi:[1,1,1] | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_pack_b32_f16 v1, v1, 0 | |||||
; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_pk_max_f16 v1, v1, v1 clamp | |||||
; GFX906-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mix_v3f32_clamp_postcvt: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v1, v1, v3, v5 op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_pack_b32_f16 v1, v1, 0 | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_pk_max_f16 v1, v1, v1 clamp | |||||
; GFX900-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v3f32_clamp_postcvt: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v7, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v8, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; VI-NEXT: v_mac_f32_e32 v8, v6, v7 | |||||
; VI-NEXT: v_mac_f32_e32 v4, v0, v2 | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v0, v8 clamp dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_mac_f32_e32 v5, v1, v3 | |||||
; VI-NEXT: v_cvt_f16_f32_e64 v2, v4 clamp | |||||
; VI-NEXT: v_cvt_f16_f32_e64 v1, v5 clamp | |||||
; VI-NEXT: v_or_b32_e32 v0, v2, v0 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v3f32_clamp_postcvt: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_mac_f32_e32 v8, v2, v5 | |||||
; CI-NEXT: v_mac_f32_e32 v6, v0, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v8 | |||||
; CI-NEXT: v_mac_f32_e32 v7, v1, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v2, v0 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v7 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v1, v0 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v6 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v0, v0 clamp | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <3 x half> %src0 to <3 x float> | %src0.ext = fpext <3 x half> %src0 to <3 x float> | ||||
%src1.ext = fpext <3 x half> %src1 to <3 x float> | %src1.ext = fpext <3 x half> %src1 to <3 x float> | ||||
%src2.ext = fpext <3 x half> %src2 to <3 x float> | %src2.ext = fpext <3 x half> %src2 to <3 x float> | ||||
%result = tail call <3 x float> @llvm.fmuladd.v3f32(<3 x float> %src0.ext, <3 x float> %src1.ext, <3 x float> %src2.ext) | %result = tail call <3 x float> @llvm.fmuladd.v3f32(<3 x float> %src0.ext, <3 x float> %src1.ext, <3 x float> %src2.ext) | ||||
%cvt.result = fptrunc <3 x float> %result to <3 x half> | %cvt.result = fptrunc <3 x float> %result to <3 x half> | ||||
%max = call <3 x half> @llvm.maxnum.v3f16(<3 x half> %cvt.result, <3 x half> zeroinitializer) | %max = call <3 x half> @llvm.maxnum.v3f16(<3 x half> %cvt.result, <3 x half> zeroinitializer) | ||||
%clamp = call <3 x half> @llvm.minnum.v3f16(<3 x half> %max, <3 x half> <half 1.0, half 1.0, half 1.0>) | %clamp = call <3 x half> @llvm.minnum.v3f16(<3 x half> %max, <3 x half> <half 1.0, half 1.0, half 1.0>) | ||||
ret <3 x half> %clamp | ret <3 x half> %clamp | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mix_v4f32_clamp_postcvt: | define <4 x half> @v_mad_mix_v4f32_clamp_postcvt(<4 x half> %src0, <4 x half> %src1, <4 x half> %src2) #0 { | ||||
; GCN: s_waitcnt | ; GFX906-LABEL: v_mad_mix_v4f32_clamp_postcvt: | ||||
; GFX900-NEXT: v_mad_mixlo_f16 v6, v0, v2, v4 op_sel_hi:[1,1,1] clamp | ; GFX906: ; %bb.0: | ||||
; GFX900-NEXT: v_mad_mixhi_f16 v6, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||||
; GFX900-NEXT: v_mad_mixlo_f16 v2, v1, v3, v5 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v2, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_fma_mixlo_f16 v6, v0, v2, v4 op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mixlo_f16 v6, v0, v2, v4 op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_fma_mixhi_f16 v6, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mixhi_f16 v6, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_fma_mixlo_f16 v2, v1, v3, v5 op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mixlo_f16 v2, v1, v3, v5 op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_fma_mixhi_f16 v2, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mixhi_f16 v2, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_mov_b32_e32 v0, v6 | |||||
; GFX906-NEXT: v_mov_b32_e32 v1, v2 | |||||
; GFX9-NEXT: v_mov_b32_e32 v0, v6 | ; GFX906-NEXT: s_setpc_b64 s[30:31] | ||||
; GFX9-NEXT: v_mov_b32_e32 v1, v2 | ; | ||||
; GFX9-NEXT: s_setpc_b64 | ; GFX900-LABEL: v_mad_mix_v4f32_clamp_postcvt: | ||||
define <4 x half> @v_mad_mix_v4f32_clamp_postcvt(<4 x half> %src0, <4 x half> %src1, <4 x half> %src2) #0 { | ; GFX900: ; %bb.0: | ||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v6, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v6, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v2, v1, v3, v5 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v2, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mov_b32_e32 v0, v6 | |||||
; GFX900-NEXT: v_mov_b32_e32 v1, v2 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v4f32_clamp_postcvt: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v7, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v8, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v9, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v10, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v11, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; VI-NEXT: v_mac_f32_e32 v10, v6, v8 | |||||
; VI-NEXT: v_mac_f32_e32 v11, v7, v9 | |||||
; VI-NEXT: v_mac_f32_e32 v4, v0, v2 | |||||
; VI-NEXT: v_mac_f32_e32 v5, v1, v3 | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v0, v10 clamp dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v1, v11 clamp dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_e64 v2, v4 clamp | |||||
; VI-NEXT: v_cvt_f16_f32_e64 v3, v5 clamp | |||||
; VI-NEXT: v_or_b32_e32 v0, v2, v0 | |||||
; VI-NEXT: v_or_b32_e32 v1, v3, v1 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v4f32_clamp_postcvt: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v11, v11 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v11, v11 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v10, v10 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v10, v10 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v9, v9 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_mac_f32_e32 v11, v3, v7 | |||||
; CI-NEXT: v_mac_f32_e32 v8, v0, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v11 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v9, v9 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_mac_f32_e32 v10, v2, v6 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v3, v0 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v10 | |||||
; CI-NEXT: v_mac_f32_e32 v9, v1, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v2, v0 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v9 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v1, v0 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v8 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v0, v0 clamp | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <4 x half> %src0 to <4 x float> | %src0.ext = fpext <4 x half> %src0 to <4 x float> | ||||
%src1.ext = fpext <4 x half> %src1 to <4 x float> | %src1.ext = fpext <4 x half> %src1 to <4 x float> | ||||
%src2.ext = fpext <4 x half> %src2 to <4 x float> | %src2.ext = fpext <4 x half> %src2 to <4 x float> | ||||
%result = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %src0.ext, <4 x float> %src1.ext, <4 x float> %src2.ext) | %result = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %src0.ext, <4 x float> %src1.ext, <4 x float> %src2.ext) | ||||
%cvt.result = fptrunc <4 x float> %result to <4 x half> | %cvt.result = fptrunc <4 x float> %result to <4 x half> | ||||
%max = call <4 x half> @llvm.maxnum.v4f16(<4 x half> %cvt.result, <4 x half> zeroinitializer) | %max = call <4 x half> @llvm.maxnum.v4f16(<4 x half> %cvt.result, <4 x half> zeroinitializer) | ||||
%clamp = call <4 x half> @llvm.minnum.v4f16(<4 x half> %max, <4 x half> <half 1.0, half 1.0, half 1.0, half 1.0>) | %clamp = call <4 x half> @llvm.minnum.v4f16(<4 x half> %max, <4 x half> <half 1.0, half 1.0, half 1.0, half 1.0>) | ||||
ret <4 x half> %clamp | ret <4 x half> %clamp | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mix_v2f32_clamp_postcvt_lo: | define <2 x half> @v_mad_mix_v2f32_clamp_postcvt_lo(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | ||||
; GCN: s_waitcnt | ; GFX906-LABEL: v_mad_mix_v2f32_clamp_postcvt_lo: | ||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] clamp | ; GFX906: ; %bb.0: | ||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||||
; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX9-NEXT: v_mov_b32_e32 v0, v3 | ; GFX906-NEXT: s_setpc_b64 s[30:31] | ||||
; GFX9-NEXT: s_setpc_b64 | ; | ||||
define <2 x half> @v_mad_mix_v2f32_clamp_postcvt_lo(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | ; GFX900-LABEL: v_mad_mix_v2f32_clamp_postcvt_lo: | ||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v2f32_clamp_postcvt_lo: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v3, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_mac_f32_e32 v5, v3, v4 | |||||
; VI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v0, v5 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_e64 v1, v2 clamp | |||||
; VI-NEXT: v_or_b32_e32 v0, v1, v0 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v2f32_clamp_postcvt_lo: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_mac_f32_e32 v5, v1, v3 | |||||
; CI-NEXT: v_mac_f32_e32 v4, v0, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v0 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v0, v0 clamp | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <2 x half> %src0 to <2 x float> | %src0.ext = fpext <2 x half> %src0 to <2 x float> | ||||
%src1.ext = fpext <2 x half> %src1 to <2 x float> | %src1.ext = fpext <2 x half> %src1 to <2 x float> | ||||
%src2.ext = fpext <2 x half> %src2 to <2 x float> | %src2.ext = fpext <2 x half> %src2 to <2 x float> | ||||
%result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | %result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | ||||
%cvt.result = fptrunc <2 x float> %result to <2 x half> | %cvt.result = fptrunc <2 x float> %result to <2 x half> | ||||
%cvt.lo = extractelement <2 x half> %cvt.result, i32 0 | %cvt.lo = extractelement <2 x half> %cvt.result, i32 0 | ||||
%max.lo = call half @llvm.maxnum.f16(half %cvt.lo, half 0.0) | %max.lo = call half @llvm.maxnum.f16(half %cvt.lo, half 0.0) | ||||
%clamp.lo = call half @llvm.minnum.f16(half %max.lo, half 1.0) | %clamp.lo = call half @llvm.minnum.f16(half %max.lo, half 1.0) | ||||
%insert = insertelement <2 x half> %cvt.result, half %clamp.lo, i32 0 | %insert = insertelement <2 x half> %cvt.result, half %clamp.lo, i32 0 | ||||
ret <2 x half> %insert | ret <2 x half> %insert | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mix_v2f32_clamp_postcvt_hi: | define <2 x half> @v_mad_mix_v2f32_clamp_postcvt_hi(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | ||||
; GCN: s_waitcnt | ; GFX906-LABEL: v_mad_mix_v2f32_clamp_postcvt_hi: | ||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] | ; GFX906: ; %bb.0: | ||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | ||||
; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] | ; GFX906-NEXT: v_fma_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] | ||||
; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX9-NEXT: v_mov_b32_e32 v0, v3 | ; GFX906-NEXT: s_setpc_b64 s[30:31] | ||||
; GFX9-NEXT: s_setpc_b64 | ; | ||||
define <2 x half> @v_mad_mix_v2f32_clamp_postcvt_hi(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | ; GFX900-LABEL: v_mad_mix_v2f32_clamp_postcvt_hi: | ||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mixlo_f16 v3, v0, v1, v2 op_sel_hi:[1,1,1] | |||||
; GFX900-NEXT: v_mad_mixhi_f16 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mov_b32_e32 v0, v3 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v2f32_clamp_postcvt_hi: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v3, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_mac_f32_e32 v5, v3, v4 | |||||
; VI-NEXT: v_mac_f32_e32 v2, v0, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v0, v5 clamp dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v1, v2 | |||||
; VI-NEXT: v_or_b32_e32 v0, v1, v0 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v2f32_clamp_postcvt_hi: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_mac_f32_e32 v4, v0, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v4 | |||||
; CI-NEXT: v_mac_f32_e32 v5, v1, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e64 v1, v1 clamp | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <2 x half> %src0 to <2 x float> | %src0.ext = fpext <2 x half> %src0 to <2 x float> | ||||
%src1.ext = fpext <2 x half> %src1 to <2 x float> | %src1.ext = fpext <2 x half> %src1 to <2 x float> | ||||
%src2.ext = fpext <2 x half> %src2 to <2 x float> | %src2.ext = fpext <2 x half> %src2 to <2 x float> | ||||
%result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | %result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | ||||
%cvt.result = fptrunc <2 x float> %result to <2 x half> | %cvt.result = fptrunc <2 x float> %result to <2 x half> | ||||
%cvt.hi = extractelement <2 x half> %cvt.result, i32 1 | %cvt.hi = extractelement <2 x half> %cvt.result, i32 1 | ||||
%max.hi = call half @llvm.maxnum.f16(half %cvt.hi, half 0.0) | %max.hi = call half @llvm.maxnum.f16(half %cvt.hi, half 0.0) | ||||
%clamp.hi = call half @llvm.minnum.f16(half %max.hi, half 1.0) | %clamp.hi = call half @llvm.minnum.f16(half %max.hi, half 1.0) | ||||
%insert = insertelement <2 x half> %cvt.result, half %clamp.hi, i32 1 | %insert = insertelement <2 x half> %cvt.result, half %clamp.hi, i32 1 | ||||
ret <2 x half> %insert | ret <2 x half> %insert | ||||
} | } | ||||
; FIXME: Should be able to use mixlo/mixhi | ; FIXME (DAG): Should be able to use mixlo/mixhi | ||||
; GCN-LABEL: {{^}}v_mad_mix_v2f32_clamp_precvt: | |||||
; GFX900: v_mad_mix_f32 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v0, v0, v1, v2 op_sel_hi:[1,1,1] clamp | |||||
; GFX906: v_fma_mix_f32 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_fma_mix_f32 v0, v0, v1, v2 op_sel_hi:[1,1,1] clamp | |||||
; GFX9: v_cvt_f16_f32_e32 v1, v3 | |||||
; GFX9: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX9: v_pack_b32_f16 v0, v0, v1 | |||||
; GFX9: s_setpc_b64 | |||||
define <2 x half> @v_mad_mix_v2f32_clamp_precvt(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | define <2 x half> @v_mad_mix_v2f32_clamp_precvt(<2 x half> %src0, <2 x half> %src1, <2 x half> %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mix_v2f32_clamp_precvt: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mix_f32 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_fma_mix_f32 v0, v0, v1, v2 op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v1, v3 | |||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX906-NEXT: v_pack_b32_f16 v0, v0, v1 | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mix_v2f32_clamp_precvt: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mix_f32 v3, v0, v1, v2 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v0, v0, v1, v2 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v1, v3 | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX900-NEXT: v_pack_b32_f16 v0, v0, v1 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v2f32_clamp_precvt: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v3, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v4, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v5, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_mad_f32 v3, v3, v4, v5 clamp | |||||
; VI-NEXT: v_mad_f32 v0, v0, v1, v2 clamp | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v1, v3 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; VI-NEXT: v_or_b32_e32 v0, v0, v1 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v2f32_clamp_precvt: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_mad_f32 v1, v1, v3, v5 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_mad_f32 v0, v0, v2, v4 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <2 x half> %src0 to <2 x float> | %src0.ext = fpext <2 x half> %src0 to <2 x float> | ||||
%src1.ext = fpext <2 x half> %src1 to <2 x float> | %src1.ext = fpext <2 x half> %src1 to <2 x float> | ||||
%src2.ext = fpext <2 x half> %src2 to <2 x float> | %src2.ext = fpext <2 x half> %src2 to <2 x float> | ||||
%result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | %result = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %src0.ext, <2 x float> %src1.ext, <2 x float> %src2.ext) | ||||
%max = call <2 x float> @llvm.maxnum.v2f32(<2 x float> %result, <2 x float> zeroinitializer) | %max = call <2 x float> @llvm.maxnum.v2f32(<2 x float> %result, <2 x float> zeroinitializer) | ||||
%clamp = call <2 x float> @llvm.minnum.v2f32(<2 x float> %max, <2 x float> <float 1.0, float 1.0>) | %clamp = call <2 x float> @llvm.minnum.v2f32(<2 x float> %max, <2 x float> <float 1.0, float 1.0>) | ||||
%cvt.result = fptrunc <2 x float> %clamp to <2 x half> | %cvt.result = fptrunc <2 x float> %clamp to <2 x half> | ||||
ret <2 x half> %cvt.result | ret <2 x half> %cvt.result | ||||
} | } | ||||
; FIXME: Handling undef 4th component | ; FIXME (DAG): Handling undef 4th component | ||||
; GCN-LABEL: {{^}}v_mad_mix_v3f32_clamp_precvt: | |||||
; GCN: s_waitcnt | |||||
; GFX900-NEXT: v_mad_mix_f32 v1, v1, v3, v5 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v0, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
define <3 x half> @v_mad_mix_v3f32_clamp_precvt(<3 x half> %src0, <3 x half> %src1, <3 x half> %src2) #0 { | |||||
; GFX906-LABEL: v_mad_mix_v3f32_clamp_precvt: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mix_f32 v1, v1, v3, v5 op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mix_f32 v1, v1, v3, v5 op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_fma_mix_f32 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mix_f32 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_fma_mix_f32 v0, v0, v2, v4 op_sel_hi:[1,1,1] clamp | ; GFX906-NEXT: v_fma_mix_f32 v0, v0, v2, v4 op_sel_hi:[1,1,1] clamp | ||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v2, v3 | |||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX9-NEXT: v_cvt_f16_f32_e32 v2, v3 | ; GFX906-NEXT: v_cvt_f16_f32_e32 v1, v1 | ||||
; GFX9-NEXT: v_cvt_f16_f32_e32 v0, v0 | ; GFX906-NEXT: v_pack_b32_f16 v0, v0, v2 | ||||
; GFX9-NEXT: v_cvt_f16_f32_e32 v1, v1 | ; GFX906-NEXT: s_setpc_b64 s[30:31] | ||||
; GFX9-NEXT: v_pack_b32_f16 v0, v0, v2 | ; | ||||
; GFX9-NEXT: s_setpc_b64 | ; GFX900-LABEL: v_mad_mix_v3f32_clamp_precvt: | ||||
define <3 x half> @v_mad_mix_v3f32_clamp_precvt(<3 x half> %src0, <3 x half> %src1, <3 x half> %src2) #0 { | ; GFX900: ; %bb.0: | ||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mix_f32 v1, v1, v3, v5 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v0, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v2, v3 | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; GFX900-NEXT: v_pack_b32_f16 v0, v0, v2 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v3f32_clamp_precvt: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v7, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v8, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; VI-NEXT: v_mad_f32 v6, v6, v7, v8 clamp | |||||
; VI-NEXT: v_mad_f32 v0, v0, v2, v4 clamp | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v2, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_mad_f32 v1, v1, v3, v5 clamp | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; VI-NEXT: v_or_b32_e32 v0, v0, v2 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v3f32_clamp_precvt: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_mad_f32 v1, v1, v4, v7 clamp | |||||
; CI-NEXT: v_mad_f32 v2, v2, v5, v8 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_mad_f32 v0, v0, v3, v6 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <3 x half> %src0 to <3 x float> | %src0.ext = fpext <3 x half> %src0 to <3 x float> | ||||
%src1.ext = fpext <3 x half> %src1 to <3 x float> | %src1.ext = fpext <3 x half> %src1 to <3 x float> | ||||
%src2.ext = fpext <3 x half> %src2 to <3 x float> | %src2.ext = fpext <3 x half> %src2 to <3 x float> | ||||
%result = tail call <3 x float> @llvm.fmuladd.v3f32(<3 x float> %src0.ext, <3 x float> %src1.ext, <3 x float> %src2.ext) | %result = tail call <3 x float> @llvm.fmuladd.v3f32(<3 x float> %src0.ext, <3 x float> %src1.ext, <3 x float> %src2.ext) | ||||
%max = call <3 x float> @llvm.maxnum.v3f32(<3 x float> %result, <3 x float> zeroinitializer) | %max = call <3 x float> @llvm.maxnum.v3f32(<3 x float> %result, <3 x float> zeroinitializer) | ||||
%clamp = call <3 x float> @llvm.minnum.v3f32(<3 x float> %max, <3 x float> <float 1.0, float 1.0, float 1.0>) | %clamp = call <3 x float> @llvm.minnum.v3f32(<3 x float> %max, <3 x float> <float 1.0, float 1.0, float 1.0>) | ||||
%cvt.result = fptrunc <3 x float> %clamp to <3 x half> | %cvt.result = fptrunc <3 x float> %clamp to <3 x half> | ||||
ret <3 x half> %cvt.result | ret <3 x half> %cvt.result | ||||
} | } | ||||
; GCN-LABEL: {{^}}v_mad_mix_v4f32_clamp_precvt: | |||||
; GFX900: v_mad_mix_f32 v6, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900: v_mad_mix_f32 v1, v1, v3, v5 op_sel_hi:[1,1,1] clamp | |||||
; GFX900: v_mad_mix_f32 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900: v_mad_mix_f32 v0, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX906: v_fma_mix_f32 v6, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906: v_fma_mix_f32 v1, v1, v3, v5 op_sel_hi:[1,1,1] clamp | |||||
; GFX906: v_fma_mix_f32 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906: v_fma_mix_f32 v0, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX9: v_cvt_f16_f32 | |||||
; GFX9: v_cvt_f16_f32 | |||||
; GFX9: v_cvt_f16_f32 | |||||
; GFX9: v_cvt_f16_f32 | |||||
define <4 x half> @v_mad_mix_v4f32_clamp_precvt(<4 x half> %src0, <4 x half> %src1, <4 x half> %src2) #0 { | define <4 x half> @v_mad_mix_v4f32_clamp_precvt(<4 x half> %src0, <4 x half> %src1, <4 x half> %src2) #0 { | ||||
; GFX906-LABEL: v_mad_mix_v4f32_clamp_precvt: | |||||
; GFX906: ; %bb.0: | |||||
; GFX906-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX906-NEXT: v_fma_mix_f32 v6, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_fma_mix_f32 v1, v1, v3, v5 op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_fma_mix_f32 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_fma_mix_f32 v0, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v2, v6 | |||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; GFX906-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX906-NEXT: v_pack_b32_f16 v1, v1, v2 | |||||
; GFX906-NEXT: v_pack_b32_f16 v0, v0, v3 | |||||
; GFX906-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; GFX900-LABEL: v_mad_mix_v4f32_clamp_precvt: | |||||
; GFX900: ; %bb.0: | |||||
; GFX900-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; GFX900-NEXT: v_mad_mix_f32 v6, v1, v3, v5 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v1, v1, v3, v5 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v3, v0, v2, v4 op_sel:[1,1,1] op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_mad_mix_f32 v0, v0, v2, v4 op_sel_hi:[1,1,1] clamp | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v2, v6 | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; GFX900-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; GFX900-NEXT: v_pack_b32_f16 v1, v1, v2 | |||||
; GFX900-NEXT: v_pack_b32_f16 v0, v0, v3 | |||||
; GFX900-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; VI-LABEL: v_mad_mix_v4f32_clamp_precvt: | |||||
; VI: ; %bb.0: | |||||
; VI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v6, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v7, v1 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v8, v2 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v9, v3 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v10, v4 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_sdwa v11, v5 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; VI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; VI-NEXT: v_mad_f32 v6, v6, v8, v10 clamp | |||||
; VI-NEXT: v_mad_f32 v7, v7, v9, v11 clamp | |||||
; VI-NEXT: v_mad_f32 v0, v0, v2, v4 clamp | |||||
; VI-NEXT: v_mad_f32 v1, v1, v3, v5 clamp | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v2, v7 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_sdwa v3, v6 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; VI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; VI-NEXT: v_or_b32_e32 v1, v1, v2 | |||||
; VI-NEXT: v_or_b32_e32 v0, v0, v3 | |||||
; VI-NEXT: s_setpc_b64 s[30:31] | |||||
; | |||||
; CI-LABEL: v_mad_mix_v4f32_clamp_precvt: | |||||
; CI: ; %bb.0: | |||||
; CI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v11, v11 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v10, v10 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v9, v9 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v11, v11 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v7, v7 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v10, v10 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v6, v6 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v9, v9 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v5, v5 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v8, v8 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v4, v4 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_mad_f32 v1, v1, v5, v9 clamp | |||||
; CI-NEXT: v_mad_f32 v2, v2, v6, v10 clamp | |||||
; CI-NEXT: v_mad_f32 v3, v3, v7, v11 clamp | |||||
; CI-NEXT: v_mad_f32 v0, v0, v4, v8 clamp | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f16_f32_e32 v3, v3 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v0, v0 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v1, v1 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v2, v2 | |||||
; CI-NEXT: v_cvt_f32_f16_e32 v3, v3 | |||||
; CI-NEXT: s_setpc_b64 s[30:31] | |||||
%src0.ext = fpext <4 x half> %src0 to <4 x float> | %src0.ext = fpext <4 x half> %src0 to <4 x float> | ||||
%src1.ext = fpext <4 x half> %src1 to <4 x float> | %src1.ext = fpext <4 x half> %src1 to <4 x float> | ||||
%src2.ext = fpext <4 x half> %src2 to <4 x float> | %src2.ext = fpext <4 x half> %src2 to <4 x float> | ||||
%result = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %src0.ext, <4 x float> %src1.ext, <4 x float> %src2.ext) | %result = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %src0.ext, <4 x float> %src1.ext, <4 x float> %src2.ext) | ||||
%max = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %result, <4 x float> zeroinitializer) | %max = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %result, <4 x float> zeroinitializer) | ||||
%clamp = call <4 x float> @llvm.minnum.v4f32(<4 x float> %max, <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>) | %clamp = call <4 x float> @llvm.minnum.v4f32(<4 x float> %max, <4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>) | ||||
%cvt.result = fptrunc <4 x float> %clamp to <4 x half> | %cvt.result = fptrunc <4 x float> %clamp to <4 x half> | ||||
ret <4 x half> %cvt.result | ret <4 x half> %cvt.result | ||||
Show All 29 Lines |