blob: 0896a540d09d0b0e72883e713c343beec6c90d3e [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 -mattr=-real-true16 %s -o - | FileCheck -check-prefixes=GCN,FAKE16 %s
; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1250 -mattr=+real-true16 %s -o - | FileCheck -check-prefixes=GCN,REAL16 %s
define float @test_canonicalize_amdgcn_tanh_f32(float %a) {
; GCN-LABEL: test_canonicalize_amdgcn_tanh_f32:
; GCN: ; %bb.0:
; GCN-NEXT: s_wait_loadcnt_dscnt 0x0
; GCN-NEXT: s_wait_kmcnt 0x0
; GCN-NEXT: v_tanh_f32_e32 v0, v0
; GCN-NEXT: s_set_pc_i64 s[30:31]
%tanh = call float @llvm.amdgcn.tanh.f32(float %a)
%canonicalized = call float @llvm.canonicalize.f32(float %tanh)
ret float %canonicalized
}
define bfloat @test_canonicalize_amdgcn_tanh_bf16(bfloat %a) {
; FAKE16-LABEL: test_canonicalize_amdgcn_tanh_bf16:
; FAKE16: ; %bb.0:
; FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; FAKE16-NEXT: s_wait_kmcnt 0x0
; FAKE16-NEXT: v_tanh_bf16_e32 v0, v0
; FAKE16-NEXT: v_nop
; FAKE16-NEXT: s_delay_alu instid0(TRANS32_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
; FAKE16-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; FAKE16-NEXT: v_max_num_f32_e32 v0, v0, v0
; FAKE16-NEXT: s_delay_alu instid0(VALU_DEP_1)
; FAKE16-NEXT: v_cvt_pk_bf16_f32 v0, v0, s0
; FAKE16-NEXT: s_set_pc_i64 s[30:31]
;
; REAL16-LABEL: test_canonicalize_amdgcn_tanh_bf16:
; REAL16: ; %bb.0:
; REAL16-NEXT: s_wait_loadcnt_dscnt 0x0
; REAL16-NEXT: s_wait_kmcnt 0x0
; REAL16-NEXT: v_tanh_bf16_e32 v0.l, v0.l
; REAL16-NEXT: v_nop
; REAL16-NEXT: s_delay_alu instid0(TRANS32_DEP_1) | instskip(NEXT) | instid1(VALU_DEP_1)
; REAL16-NEXT: v_lshlrev_b32_e32 v0, 16, v0
; REAL16-NEXT: v_max_num_f32_e32 v0, v0, v0
; REAL16-NEXT: s_delay_alu instid0(VALU_DEP_1)
; REAL16-NEXT: v_cvt_pk_bf16_f32 v0, v0, s0
; REAL16-NEXT: s_set_pc_i64 s[30:31]
%tanh = call bfloat @llvm.amdgcn.tanh.bf16(bfloat %a)
%canonicalized = call bfloat @llvm.canonicalize.bf16(bfloat %tanh)
ret bfloat %canonicalized
}
define half @test_canonicalize_amdgcn_tanh_f16(half %a) {
; FAKE16-LABEL: test_canonicalize_amdgcn_tanh_f16:
; FAKE16: ; %bb.0:
; FAKE16-NEXT: s_wait_loadcnt_dscnt 0x0
; FAKE16-NEXT: s_wait_kmcnt 0x0
; FAKE16-NEXT: v_tanh_f16_e32 v0, v0
; FAKE16-NEXT: s_set_pc_i64 s[30:31]
;
; REAL16-LABEL: test_canonicalize_amdgcn_tanh_f16:
; REAL16: ; %bb.0:
; REAL16-NEXT: s_wait_loadcnt_dscnt 0x0
; REAL16-NEXT: s_wait_kmcnt 0x0
; REAL16-NEXT: v_tanh_f16_e32 v0.l, v0.l
; REAL16-NEXT: s_set_pc_i64 s[30:31]
%tanh = call half @llvm.amdgcn.tanh.f16(half %a)
%canonicalized = call half @llvm.canonicalize.f16(half %tanh)
ret half %canonicalized
}