|
| 1 | +; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 -mattr=+real-true16 -verify-machineinstrs < %s 2>&1 | FileCheck -enable-var-scope -check-prefixes=GFX11 %s |
| 2 | + |
| 3 | +; GFX11-LABEL: {{^}}s_input_output_i16: |
| 4 | +; GFX11: s_mov_b32 s[[REG:[0-9]+]], -1 |
| 5 | +; GFX11: ; use s[[REG]] |
| 6 | +define amdgpu_kernel void @s_input_output_i16() #0 { |
| 7 | + %v = tail call i16 asm sideeffect "s_mov_b32 $0, -1", "=s"() |
| 8 | + tail call void asm sideeffect "; use $0", "s"(i16 %v) #0 |
| 9 | + ret void |
| 10 | +} |
| 11 | + |
| 12 | +; GFX11-LABEL: {{^}}s_input_output_f16: |
| 13 | +; GFX11: s_mov_b32 s[[REG:[0-9]+]], -1 |
| 14 | +; GFX11: ; use s[[REG]] |
| 15 | +define amdgpu_kernel void @s_input_output_f16() #0 { |
| 16 | + %v = tail call half asm sideeffect "s_mov_b32 $0, -1", "=s"() #0 |
| 17 | + tail call void asm sideeffect "; use $0", "s"(half %v) |
| 18 | + ret void |
| 19 | +} |
| 20 | + |
| 21 | +; GFX11-LABEL: {{^}}v_input_output_f16: |
| 22 | +; GFX11: v_mov_b16 v[[REG:[0-9]+.(l|h)]], -1 |
| 23 | +; GFX11: ; use v[[REG]] |
| 24 | +define amdgpu_kernel void @v_input_output_f16() #0 { |
| 25 | + %v = tail call half asm sideeffect "v_mov_b16 $0, -1", "=v"() #0 |
| 26 | + tail call void asm sideeffect "; use $0", "v"(half %v) |
| 27 | + ret void |
| 28 | +} |
| 29 | + |
| 30 | +; GFX11-LABEL: {{^}}v_input_output_i16: |
| 31 | +; GFX11: v_mov_b16 v[[REG:[0-9]+.(l|h)]], -1 |
| 32 | +; GFX11: ; use v[[REG]] |
| 33 | +define amdgpu_kernel void @v_input_output_i16() #0 { |
| 34 | + %v = tail call i16 asm sideeffect "v_mov_b16 $0, -1", "=v"() #0 |
| 35 | + tail call void asm sideeffect "; use $0", "v"(i16 %v) |
| 36 | + ret void |
| 37 | +} |
| 38 | + |
| 39 | +; GFX11-LABEL: {{^}}i16_imm_input_phys_vgpr_lo: |
| 40 | +; GFX11: v_mov_b16_e32 v0.l, -1 |
| 41 | +; GFX11: ; use v0.l |
| 42 | +define amdgpu_kernel void @i16_imm_input_phys_vgpr_lo() { |
| 43 | +entry: |
| 44 | + call void asm sideeffect "; use $0 ", "{v0.l}"(i16 65535) |
| 45 | + ret void |
| 46 | +} |
| 47 | + |
| 48 | +; GFX11-LABEL: {{^}}i16_imm_input_phys_vgpr_hi: |
| 49 | +; GFX11: v_mov_b16_e32 v0.h, -1 |
| 50 | +; GFX11: ; use v0.h |
| 51 | +define amdgpu_kernel void @i16_imm_input_phys_vgpr_hi() { |
| 52 | +entry: |
| 53 | + call void asm sideeffect "; use $0 ", "{v0.h}"(i16 65535) |
| 54 | + ret void |
| 55 | +} |
| 56 | + |
| 57 | +attributes #0 = { nounwind } |
0 commit comments