CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
451 lines
22 KiB
LLVM
451 lines
22 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -mtriple=amdgcn -mcpu=gfx1170 < %s | FileCheck %s --check-prefixes=GCN,GFX1170
|
|
; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -mattr=+real-true16 < %s | FileCheck %s --check-prefixes=GCN,GFX12
|
|
; RUN: llc -mtriple=amdgcn -mcpu=gfx1200 -mattr=-real-true16 < %s | FileCheck %s --check-prefixes=GCN,GFX12
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_f16_negA(<8 x half> %A, <8 x half> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_f16_negA:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_f16 v[8:15], v[0:3], v[4:7], v[8:15] neg_lo:[1,0,0] neg_hi:[1,0,0]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[12:15], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.A = fneg <8 x half> %A
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v8f16(<8 x half> %fneg.A, <8 x half> %B, <8 x float> %C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_f16_negB(<8 x half> %A, <8 x half> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_f16_negB:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_f16 v[8:15], v[0:3], v[4:7], v[8:15] neg_lo:[0,1,0] neg_hi:[0,1,0]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[12:15], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.B = fneg <8 x half> %B
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v8f16(<8 x half> %A, <8 x half> %fneg.B, <8 x float> %C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_f16_negC(<8 x half> %A, <8 x half> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_f16_negC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_f16 v[8:15], v[0:3], v[4:7], v[8:15] neg_lo:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[12:15], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.C = fneg <8 x float> %C
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v8f16(<8 x half> %A, <8 x half> %B, <8 x float> %fneg.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_f16_absC(<8 x half> %A, <8 x half> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_f16_absC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_f16 v[8:15], v[0:3], v[4:7], v[8:15] neg_hi:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[12:15], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x float> @llvm.fabs.v8f32(<8 x float> %C)
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v8f16(<8 x half> %A, <8 x half> %B, <8 x float> %fabs.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_bf16_negC(<8 x i16> %A, <8 x i16> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_bf16_negC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_bf16 v[8:15], v[0:3], v[4:7], v[8:15] neg_lo:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[12:15], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.C = fneg <8 x float> %C
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v8f32.v8i16(<8 x i16> %A, <8 x i16> %B, <8 x float> %fneg.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_bf16_absC(<8 x i16> %A, <8 x i16> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_bf16_absC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_bf16 v[8:15], v[0:3], v[4:7], v[8:15] neg_hi:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[12:15], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x float> @llvm.fabs.v8f32(<8 x float> %C)
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v8f32.v8i16(<8 x i16> %A, <8 x i16> %B, <8 x float> %fabs.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f16_16x16x16_f16_negA(<8 x half> %A, <8 x half> %B, <8 x half> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f16_16x16x16_f16_negA:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f16_16x16x16_f16 v[8:11], v[0:3], v[4:7], v[8:11] neg_lo:[1,0,0] neg_hi:[1,0,0]
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.A = fneg <8 x half> %A
|
|
%res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v8f16.v8f16(<8 x half> %fneg.A, <8 x half> %B, <8 x half> %C, i1 0)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f16_16x16x16_f16_negB(<8 x half> %A, <8 x half> %B, <8 x half> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f16_16x16x16_f16_negB:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f16_16x16x16_f16 v[8:11], v[0:3], v[4:7], v[8:11] neg_lo:[0,1,0] neg_hi:[0,1,0]
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.B = fneg <8 x half> %B
|
|
%res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v8f16.v8f16(<8 x half> %A, <8 x half> %fneg.B, <8 x half> %C, i1 0)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f16_16x16x16_f16_negC(<8 x half> %A, <8 x half> %B, <8 x half> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f16_16x16x16_f16_negC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f16_16x16x16_f16 v[8:11], v[0:3], v[4:7], v[8:11] neg_lo:[0,0,1]
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.C = fneg <8 x half> %C
|
|
%res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v8f16.v8f16(<8 x half> %A, <8 x half> %B, <8 x half> %fneg.C, i1 0)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f16_16x16x16_f16_absC(<8 x half> %A, <8 x half> %B, <8 x half> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f16_16x16x16_f16_absC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f16_16x16x16_f16 v[8:11], v[0:3], v[4:7], v[8:11] neg_hi:[0,0,1]
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x half> @llvm.fabs.v8f16(<8 x half> %C)
|
|
%res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v8f16.v8f16(<8 x half> %A, <8 x half> %B, <8 x half> %fabs.C, i1 0)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_fp8_fp8_negC(<2 x i32> %A, <2 x i32> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_fp8_fp8_negC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_fp8_fp8 v[4:11], v[0:1], v[2:3], v[4:11] neg_lo:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[4:7], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.C = fneg <8 x float> %C
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.fp8.fp8.v8f32.v2i32(<2 x i32> %A, <2 x i32> %B, <8 x float> %fneg.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_fp8_fp8_absC(<2 x i32> %A, <2 x i32> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_fp8_fp8_absC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_fp8_fp8 v[4:11], v[0:1], v[2:3], v[4:11] neg_hi:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[4:7], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x float> @llvm.fabs.v8f32(<8 x float> %C)
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.fp8.fp8.v8f32.v2i32(<2 x i32> %A, <2 x i32> %B, <8 x float> %fabs.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_bf8_fp8_negC(<2 x i32> %A, <2 x i32> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_bf8_fp8_negC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_bf8_fp8 v[4:11], v[0:1], v[2:3], v[4:11] neg_lo:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[4:7], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.C = fneg <8 x float> %C
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf8.fp8.v8f32.v2i32(<2 x i32> %A, <2 x i32> %B, <8 x float> %fneg.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_bf8_fp8_absC(<2 x i32> %A, <2 x i32> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_bf8_fp8_absC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_bf8_fp8 v[4:11], v[0:1], v[2:3], v[4:11] neg_hi:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[4:7], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x float> @llvm.fabs.v8f32(<8 x float> %C)
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf8.fp8.v8f32.v2i32(<2 x i32> %A, <2 x i32> %B, <8 x float> %fabs.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_fp8_bf8_negC(<2 x i32> %A, <2 x i32> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_fp8_bf8_negC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_fp8_bf8 v[4:11], v[0:1], v[2:3], v[4:11] neg_lo:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[4:7], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.C = fneg <8 x float> %C
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.fp8.bf8.v8f32.v2i32(<2 x i32> %A, <2 x i32> %B, <8 x float> %fneg.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_fp8_bf8_absC(<2 x i32> %A, <2 x i32> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_fp8_bf8_absC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_fp8_bf8 v[4:11], v[0:1], v[2:3], v[4:11] neg_hi:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[4:7], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x float> @llvm.fabs.v8f32(<8 x float> %C)
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.fp8.bf8.v8f32.v2i32(<2 x i32> %A, <2 x i32> %B, <8 x float> %fabs.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_bf8_bf8_negC(<2 x i32> %A, <2 x i32> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_bf8_bf8_negC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_bf8_bf8 v[4:11], v[0:1], v[2:3], v[4:11] neg_lo:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[4:7], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.C = fneg <8 x float> %C
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf8.bf8.v8f32.v2i32(<2 x i32> %A, <2 x i32> %B, <8 x float> %fneg.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_bf8_bf8_absC(<2 x i32> %A, <2 x i32> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_bf8_bf8_absC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_bf8_bf8 v[4:11], v[0:1], v[2:3], v[4:11] neg_hi:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[4:7], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x float> @llvm.fabs.v8f32(<8 x float> %C)
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf8.bf8.v8f32.v2i32(<2 x i32> %A, <2 x i32> %B, <8 x float> %fabs.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_swmmac_f32_16x16x32_f16_negA(<8 x half> %A, <16 x half> %B, <8 x float> %C, i16 %Index, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_swmmac_f32_16x16x32_f16_negA:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_swmmac_f32_16x16x32_f16 v[12:19], v[0:3], v[4:11], v20 neg_lo:[1,0,0] neg_hi:[1,0,0]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[21:22], v[16:19], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[21:22], v[12:15], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.A = fneg <8 x half> %A
|
|
%res = call <8 x float> @llvm.amdgcn.swmmac.f32.16x16x32.f16.v8f32.v8f16.v16f16.i16(<8 x half> %fneg.A, <16 x half> %B, <8 x float> %C, i16 %Index)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_swmmac_f32_16x16x32_f16_negB(<8 x half> %A, <16 x half> %B, <8 x float> %C, i16 %Index, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_swmmac_f32_16x16x32_f16_negB:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_swmmac_f32_16x16x32_f16 v[12:19], v[0:3], v[4:11], v20 neg_lo:[0,1,0] neg_hi:[0,1,0]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[21:22], v[16:19], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[21:22], v[12:15], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.B = fneg <16 x half> %B
|
|
%res = call <8 x float> @llvm.amdgcn.swmmac.f32.16x16x32.f16.v8f32.v8f16.v16f16.i16(<8 x half> %A, <16 x half> %fneg.B, <8 x float> %C, i16 %Index)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_swmmac_f16_16x16x32_f16_negA(<8 x half> %A, <16 x half> %B, <8 x half> %C, i16 %Index, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_swmmac_f16_16x16x32_f16_negA:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_swmmac_f16_16x16x32_f16 v[12:15], v[0:3], v[4:11], v16 neg_lo:[1,0,0] neg_hi:[1,0,0]
|
|
; GCN-NEXT: global_store_b128 v[17:18], v[12:15], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.A = fneg <8 x half> %A
|
|
%res = call <8 x half> @llvm.amdgcn.swmmac.f16.16x16x32.f16.v8f16.v8f16.v16f16.i16(<8 x half> %fneg.A, <16 x half> %B, <8 x half> %C, i16 %Index)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_swmmac_f16_16x16x32_f16_negB(<8 x half> %A, <16 x half> %B, <8 x half> %C, i16 %Index, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_swmmac_f16_16x16x32_f16_negB:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_swmmac_f16_16x16x32_f16 v[12:15], v[0:3], v[4:11], v16 neg_lo:[0,1,0] neg_hi:[0,1,0]
|
|
; GCN-NEXT: global_store_b128 v[17:18], v[12:15], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.B = fneg <16 x half> %B
|
|
%res = call <8 x half> @llvm.amdgcn.swmmac.f16.16x16x32.f16.v8f16.v8f16.v16f16.i16(<8 x half> %A, <16 x half> %fneg.B, <8 x half> %C, i16 %Index)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; both neg and abs patterns (wmma matrix C f32 or f16 )
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_f16_negabsC(<8 x half> %A, <8 x half> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_f16_negabsC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_f16 v[8:15], v[0:3], v[4:7], v[8:15] neg_lo:[0,0,1] neg_hi:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[12:15], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x float> @llvm.fabs.v8f32(<8 x float> %C)
|
|
%fneg.fabs.C = fneg <8 x float> %fabs.C
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v8f16(<8 x half> %A, <8 x half> %B, <8 x float> %fneg.fabs.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f16_16x16x16_f16_negabsC(<8 x half> %A, <8 x half> %B, <8 x half> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f16_16x16x16_f16_negabsC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f16_16x16x16_f16 v[8:11], v[0:3], v[4:7], v[8:11] neg_lo:[0,0,1] neg_hi:[0,0,1]
|
|
; GCN-NEXT: global_store_b128 v[12:13], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fabs.C = call <8 x half> @llvm.fabs.v8f16(<8 x half> %C)
|
|
%fneg.fabs.C = fneg <8 x half> %fabs.C
|
|
%res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v8f16.v8f16(<8 x half> %A, <8 x half> %B, <8 x half> %fneg.fabs.C, i1 0)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_f16_neg_partial_fabsA(<8 x half> %A, <8 x half> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_f16_neg_partial_fabsA:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_and_b32_e32 v11, 0x7fffffff, v11
|
|
; GCN-NEXT: s_delay_alu instid0(VALU_DEP_1)
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_f16 v[8:15], v[0:3], v[4:7], v[8:15] neg_lo:[0,0,1]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[12:15], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[16:17], v[8:11], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%el3 = extractelement <8 x float> %C, i32 3
|
|
%el3.fabs = call float @llvm.fabs.f32(float %el3)
|
|
%partial.fabs.C = insertelement <8 x float> %C, float %el3.fabs, i32 3
|
|
%fneg.partial.fabs.C = fneg <8 x float> %partial.fabs.C
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v8f16(<8 x half> %A, <8 x half> %B, <8 x float> %fneg.partial.fabs.C)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; A or B matrix modifier and constant in C
|
|
|
|
define amdgpu_ps void @test_wmma_f32_16x16x16_f16_negA_constantC(<8 x half> %A, <8 x half> %B, <8 x float> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f32_16x16x16_f16_negA_constantC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f32_16x16x16_f16 v[10:17], v[0:3], v[4:7], 1.0 neg_lo:[1,0,0] neg_hi:[1,0,0]
|
|
; GCN-NEXT: s_clause 0x1
|
|
; GCN-NEXT: global_store_b128 v[8:9], v[14:17], off offset:16
|
|
; GCN-NEXT: global_store_b128 v[8:9], v[10:13], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.A = fneg <8 x half> %A
|
|
%res = call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v8f16(<8 x half> %fneg.A, <8 x half> %B, <8 x float> <float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0>)
|
|
store <8 x float> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
define amdgpu_ps void @test_wmma_f16_16x16x16_f16_negB_constantC(<8 x half> %A, <8 x half> %B, <8 x half> %C, ptr addrspace(1) %out) {
|
|
; GCN-LABEL: test_wmma_f16_16x16x16_f16_negB_constantC:
|
|
; GCN: ; %bb.0: ; %bb
|
|
; GCN-NEXT: v_wmma_f16_16x16x16_f16 v[10:13], v[0:3], v[4:7], 1.0 neg_lo:[0,1,0] neg_hi:[0,1,0]
|
|
; GCN-NEXT: global_store_b128 v[8:9], v[10:13], off
|
|
; GCN-NEXT: s_endpgm
|
|
bb:
|
|
%fneg.B = fneg <8 x half> %B
|
|
%res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v8f16.v8f16(<8 x half> %A, <8 x half> %fneg.B, <8 x half> <half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0, half 1.0>, i1 0)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
; pack f16 elements with v_perm_b32 since they don't come from same b32
|
|
|
|
define amdgpu_ps void @test_wmma_f16_16x16x16_f16_negC_pack(<8 x half> %A, <8 x half> %B, ptr %Caddr, ptr addrspace(1) %out) {
|
|
; GFX1170-LABEL: test_wmma_f16_16x16x16_f16_negC_pack:
|
|
; GFX1170: ; %bb.0: ; %bb
|
|
; GFX1170-NEXT: s_clause 0x1
|
|
; GFX1170-NEXT: flat_load_b128 v[12:15], v[8:9]
|
|
; GFX1170-NEXT: flat_load_b128 v[16:19], v[8:9] offset:16
|
|
; GFX1170-NEXT: s_waitcnt vmcnt(1) lgkmcnt(1)
|
|
; GFX1170-NEXT: v_mov_b16_e32 v14.h, v15.l
|
|
; GFX1170-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
|
|
; GFX1170-NEXT: v_mov_b16_e32 v16.h, v17.l
|
|
; GFX1170-NEXT: v_mov_b16_e32 v18.h, v19.l
|
|
; GFX1170-NEXT: v_mov_b16_e32 v12.h, v13.l
|
|
; GFX1170-NEXT: s_delay_alu instid0(VALU_DEP_3) | instskip(NEXT) | instid1(VALU_DEP_3)
|
|
; GFX1170-NEXT: v_dual_mov_b32 v13, v14 :: v_dual_mov_b32 v14, v16
|
|
; GFX1170-NEXT: v_mov_b32_e32 v15, v18
|
|
; GFX1170-NEXT: s_delay_alu instid0(VALU_DEP_1)
|
|
; GFX1170-NEXT: v_wmma_f16_16x16x16_f16 v[12:15], v[0:3], v[4:7], v[12:15] neg_lo:[0,0,1]
|
|
; GFX1170-NEXT: global_store_b128 v[10:11], v[12:15], off
|
|
; GFX1170-NEXT: s_endpgm
|
|
bb:
|
|
%C = load <16 x half>, ptr %Caddr
|
|
%C_shuffle = shufflevector <16 x half> %C, <16 x half> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
|
|
%fneg.C_shuffle = fneg <8 x half> %C_shuffle
|
|
%res = call <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v8f16.v8f16(<8 x half> %A, <8 x half> %B, <8 x half> %fneg.C_shuffle , i1 0)
|
|
store <8 x half> %res, ptr addrspace(1) %out
|
|
ret void
|
|
}
|
|
|
|
declare <8 x half> @llvm.fabs.v8f16(<8 x half>)
|
|
declare <8 x float> @llvm.fabs.v8f32(<8 x float>)
|
|
declare float @llvm.fabs.f32(float)
|
|
|
|
declare <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v8f16(<8 x half>, <8 x half>, <8 x float>)
|
|
declare <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v8f32.v8i16(<8 x i16>, <8 x i16>, <8 x float>)
|
|
declare <8 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v8f16.v8f16(<8 x half>, <8 x half>, <8 x half>, i1 immarg)
|
|
declare <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.fp8.fp8.v8f32.v2i32(<2 x i32>, <2 x i32>, <8 x float>)
|
|
declare <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.fp8.bf8.v8f32.v2i32(<2 x i32>, <2 x i32>, <8 x float>)
|
|
declare <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf8.fp8.v8f32.v2i32(<2 x i32>, <2 x i32>, <8 x float>)
|
|
declare <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf8.bf8.v8f32.v2i32(<2 x i32>, <2 x i32>, <8 x float>)
|
|
declare <8 x float> @llvm.amdgcn.swmmac.f32.16x16x32.f16.v8f32.v8f16.v16f16.i16(<8 x half>, <16 x half>, <8 x float>, i16)
|
|
declare <8 x half> @llvm.amdgcn.swmmac.f16.16x16x32.f16.v8f16.v8f16.v16f16.i16(<8 x half>, <16 x half>, <8 x half>, i16)
|
|
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
|
|
; GFX12: {{.*}}
|