|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 < %s | FileCheck -enable-var-scope -check-prefixes=GFX11 %s |
| 3 | + |
| 4 | +define amdgpu_kernel void @s_input_output_i16() #0 { |
| 5 | +; GFX11-LABEL: s_input_output_i16: |
| 6 | +; GFX11: ; %bb.0: |
| 7 | +; GFX11-NEXT: ;;#ASMSTART |
| 8 | +; GFX11-NEXT: s_mov_b32 s0, -1 |
| 9 | +; GFX11-NEXT: ;;#ASMEND |
| 10 | +; GFX11-NEXT: s_and_b32 s0, s0, 0xffff |
| 11 | +; GFX11-NEXT: ;;#ASMSTART |
| 12 | +; GFX11-NEXT: ; use s0 |
| 13 | +; GFX11-NEXT: ;;#ASMEND |
| 14 | +; GFX11-NEXT: s_endpgm |
| 15 | + %v = tail call i16 asm sideeffect "s_mov_b32 $0, -1", "=s"() |
| 16 | + tail call void asm sideeffect "; use $0", "s"(i16 %v) #0 |
| 17 | + ret void |
| 18 | +} |
| 19 | + |
| 20 | +define amdgpu_kernel void @s_input_output_f16() #0 { |
| 21 | +; GFX11-LABEL: s_input_output_f16: |
| 22 | +; GFX11: ; %bb.0: |
| 23 | +; GFX11-NEXT: ;;#ASMSTART |
| 24 | +; GFX11-NEXT: s_mov_b32 s0, -1 |
| 25 | +; GFX11-NEXT: ;;#ASMEND |
| 26 | +; GFX11-NEXT: ;;#ASMSTART |
| 27 | +; GFX11-NEXT: ; use s0 |
| 28 | +; GFX11-NEXT: ;;#ASMEND |
| 29 | +; GFX11-NEXT: s_endpgm |
| 30 | + %v = tail call half asm sideeffect "s_mov_b32 $0, -1", "=s"() #0 |
| 31 | + tail call void asm sideeffect "; use $0", "s"(half %v) |
| 32 | + ret void |
| 33 | +} |
| 34 | + |
| 35 | +define amdgpu_kernel void @v_input_output_f16() #0 { |
| 36 | +; GFX11-LABEL: v_input_output_f16: |
| 37 | +; GFX11: ; %bb.0: |
| 38 | +; GFX11-NEXT: ;;#ASMSTART |
| 39 | +; GFX11-NEXT: v_mov_b16 v0.l, -1 |
| 40 | +; GFX11-NEXT: ;;#ASMEND |
| 41 | +; GFX11-NEXT: ;;#ASMSTART |
| 42 | +; GFX11-NEXT: ; use v0.l |
| 43 | +; GFX11-NEXT: ;;#ASMEND |
| 44 | +; GFX11-NEXT: s_endpgm |
| 45 | + %v = tail call half asm sideeffect "v_mov_b16 $0, -1", "=v"() #0 |
| 46 | + tail call void asm sideeffect "; use $0", "v"(half %v) |
| 47 | + ret void |
| 48 | +} |
| 49 | + |
| 50 | +define amdgpu_kernel void @v_input_output_i16() #0 { |
| 51 | +; GFX11-LABEL: v_input_output_i16: |
| 52 | +; GFX11: ; %bb.0: |
| 53 | +; GFX11-NEXT: ;;#ASMSTART |
| 54 | +; GFX11-NEXT: v_mov_b16 v0.l, -1 |
| 55 | +; GFX11-NEXT: ;;#ASMEND |
| 56 | +; GFX11-NEXT: ;;#ASMSTART |
| 57 | +; GFX11-NEXT: ; use v0.l |
| 58 | +; GFX11-NEXT: ;;#ASMEND |
| 59 | +; GFX11-NEXT: s_endpgm |
| 60 | + %v = tail call i16 asm sideeffect "v_mov_b16 $0, -1", "=v"() #0 |
| 61 | + tail call void asm sideeffect "; use $0", "v"(i16 %v) |
| 62 | + ret void |
| 63 | +} |
| 64 | + |
| 65 | +define amdgpu_kernel void @i16_imm_input_phys_vgpr_lo() { |
| 66 | +; GFX11-LABEL: i16_imm_input_phys_vgpr_lo: |
| 67 | +; GFX11: ; %bb.0: ; %entry |
| 68 | +; GFX11-NEXT: v_mov_b16_e32 v0.l, -1 |
| 69 | +; GFX11-NEXT: ;;#ASMSTART |
| 70 | +; GFX11-NEXT: ; use v0.l |
| 71 | +; GFX11-NEXT: ;;#ASMEND |
| 72 | +; GFX11-NEXT: s_endpgm |
| 73 | +entry: |
| 74 | + call void asm sideeffect "; use $0 ", "{v0.l}"(i16 65535) |
| 75 | + ret void |
| 76 | +} |
| 77 | + |
| 78 | +define amdgpu_kernel void @i16_imm_input_phys_vgpr_hi() { |
| 79 | +; GFX11-LABEL: i16_imm_input_phys_vgpr_hi: |
| 80 | +; GFX11: ; %bb.0: ; %entry |
| 81 | +; GFX11-NEXT: v_mov_b16_e32 v0.h, -1 |
| 82 | +; GFX11-NEXT: ;;#ASMSTART |
| 83 | +; GFX11-NEXT: ; use v0.h |
| 84 | +; GFX11-NEXT: ;;#ASMEND |
| 85 | +; GFX11-NEXT: s_endpgm |
| 86 | +entry: |
| 87 | + call void asm sideeffect "; use $0 ", "{v0.h}"(i16 65535) |
| 88 | + ret void |
| 89 | +} |
| 90 | + |
| 91 | +attributes #0 = { nounwind } |
0 commit comments