Home | History | Annotate | Download | only in AMDGPU
      1 // RUN: not llvm-mc -arch=amdgcn -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SI  %s
      2 // RUN: not llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=SI %s
      3 // RUN: llvm-mc -arch=amdgcn -mcpu=bonaire -show-encoding %s | FileCheck --check-prefix=GCN --check-prefix=CI %s
      4 
      5 // RUN: not llvm-mc -arch=amdgcn %s 2>&1 | FileCheck %s --check-prefix=NOSI
      6 // RUN: not llvm-mc -arch=amdgcn -mcpu=SI  %s 2>&1 | FileCheck %s --check-prefix=NOSI
      7 //===----------------------------------------------------------------------===//
      8 // Offset Handling
      9 //===----------------------------------------------------------------------===//
     10 
     11 s_load_dword s1, s[2:3], 0xfc
     12 // GCN: s_load_dword s1, s[2:3], 0xfc ; encoding: [0xfc,0x83,0x00,0xc0]
     13 
     14 s_load_dword s1, s[2:3], 0xff
     15 // GCN: s_load_dword s1, s[2:3], 0xff ; encoding: [0xff,0x83,0x00,0xc0]
     16 
     17 s_load_dword s1, s[2:3], 0x100
     18 // NOSI: error: instruction not supported on this GPU
     19 // CI: s_load_dword s1, s[2:3], 0x100 ; encoding: [0xff,0x82,0x00,0xc0,0x00,0x01,0x00,0x00]
     20 
     21 //===----------------------------------------------------------------------===//
     22 // Instructions
     23 //===----------------------------------------------------------------------===//
     24 
     25 s_load_dword s1, s[2:3], 1
     26 // GCN: s_load_dword s1, s[2:3], 0x1 ; encoding: [0x01,0x83,0x00,0xc0]
     27 
     28 s_load_dword s1, s[2:3], s4
     29 // GCN: s_load_dword s1, s[2:3], s4 ; encoding: [0x04,0x82,0x00,0xc0]
     30 
     31 s_load_dwordx2 s[2:3], s[2:3], 1
     32 // GCN: s_load_dwordx2 s[2:3], s[2:3], 0x1 ; encoding: [0x01,0x03,0x41,0xc0]
     33 
     34 s_load_dwordx2 s[2:3], s[2:3], s4
     35 // GCN: s_load_dwordx2 s[2:3], s[2:3], s4 ; encoding: [0x04,0x02,0x41,0xc0]
     36 
     37 s_load_dwordx4 s[4:7], s[2:3], 1
     38 // GCN: s_load_dwordx4 s[4:7], s[2:3], 0x1 ; encoding: [0x01,0x03,0x82,0xc0]
     39 
     40 s_load_dwordx4 s[4:7], s[2:3], s4
     41 // GCN: s_load_dwordx4 s[4:7], s[2:3], s4 ; encoding: [0x04,0x02,0x82,0xc0]
     42 
     43 s_load_dwordx4 s[100:103], s[2:3], s4
     44 // GCN: s_load_dwordx4 s[100:103], s[2:3], s4 ; encoding: [0x04,0x02,0xb2,0xc0]
     45 
     46 s_load_dwordx8 s[8:15], s[2:3], 1
     47 // GCN: s_load_dwordx8 s[8:15], s[2:3], 0x1 ; encoding: [0x01,0x03,0xc4,0xc0]
     48 
     49 s_load_dwordx8 s[8:15], s[2:3], s4
     50 // GCN: s_load_dwordx8 s[8:15], s[2:3], s4 ; encoding: [0x04,0x02,0xc4,0xc0]
     51 
     52 s_load_dwordx8 s[96:103], s[2:3], s4
     53 // GCN: s_load_dwordx8 s[96:103], s[2:3], s4 ; encoding: [0x04,0x02,0xf0,0xc0]
     54 
     55 s_load_dwordx16 s[16:31], s[2:3], 1
     56 // GCN: s_load_dwordx16 s[16:31], s[2:3], 0x1 ; encoding: [0x01,0x03,0x08,0xc1]
     57 
     58 s_load_dwordx16 s[16:31], s[2:3], s4
     59 // GCN: s_load_dwordx16 s[16:31], s[2:3], s4 ; encoding: [0x04,0x02,0x08,0xc1]
     60 
     61 s_load_dwordx16 s[88:103], s[2:3], s4
     62 // GCN: s_load_dwordx16 s[88:103], s[2:3], s4 ; encoding: [0x04,0x02,0x2c,0xc1]
     63 
     64 s_dcache_inv
     65 // GCN: s_dcache_inv ; encoding: [0x00,0x00,0xc0,0xc7]
     66 
     67 s_dcache_inv_vol
     68 // CI: s_dcache_inv_vol ; encoding: [0x00,0x00,0x40,0xc7]
     69 // NOSI: error: instruction not supported on this GPU
     70