1 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
2 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s
4 //===----------------------------------------------------------------------===//
6 //===----------------------------------------------------------------------===//
8 // Test forced e64 encoding
10 v_cmp_lt_f32_e64 s[2:3], v4, -v6
11 // CHECK: v_cmp_lt_f32_e64 s[2:3], v4, -v6 ; encoding: [0x02,0x00,0x02,0xd0,0x04,0x0d,0x02,0x40]
17 v_cmp_lt_f32 s[2:3] -v4, v6
18 // CHECK: v_cmp_lt_f32_e64 s[2:3], -v4, v6 ; encoding: [0x02,0x00,0x02,0xd0,0x04,0x0d,0x02,0x20]
20 v_cmp_lt_f32 s[2:3] v4, -v6
21 // CHECK: v_cmp_lt_f32_e64 s[2:3], v4, -v6 ; encoding: [0x02,0x00,0x02,0xd0,0x04,0x0d,0x02,0x40]
23 v_cmp_lt_f32 s[2:3] -v4, -v6
24 // CHECK: v_cmp_lt_f32_e64 s[2:3], -v4, -v6 ; encoding: [0x02,0x00,0x02,0xd0,0x04,0x0d,0x02,0x60]
26 v_cmp_lt_f32 s[2:3] |v4|, v6
27 // CHECK: v_cmp_lt_f32_e64 s[2:3], |v4|, v6 ; encoding: [0x02,0x01,0x02,0xd0,0x04,0x0d,0x02,0x00]
29 v_cmp_lt_f32 s[2:3] v4, |v6|
30 // CHECK: v_cmp_lt_f32_e64 s[2:3], v4, |v6| ; encoding: [0x02,0x02,0x02,0xd0,0x04,0x0d,0x02,0x00]
32 v_cmp_lt_f32 s[2:3] |v4|, |v6|
33 // CHECK: v_cmp_lt_f32_e64 s[2:3], |v4|, |v6| ; encoding: [0x02,0x03,0x02,0xd0,0x04,0x0d,0x02,0x00]
35 v_cmp_lt_f32 s[2:3] -|v4|, v6
36 // CHECK: v_cmp_lt_f32_e64 s[2:3], -|v4|, v6 ; encoding: [0x02,0x01,0x02,0xd0,0x04,0x0d,0x02,0x20]
38 v_cmp_lt_f32 s[2:3] v4, -|v6|
39 // CHECK: v_cmp_lt_f32_e64 s[2:3], v4, -|v6| ; encoding: [0x02,0x02,0x02,0xd0,0x04,0x0d,0x02,0x40]
41 v_cmp_lt_f32 s[2:3] -|v4|, -|v6|
42 // CHECK: v_cmp_lt_f32_e64 s[2:3], -|v4|, -|v6| ; encoding: [0x02,0x03,0x02,0xd0,0x04,0x0d,0x02,0x60]
48 v_cmp_f_f32 s[2:3], v4, v6
49 // CHECK: v_cmp_f_f32_e64 s[2:3], v4, v6 ; encoding: [0x02,0x00,0x00,0xd0,0x04,0x0d,0x02,0x00]
51 v_cmp_lt_f32 s[2:3], v4, v6
52 // CHECK: v_cmp_lt_f32_e64 s[2:3], v4, v6 ; encoding: [0x02,0x00,0x02,0xd0,0x04,0x0d,0x02,0x00]
54 v_cmp_eq_f32 s[2:3], v4, v6
55 // CHECK: v_cmp_eq_f32_e64 s[2:3], v4, v6 ; encoding: [0x02,0x00,0x04,0xd0,0x04,0x0d,0x02,0x00]
57 v_cmp_le_f32 s[2:3], v4, v6
58 // CHECK: v_cmp_le_f32_e64 s[2:3], v4, v6 ; encoding: [0x02,0x00,0x06,0xd0,0x04,0x0d,0x02,0x00]
60 v_cmp_gt_f32 s[2:3], v4, v6
61 // CHECK: v_cmp_gt_f32_e64 s[2:3], v4, v6 ; encoding: [0x02,0x00,0x08,0xd0,0x04,0x0d,0x02,0x00]
63 v_cmp_lg_f32 s[2:3], v4, v6
64 // CHECK: v_cmp_lg_f32_e64 s[2:3], v4, v6 ; encoding: [0x02,0x00,0x0a,0xd0,0x04,0x0d,0x02,0x00]
66 v_cmp_ge_f32 s[2:3], v4, v6
67 // CHECK: v_cmp_ge_f32_e64 s[2:3], v4, v6 ; encoding: [0x02,0x00,0x0c,0xd0,0x04,0x0d,0x02,0x00]
71 //===----------------------------------------------------------------------===//
73 //===----------------------------------------------------------------------===//
80 // CHECK: v_fract_f32_e64 v1, -v2 ; encoding: [0x01,0x00,0x40,0xd3,0x02,0x01,0x00,0x20]
83 // CHECK: v_fract_f32_e64 v1, |v2| ; encoding: [0x01,0x01,0x40,0xd3,0x02,0x01,0x00,0x00]
86 // CHECK: v_fract_f32_e64 v1, -|v2| ; encoding: [0x01,0x01,0x40,0xd3,0x02,0x01,0x00,0x20]
88 v_fract_f32 v1, v2 clamp
89 // CHECK: v_fract_f32_e64 v1, v2 clamp ; encoding: [0x01,0x08,0x40,0xd3,0x02,0x01,0x00,0x00]
91 v_fract_f32 v1, v2 mul:2
92 // CHECK: v_fract_f32_e64 v1, v2 mul:2 ; encoding: [0x01,0x00,0x40,0xd3,0x02,0x01,0x00,0x08]
94 v_fract_f32 v1, v2, div:2 clamp
95 // CHECK: v_fract_f32_e64 v1, v2 clamp div:2 ; encoding: [0x01,0x08,0x40,0xd3,0x02,0x01,0x00,0x18]
99 ///===---------------------------------------------------------------------===//
101 ///===---------------------------------------------------------------------===//
103 // Test forced e64 encoding with e32 operands
105 v_ldexp_f32_e64 v1, v3, v5
106 // CHECK: v_ldexp_f32_e64 v1, v3, v5 ; encoding: [0x01,0x00,0x56,0xd2,0x03,0x0b,0x02,0x00]
109 // TODO: Modifier tests
111 v_cndmask_b32 v1, v3, v5, s[4:5]
112 // CHECK: v_cndmask_b32_e64 v1, v3, v5, s[4:5] ; encoding: [0x01,0x00,0x00,0xd2,0x03,0x0b,0x12,0x00]
114 //TODO: readlane, writelane
117 // CHECK: v_add_f32_e64 v1, v3, s5 ; encoding: [0x01,0x00,0x06,0xd2,0x03,0x0b,0x00,0x00]
120 // CHECK: v_sub_f32_e64 v1, v3, s5 ; encoding: [0x01,0x00,0x08,0xd2,0x03,0x0b,0x00,0x00]
122 v_subrev_f32 v1, v3, s5
123 // CHECK: v_subrev_f32_e64 v1, v3, s5 ; encoding: [0x01,0x00,0x0a,0xd2,0x03,0x0b,0x00,0x00]
125 v_mac_legacy_f32 v1, v3, s5
126 // CHECK: v_mac_legacy_f32_e64 v1, v3, s5 ; encoding: [0x01,0x00,0x0c,0xd2,0x03,0x0b,0x00,0x00]
128 v_mul_legacy_f32 v1, v3, s5
129 // CHECK: v_mul_legacy_f32_e64 v1, v3, s5 ; encoding: [0x01,0x00,0x0e,0xd2,0x03,0x0b,0x00,0x00]
132 // CHECK: v_mul_f32_e64 v1, v3, s5 ; encoding: [0x01,0x00,0x10,0xd2,0x03,0x0b,0x00,0x00]
134 v_mul_i32_i24 v1, v3, s5
135 // CHECK: v_mul_i32_i24_e64 v1, v3, s5 ; encoding: [0x01,0x00,0x12,0xd2,0x03,0x0b,0x00,0x00]
137 ///===---------------------------------------------------------------------===//
139 ///===---------------------------------------------------------------------===//
141 // TODO: Modifier tests
143 v_mad_legacy_f32 v2, v4, v6, v8
144 // CHECK: v_mad_legacy_f32 v2, v4, v6, v8 ; encoding: [0x02,0x00,0x80,0xd2,0x04,0x0d,0x22,0x04]