1// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s | FileCheck -check-prefix=GCN %s
2// RUN: llvm-mc -arch=amdgcn -mcpu=fiji -show-encoding %s | FileCheck --check-prefixes=GCN,VI %s
3// RUN: not llvm-mc -arch=amdgcn -mcpu=tahiti %s 2>&1 | FileCheck -check-prefix=NOSICI --implicit-check-not=error: %s
4// RUN: not llvm-mc -arch=amdgcn -mcpu=gfx1010 %s 2>&1 | FileCheck -check-prefix=GFX10-ERR --implicit-check-not=error: %s
5
6//===----------------------------------------------------------------------===//
7// SOPC Instructions
8//===----------------------------------------------------------------------===//
9
10s_cmp_eq_i32 s1, s2
11// GCN: s_cmp_eq_i32 s1, s2 ; encoding: [0x01,0x02,0x00,0xbf]
12
13s_cmp_eq_i32 0xabcd1234, 0xabcd1234
14// GCN: s_cmp_eq_i32 0xabcd1234, 0xabcd1234 ; encoding: [0xff,0xff,0x00,0xbf,0x34,0x12,0xcd,0xab]
15
16s_cmp_eq_i32 0xFFFF0000, -65536
17// GCN: s_cmp_eq_i32 0xffff0000, 0xffff0000 ; encoding: [0xff,0xff,0x00,0xbf,0x00,0x00,0xff,0xff]
18
19s_cmp_lg_i32 s1, s2
20// GCN: s_cmp_lg_i32 s1, s2 ; encoding: [0x01,0x02,0x01,0xbf]
21
22s_cmp_gt_i32 s1, s2
23// GCN: s_cmp_gt_i32 s1, s2 ; encoding: [0x01,0x02,0x02,0xbf]
24
25s_cmp_ge_i32 s1, s2
26// GCN: s_cmp_ge_i32 s1, s2 ; encoding: [0x01,0x02,0x03,0xbf]
27
28s_cmp_lt_i32 s1, s2
29// GCN: s_cmp_lt_i32 s1, s2 ; encoding: [0x01,0x02,0x04,0xbf]
30
31s_cmp_le_i32 s1, s2
32// GCN: s_cmp_le_i32 s1, s2 ; encoding: [0x01,0x02,0x05,0xbf]
33
34s_cmp_eq_u32 s1, s2
35// GCN: s_cmp_eq_u32 s1, s2 ; encoding: [0x01,0x02,0x06,0xbf]
36
37s_cmp_lg_u32 s1, s2
38// GCN: s_cmp_lg_u32 s1, s2 ; encoding: [0x01,0x02,0x07,0xbf]
39
40s_cmp_gt_u32 s1, s2
41// GCN: s_cmp_gt_u32 s1, s2 ; encoding: [0x01,0x02,0x08,0xbf]
42
43s_cmp_ge_u32 s1, s2
44// GCN: s_cmp_ge_u32 s1, s2 ; encoding: [0x01,0x02,0x09,0xbf]
45
46s_cmp_lt_u32 s1, s2
47// GCN: s_cmp_lt_u32 s1, s2 ; encoding: [0x01,0x02,0x0a,0xbf]
48
49s_cmp_le_u32 s1, s2
50// GCN: s_cmp_le_u32 s1, s2 ; encoding: [0x01,0x02,0x0b,0xbf]
51
52s_bitcmp0_b32 s1, s2
53// GCN: s_bitcmp0_b32 s1, s2 ; encoding: [0x01,0x02,0x0c,0xbf]
54
55s_bitcmp1_b32 s1, s2
56// GCN: s_bitcmp1_b32 s1, s2 ; encoding: [0x01,0x02,0x0d,0xbf]
57
58s_bitcmp0_b64 s[2:3], s4
59// GCN: s_bitcmp0_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0e,0xbf]
60
61s_bitcmp1_b64 s[2:3], s4
62// GCN: s_bitcmp1_b64 s[2:3], s4 ; encoding: [0x02,0x04,0x0f,0xbf]
63
64s_setvskip s3, s5
65// GCN: s_setvskip s3, s5 ; encoding: [0x03,0x05,0x10,0xbf]
66// GFX10-ERR: error: instruction not supported on this GPU
67
68s_cmp_eq_u64 s[0:1], s[2:3]
69// VI: s_cmp_eq_u64 s[0:1], s[2:3] ; encoding: [0x00,0x02,0x12,0xbf]
70// NOSICI: error: instruction not supported on this GPU
71
72s_cmp_lg_u64 s[0:1], s[2:3]
73// VI: s_cmp_lg_u64 s[0:1], s[2:3] ; encoding: [0x00,0x02,0x13,0xbf]
74// NOSICI: error: instruction not supported on this GPU
75
76gpr_idx = 1
77s_set_gpr_idx_on s0, gpr_idx
78// VI: s_set_gpr_idx_on s0, gpr_idx(SRC0) ; encoding: [0x00,0x01,0x11,0xbf]
79// NOSICI: error: instruction not supported on this GPU
80// GFX10-ERR: error: instruction not supported on this GPU
81
82gpr_idx_mode = 10
83s_set_gpr_idx_on s0, gpr_idx_mode + 5
84// VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1,SRC2,DST) ; encoding: [0x00,0x0f,0x11,0xbf]
85// NOSICI: error: instruction not supported on this GPU
86// GFX10-ERR: error: instruction not supported on this GPU
87
88s_set_gpr_idx_on s0, 0
89// VI: s_set_gpr_idx_on s0, gpr_idx() ; encoding: [0x00,0x00,0x11,0xbf]
90// NOSICI: error: instruction not supported on this GPU
91// GFX10-ERR: error: instruction not supported on this GPU
92
93s_set_gpr_idx_on s0, gpr_idx()
94// VI: s_set_gpr_idx_on s0, gpr_idx() ; encoding: [0x00,0x00,0x11,0xbf]
95// NOSICI: error: instruction not supported on this GPU
96// GFX10-ERR: error: instruction not supported on this GPU
97
98s_set_gpr_idx_on s0, 1
99// VI: s_set_gpr_idx_on s0, gpr_idx(SRC0) ; encoding: [0x00,0x01,0x11,0xbf]
100// NOSICI: error: instruction not supported on this GPU
101// GFX10-ERR: error: instruction not supported on this GPU
102
103s_set_gpr_idx_on s0, gpr_idx(SRC0)
104// VI: s_set_gpr_idx_on s0, gpr_idx(SRC0) ; encoding: [0x00,0x01,0x11,0xbf]
105// NOSICI: error: instruction not supported on this GPU
106// GFX10-ERR: error: instruction not supported on this GPU
107
108s_set_gpr_idx_on s0, 3
109// VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1) ; encoding: [0x00,0x03,0x11,0xbf]
110// NOSICI: error: instruction not supported on this GPU
111// GFX10-ERR: error: instruction not supported on this GPU
112
113s_set_gpr_idx_on s0, gpr_idx(SRC1,SRC0)
114// VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1) ; encoding: [0x00,0x03,0x11,0xbf]
115// NOSICI: error: instruction not supported on this GPU
116// GFX10-ERR: error: instruction not supported on this GPU
117
118s_set_gpr_idx_on s0, 15
119// VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1,SRC2,DST) ; encoding: [0x00,0x0f,0x11,0xbf]
120// NOSICI: error: instruction not supported on this GPU
121// GFX10-ERR: error: instruction not supported on this GPU
122
123s_set_gpr_idx_on s0, gpr_idx(SRC0,DST,SRC2,SRC1)
124// VI: s_set_gpr_idx_on s0, gpr_idx(SRC0,SRC1,SRC2,DST) ; encoding: [0x00,0x0f,0x11,0xbf]
125// NOSICI: error: instruction not supported on this GPU
126// GFX10-ERR: error: instruction not supported on this GPU
127