[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / AMDGPU / add-sub-no-carry.s
blob1768b73b60af845acf35d4bc16eadff132af1359
1 // RUN: llvm-mc -arch=amdgcn -mcpu=gfx900 -show-encoding %s | FileCheck --check-prefix=GFX9 %s
3 // RUN: not llvm-mc -arch=amdgcn -mcpu=fiji %s 2>&1 | FileCheck --check-prefix=ERR-VI --implicit-check-not=error: %s
4 // RUN: not llvm-mc -arch=amdgcn -mcpu=bonaire %s 2>&1 | FileCheck --check-prefix=ERR-SICI --implicit-check-not=error: %s
5 // FIXME: pre-gfx9 errors should be more useful
8 v_add_u32 v1, v2, v3
9 // GFX9: v_add_u32_e32 v1, v2, v3 ; encoding: [0x02,0x07,0x02,0x68]
10 // ERR-SICI: error: instruction not supported on this GPU
11 // ERR-VI: error: operands are not valid for this GPU or mode
13 v_add_u32 v1, v2, s1
14 // GFX9: v_add_u32_e64 v1, v2, s1 ; encoding: [0x01,0x00,0x34,0xd1,0x02,0x03,0x00,0x00]
15 // ERR-SICI: error: instruction not supported on this GPU
16 // ERR-VI: error: operands are not valid for this GPU or mode
18 v_add_u32 v1, s1, v2
19 // GFX9: v_add_u32_e32 v1, s1, v2 ; encoding: [0x01,0x04,0x02,0x68]
20 // ERR-SICI: error: instruction not supported on this GPU
21 // ERR-VI: error: operands are not valid for this GPU or mode
23 v_add_u32 v1, 4.0, v2
24 // GFX9: v_add_u32_e32 v1, 4.0, v2 ; encoding: [0xf6,0x04,0x02,0x68]
25 // ERR-SICI: error: instruction not supported on this GPU
26 // ERR-VI: error: operands are not valid for this GPU or mode
28 v_add_u32 v1, v2, 4.0
29 // GFX9: v_add_u32_e64 v1, v2, 4.0 ; encoding: [0x01,0x00,0x34,0xd1,0x02,0xed,0x01,0x00]
30 // ERR-SICI: error: instruction not supported on this GPU
31 // ERR-VI: error: operands are not valid for this GPU or mode
33 v_add_u32_e32 v1, v2, v3
34 // GFX9: v_add_u32_e32 v1, v2, v3 ; encoding: [0x02,0x07,0x02,0x68]
35 // ERR-SICI: error: instruction not supported on this GPU
36 // ERR-VI: error: operands are not valid for this GPU or mode
38 v_add_u32_e32 v1, s1, v3
39 // GFX9: v_add_u32_e32 v1, s1, v3 ; encoding: [0x01,0x06,0x02,0x68]
40 // ERR-SICI: error: instruction not supported on this GPU
41 // ERR-VI: error: operands are not valid for this GPU or mode
45 v_sub_u32 v1, v2, v3
46 // GFX9: v_sub_u32_e32 v1, v2, v3 ; encoding: [0x02,0x07,0x02,0x6a]
47 // ERR-SICI: error: instruction not supported on this GPU
48 // ERR-VI: error: operands are not valid for this GPU or mode
50 v_sub_u32 v1, v2, s1
51 // GFX9: v_sub_u32_e64 v1, v2, s1 ; encoding: [0x01,0x00,0x35,0xd1,0x02,0x03,0x00,0x00]
52 // ERR-SICI: error: instruction not supported on this GPU
53 // ERR-VI: error: operands are not valid for this GPU or mode
55 v_sub_u32 v1, s1, v2
56 // GFX9: v_sub_u32_e32 v1, s1, v2 ; encoding: [0x01,0x04,0x02,0x6a]
57 // ERR-SICI: error: instruction not supported on this GPU
58 // ERR-VI: error: operands are not valid for this GPU or mode
60 v_sub_u32 v1, 4.0, v2
61 // GFX9: v_sub_u32_e32 v1, 4.0, v2 ; encoding: [0xf6,0x04,0x02,0x6a]
62 // ERR-SICI: error: instruction not supported on this GPU
63 // ERR-VI: error: operands are not valid for this GPU or mode
65 v_sub_u32 v1, v2, 4.0
66 // GFX9: v_sub_u32_e64 v1, v2, 4.0 ; encoding: [0x01,0x00,0x35,0xd1,0x02,0xed,0x01,0x00]
67 // ERR-SICI: error: instruction not supported on this GPU
68 // ERR-VI: error: operands are not valid for this GPU or mode
70 v_sub_u32_e32 v1, v2, v3
71 // GFX9: v_sub_u32_e32 v1, v2, v3 ; encoding: [0x02,0x07,0x02,0x6a]
72 // ERR-SICI: error: instruction not supported on this GPU
73 // ERR-VI: error: operands are not valid for this GPU or mode
75 v_sub_u32_e32 v1, s1, v3
76 // GFX9: v_sub_u32_e32 v1, s1, v3 ; encoding: [0x01,0x06,0x02,0x6a]
77 // ERR-SICI: error: instruction not supported on this GPU
78 // ERR-VI: error: operands are not valid for this GPU or mode
82 v_subrev_u32 v1, v2, v3
83 // GFX9: v_subrev_u32_e32 v1, v2, v3 ; encoding: [0x02,0x07,0x02,0x6c]
84 // ERR-SICI: error: instruction not supported on this GPU
85 // ERR-VI: error: operands are not valid for this GPU or mode
87 v_subrev_u32 v1, v2, s1
88 // GFX9: v_subrev_u32_e64 v1, v2, s1 ; encoding: [0x01,0x00,0x36,0xd1,0x02,0x03,0x00,0x00]
89 // ERR-SICI: error: instruction not supported on this GPU
90 // ERR-VI: error: operands are not valid for this GPU or mode
92 v_subrev_u32 v1, s1, v2
93 // GFX9: v_subrev_u32_e32 v1, s1, v2 ; encoding: [0x01,0x04,0x02,0x6c]
94 // ERR-SICI: error: instruction not supported on this GPU
95 // ERR-VI: error: operands are not valid for this GPU or mode
97 v_subrev_u32 v1, 4.0, v2
98 // GFX9: v_subrev_u32_e32 v1, 4.0, v2 ; encoding: [0xf6,0x04,0x02,0x6c]
99 // ERR-SICI: error: instruction not supported on this GPU
100 // ERR-VI: error: operands are not valid for this GPU or mode
102 v_subrev_u32 v1, v2, 4.0
103 // GFX9: v_subrev_u32_e64 v1, v2, 4.0 ; encoding: [0x01,0x00,0x36,0xd1,0x02,0xed,0x01,0x00]
104 // ERR-SICI: error: instruction not supported on this GPU
105 // ERR-VI: error: operands are not valid for this GPU or mode
107 v_subrev_u32_e32 v1, v2, v3
108 // GFX9: v_subrev_u32_e32 v1, v2, v3 ; encoding: [0x02,0x07,0x02,0x6c]
109 // ERR-SICI: error: instruction not supported on this GPU
110 // ERR-VI: error: operands are not valid for this GPU or mode
112 v_subrev_u32_e32 v1, s1, v3
113 // GFX9: v_subrev_u32_e32 v1, s1, v3 ; encoding: [0x01,0x06,0x02,0x6c]
114 // ERR-SICI: error: instruction not supported on this GPU
115 // ERR-VI: error: operands are not valid for this GPU or mode