blob: 07627ced5bbf8f5ba05c16a667970c54764246ad [file] [edit]
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
; RUN: llc -mtriple=amdgpu12.50 -mattr=+real-true16 < %s | FileCheck --check-prefixes=GFX1250,GFX1250-REAL16 %s
; RUN: llc -mtriple=amdgpu12.50 -mattr=-real-true16 < %s | FileCheck --check-prefixes=GFX1250,GFX1250-FAKE16 %s
define bfloat @scalar_add_inline_const(bfloat %x) {
; GFX1250-LABEL: scalar_add_inline_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, v0, 1.0 op_sel:[0,1]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fadd bfloat %x, 1.0
ret bfloat %r
}
define bfloat @scalar_mul_inline_const(bfloat %x) {
; GFX1250-LABEL: scalar_mul_inline_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_mul_bf16 v0, v0, 0.5 op_sel:[0,1]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fmul bfloat %x, 0.5
ret bfloat %r
}
define bfloat @scalar_sub_inline_const(bfloat %x) {
; GFX1250-LABEL: scalar_sub_inline_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, v0, -1.0 op_sel:[0,1]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fsub bfloat %x, 1.0
ret bfloat %r
}
define bfloat @scalar_rsub_inline_const(bfloat %x) {
; GFX1250-LABEL: scalar_rsub_inline_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, v0, 1.0 op_sel:[0,1] neg_lo:[1,0] neg_hi:[1,0]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fsub bfloat 1.0, %x
ret bfloat %r
}
define bfloat @scalar_fma_inline_const(bfloat %x, bfloat %y) {
; GFX1250-LABEL: scalar_fma_inline_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_fma_bf16 v0, v0, v1, 2.0 op_sel:[0,0,1]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = call bfloat @llvm.fma.bf16(bfloat %x, bfloat %y, bfloat 2.0)
ret bfloat %r
}
define bfloat @scalar_max_inline_const(bfloat %x) {
; GFX1250-LABEL: scalar_max_inline_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_max_num_bf16 v0, v0, 4.0 op_sel:[0,1]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = call bfloat @llvm.maxnum.bf16(bfloat %x, bfloat 4.0)
ret bfloat %r
}
define bfloat @scalar_min_inline_const(bfloat %x) {
; GFX1250-LABEL: scalar_min_inline_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_min_num_bf16 v0, v0, -4.0 op_sel:[0,1]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = call bfloat @llvm.minnum.bf16(bfloat %x, bfloat -4.0)
ret bfloat %r
}
define bfloat @scalar_add_non_inlineable_const(bfloat %x) {
; GFX1250-LABEL: scalar_add_non_inlineable_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, v0, 0x42c8
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fadd bfloat %x, 100.0
ret bfloat %r
}
define bfloat @scalar_mul_non_inlineable_const(bfloat %x) {
; GFX1250-LABEL: scalar_mul_non_inlineable_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_mul_bf16 v0, v0, 0x4348
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fmul bfloat %x, 200.0
ret bfloat %r
}
define bfloat @scalar_sub_non_inlineable_const(bfloat %x) {
; GFX1250-LABEL: scalar_sub_non_inlineable_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, v0, 0xc2c8
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fsub bfloat %x, 100.0
ret bfloat %r
}
define bfloat @scalar_rsub_non_inlineable_const(bfloat %x) {
; GFX1250-LABEL: scalar_rsub_non_inlineable_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, 0x4348, v0 neg_lo:[0,1] neg_hi:[0,1]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fsub bfloat 200.0, %x
ret bfloat %r
}
define bfloat @scalar_fma_non_inlineable_const(bfloat %x, bfloat %y) {
; GFX1250-LABEL: scalar_fma_non_inlineable_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_fma_bf16 v0, v0, v1, 0x42c8
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = call bfloat @llvm.fma.bf16(bfloat %x, bfloat %y, bfloat 100.0)
ret bfloat %r
}
define bfloat @scalar_max_non_inlineable_const(bfloat %x) {
; GFX1250-LABEL: scalar_max_non_inlineable_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_max_num_bf16 v0, v0, 0x4348
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = call bfloat @llvm.maxnum.bf16(bfloat %x, bfloat 200.0)
ret bfloat %r
}
define bfloat @scalar_min_non_inlineable_const(bfloat %x) {
; GFX1250-LABEL: scalar_min_non_inlineable_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_min_num_bf16 v0, v0, 0x42c8
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = call bfloat @llvm.minnum.bf16(bfloat %x, bfloat 100.0)
ret bfloat %r
}
define <2 x bfloat> @packed_add_inline_const(<2 x bfloat> %x) {
; GFX1250-LABEL: packed_add_inline_const:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, v0, 1.0 op_sel:[0,1]
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fadd <2 x bfloat> %x, <bfloat 1.0, bfloat 1.0>
ret <2 x bfloat> %r
}
define <2 x bfloat> @packed_add_non_splat_0(<2 x bfloat> %x) {
; GFX1250-LABEL: packed_add_non_splat_0:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, v0, 1.0
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fadd <2 x bfloat> %x, <bfloat 1.0, bfloat 0.0>
ret <2 x bfloat> %r
}
define <2 x bfloat> @packed_add_non_splat_1(<2 x bfloat> %x) {
; GFX1250-LABEL: packed_add_non_splat_1:
; GFX1250: ; %bb.0:
; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0
; GFX1250-NEXT: s_wait_kmcnt 0x0
; GFX1250-NEXT: v_pk_add_bf16 v0, v0, 0x3f800000
; GFX1250-NEXT: s_set_pc_i64 s[30:31]
%r = fadd <2 x bfloat> %x, <bfloat 0.0, bfloat 1.0>
ret <2 x bfloat> %r
}
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; GFX1250-FAKE16: {{.*}}
; GFX1250-REAL16: {{.*}}