1 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,SI %s
2 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=fiji -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,VI,GFX89 %s
3 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=gfx900 -mattr=-flat-for-global -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9,GFX89 %s
4 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=gfx1100 -mattr=-flat-for-global,+real-true16 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX11-TRUE16 %s
5 ; RUN: llc -amdgpu-scalarize-global-loads=false -mtriple=amdgcn -mcpu=gfx1100 -mattr=-flat-for-global,-real-true16 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX11-FAKE16 %s
7 ; GCN-LABEL: {{^}}v_mul_i16:
8 ; SI: v_and_b32_e32 v{{[0-9]+}}, 0xffff, v{{[0-9]+}}
9 ; SI: v_and_b32_e32 v{{[0-9]+}}, 0xffff, v{{[0-9]+}}
12 ; GFX89: v_mul_lo_u16_e32 v0, v0, v1
14 ; GFX11-TRUE16: v_mul_lo_u16 v0.l, v0.l, v0.h
15 ; GFX11-FAKE16: v_mul_lo_u16 v0, v0, v1
16 define i16 @v_mul_i16(i16 %a, i16 %b) {
17 %r.val = mul i16 %a, %b
21 ; GCN-LABEL: {{^}}s_mul_i16:
23 define amdgpu_kernel void @s_mul_i16(i16 %a, i16 %b) {
24 %r.val = mul i16 %a, %b
25 store volatile i16 %r.val, ptr addrspace(1) null
29 ; FIXME: Should emit u16 mul here.
30 ; GCN-LABEL: {{^}}v_mul_i16_uniform_load:
32 define amdgpu_kernel void @v_mul_i16_uniform_load(
35 ptr addrspace(1) %b) {
37 %a.val = load i16, ptr addrspace(1) %a
38 %b.val = load i16, ptr addrspace(1) %b
39 %r.val = mul i16 %a.val, %b.val
40 store i16 %r.val, ptr addrspace(1) %r
44 ; GCN-LABEL: {{^}}v_mul_v2i16:
48 ; VI: v_mul_lo_u16_sdwa
49 ; VI: v_mul_lo_u16_e32
54 ; GFX9-NEXT: v_pk_mul_lo_u16 v0, v0, v1
55 ; GFX9-NEXT: s_setpc_b64
56 define <2 x i16> @v_mul_v2i16(<2 x i16> %a, <2 x i16> %b) {
57 %r.val = mul <2 x i16> %a, %b
61 ; FIXME: Unpack garbage on gfx9
62 ; GCN-LABEL: {{^}}v_mul_v3i16:
72 ; GFX9-NEXT: v_pk_mul_lo_u16
73 ; GFX9-NEXT: v_pk_mul_lo_u16
74 ; GFX9-NEXT: s_setpc_b64
75 define <3 x i16> @v_mul_v3i16(<3 x i16> %a, <3 x i16> %b) {
76 %r.val = mul <3 x i16> %a, %b
80 ; GCN-LABEL: {{^}}v_mul_v4i16:
86 ; VI: v_mul_lo_u16_sdwa
87 ; VI: v_mul_lo_u16_sdwa
88 ; VI: v_mul_lo_u16_e32
89 ; VI: v_mul_lo_u16_e32
94 ; GFX9-NEXT: v_pk_mul_lo_u16 v0, v0, v2
95 ; GFX9-NEXT: v_pk_mul_lo_u16 v1, v1, v3
96 ; GFX9-NEXT: s_setpc_b64
97 define <4 x i16> @v_mul_v4i16(<4 x i16> %a, <4 x i16> %b) {
98 %r.val = mul <4 x i16> %a, %b