49 lines · plain
1// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GFX92// RUN: not llvm-mc -triple=amdgcn -mcpu=gfx900 %s 2>&1 | FileCheck %s --check-prefix=NOGFX9 --implicit-check-not=error:3 4//===----------------------------------------------------------------------===//5// Relocatable expressions cannot be used with SDWA modifiers.6//===----------------------------------------------------------------------===//7 8v_mov_b32_sdwa v1, sext(u)9// NOGFX9: :[[@LINE-1]]:{{[0-9]+}}: error: expected an absolute expression10 11//===----------------------------------------------------------------------===//12// Instructions can use only one literal.13// Relocatable expressions are counted as literals.14//===----------------------------------------------------------------------===//15 16s_sub_u32 s0, 123, u17// NOGFX9: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed18 19s_sub_u32 s0, u, u20// NOGFX9: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed21 22s_sub_u32 s0, u, u123// NOGFX9: :[[@LINE-1]]:{{[0-9]+}}: error: only one unique literal operand is allowed24 25v_bfe_u32 v0, v2, v3, u26// NOGFX9: :[[@LINE-1]]:{{[0-9]+}}: error: literal operands are not supported27 28//===----------------------------------------------------------------------===//29// Constant expressions may be used with 'sext' modifier30//===----------------------------------------------------------------------===//31 32i1=133 34v_mov_b32_sdwa v1, sext(i1-2)35// GFX9: v_mov_b32_sdwa v1, sext(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x7e,0xc1,0x16,0x8e,0x00]36 37v_mov_b32_sdwa v1, sext(-2+i1)38// GFX9: v_mov_b32_sdwa v1, sext(-1) dst_sel:DWORD dst_unused:UNUSED_PRESERVE src0_sel:DWORD ; encoding: [0xf9,0x02,0x02,0x7e,0xc1,0x16,0x8e,0x00]39 40//===----------------------------------------------------------------------===//41// Constant expressions may be used with op_sel* and neg_* modifiers.42//===----------------------------------------------------------------------===//43 44v_pk_add_u16 v1, v2, v3 op_sel:[2-i1,i1-1]45// GFX9: v_pk_add_u16 v1, v2, v3 op_sel:[1,0] ; encoding: [0x01,0x48,0x8a,0xd3,0x02,0x07,0x02,0x18]46 47v_pk_add_u16 v1, v2, v3 neg_lo:[2-i1,i1-1]48// GFX9: v_pk_add_u16 v1, v2, v3 neg_lo:[1,0] ; encoding: [0x01,0x40,0x8a,0xd3,0x02,0x07,0x02,0x38]49