[AMDGPU] Check for immediate SrcC in mfma in AsmParser
[llvm-core.git] / test / MC / AMDGPU / expressions-gfx9.s
blobb1be72b019afecffa7246a33694dd4741a896d0e
1 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck %s --check-prefix=GFX9
2 // RUN: not llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=NOGFX9
4 //===----------------------------------------------------------------------===//
5 // Relocatable expressions cannot be used with SDWA modifiers.
6 //===----------------------------------------------------------------------===//
8 v_mov_b32_sdwa v1, sext(u)
9 // NOGFX9: error: expected an absolute expression
11 //===----------------------------------------------------------------------===//
12 // Constant expressions may be used with 'sext' modifier
13 //===----------------------------------------------------------------------===//
15 i1=1
17 v_mov_b32_sdwa v1, sext(i1-2)
18 // 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]
20 v_mov_b32_sdwa v1, sext(-2+i1)
21 // 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]
23 //===----------------------------------------------------------------------===//
24 // Constant expressions may be used with op_sel* and neg_* modifiers.
25 //===----------------------------------------------------------------------===//
27 v_pk_add_u16 v1, v2, v3 op_sel:[2-i1,i1-1]
28 // GFX9: v_pk_add_u16 v1, v2, v3 op_sel:[1,0] ; encoding: [0x01,0x08,0x8a,0xd3,0x02,0x07,0x02,0x18]
30 v_pk_add_u16 v1, v2, v3 neg_lo:[2-i1,i1-1]
31 // GFX9: v_pk_add_u16 v1, v2, v3 neg_lo:[1,0] ; encoding: [0x01,0x00,0x8a,0xd3,0x02,0x07,0x02,0x38]