Skip to content

Commit be8b559

Browse files
committed
[AMDGPU] Test codegen'ing True16 additions.
The GlobalISel part is to be addressed later. Differential Revision: https://reviews.llvm.org/D156106
1 parent 296671f commit be8b559

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

llvm/test/CodeGen/AMDGPU/fadd.f16.ll

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
22
; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=SI %s
33
; RUN: llc -march=amdgcn -mcpu=fiji -mattr=-flat-for-global -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=VI %s
4-
; RUN: llc -march=amdgcn -mcpu=gfx1100 -mattr=-flat-for-global -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=GFX11 %s
4+
; RUN: llc -march=amdgcn -mcpu=gfx1100 -mattr=+real-true16,-flat-for-global -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=GFX11 %s
55
; RUN: llc -march=amdgcn -mcpu=gfx1100 -mattr=-flat-for-global -verify-machineinstrs -enable-misched=false < %s | FileCheck -check-prefixes=GFX11-FAKE16 %s
66

77
define amdgpu_kernel void @fadd_f16(
@@ -74,7 +74,9 @@ define amdgpu_kernel void @fadd_f16(
7474
; GFX11-NEXT: s_waitcnt vmcnt(0)
7575
; GFX11-NEXT: buffer_load_u16 v1, off, s[0:3], 0 glc dlc
7676
; GFX11-NEXT: s_waitcnt vmcnt(0)
77-
; GFX11-NEXT: v_add_f16_e32 v0, v0, v1
77+
; GFX11-NEXT: v_mov_b16_e32 v0.h, v1.l
78+
; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
79+
; GFX11-NEXT: v_add_f16_e32 v0.l, v0.l, v0.h
7880
; GFX11-NEXT: buffer_store_b16 v0, off, s[8:11], 0
7981
; GFX11-NEXT: s_nop 0
8082
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
@@ -169,7 +171,9 @@ define amdgpu_kernel void @fadd_f16_imm_a(
169171
; GFX11-NEXT: s_mov_b32 s3, s7
170172
; GFX11-NEXT: buffer_load_u16 v0, off, s[0:3], 0
171173
; GFX11-NEXT: s_waitcnt vmcnt(0)
172-
; GFX11-NEXT: v_add_f16_e32 v0, 1.0, v0
174+
; GFX11-NEXT: v_mov_b16_e32 v0.h, 0x3c00
175+
; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
176+
; GFX11-NEXT: v_add_f16_e32 v0.l, v0.l, v0.h
173177
; GFX11-NEXT: buffer_store_b16 v0, off, s[4:7], 0
174178
; GFX11-NEXT: s_nop 0
175179
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)
@@ -256,7 +260,9 @@ define amdgpu_kernel void @fadd_f16_imm_b(
256260
; GFX11-NEXT: s_mov_b32 s3, s7
257261
; GFX11-NEXT: buffer_load_u16 v0, off, s[0:3], 0
258262
; GFX11-NEXT: s_waitcnt vmcnt(0)
259-
; GFX11-NEXT: v_add_f16_e32 v0, 2.0, v0
263+
; GFX11-NEXT: v_mov_b16_e32 v0.h, 0x4000
264+
; GFX11-NEXT: s_delay_alu instid0(VALU_DEP_1)
265+
; GFX11-NEXT: v_add_f16_e32 v0.l, v0.l, v0.h
260266
; GFX11-NEXT: buffer_store_b16 v0, off, s[4:7], 0
261267
; GFX11-NEXT: s_nop 0
262268
; GFX11-NEXT: s_sendmsg sendmsg(MSG_DEALLOC_VGPRS)

0 commit comments

Comments
 (0)