[ThinLTO] Add code comment. NFC
[llvm-complete.git] / test / MC / AMDGPU / vopc.s
blobfb95abdf8dda99fa3ef7752781ecb5e2b1b3fcf5
1 // RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s --check-prefix=SICI
2 // RUN: llvm-mc -arch=amdgcn -mcpu=tahiti -show-encoding %s | FileCheck %s --check-prefix=SICI
3 // RUN: llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=VI
5 //===----------------------------------------------------------------------===//
6 // Generic Checks
7 //===----------------------------------------------------------------------===//
9 // src0 sgpr
10 v_cmp_lt_f32 vcc, s2, v4
11 // SICI: v_cmp_lt_f32_e32 vcc, s2, v4 ; encoding: [0x02,0x08,0x02,0x7c]
12 // VI: v_cmp_lt_f32_e32 vcc, s2, v4 ; encoding: [0x02,0x08,0x82,0x7c]
14 // src0 inline immediate
15 v_cmp_lt_f32 vcc, 0, v4
16 // SICI: v_cmp_lt_f32_e32 vcc, 0, v4 ; encoding: [0x80,0x08,0x02,0x7c]
17 // VI: v_cmp_lt_f32_e32 vcc, 0, v4 ; encoding: [0x80,0x08,0x82,0x7c]
19 // src0 literal
20 v_cmp_lt_f32 vcc, 10.0, v4
21 // SICI: v_cmp_lt_f32_e32 vcc, 0x41200000, v4 ; encoding: [0xff,0x08,0x02,0x7c,0x00,0x00,0x20,0x41]
22 // VI: v_cmp_lt_f32_e32 vcc, 0x41200000, v4 ; encoding: [0xff,0x08,0x82,0x7c,0x00,0x00,0x20,0x41]
24 // src0, src1 max vgpr
25 v_cmp_lt_f32 vcc, v255, v255
26 // SICI: v_cmp_lt_f32_e32 vcc, v255, v255 ; encoding: [0xff,0xff,0x03,0x7c]
27 // VI: v_cmp_lt_f32_e32 vcc, v255, v255 ; encoding: [0xff,0xff,0x83,0x7c]
29 // force 32-bit encoding
30 v_cmp_lt_f32_e32 vcc, v2, v4
31 // SICI: v_cmp_lt_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x02,0x7c]
32 // VI: v_cmp_lt_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x82,0x7c]
35 //===----------------------------------------------------------------------===//
36 // Instructions
37 //===----------------------------------------------------------------------===//
39 v_cmp_f_f32 vcc, v2, v4
40 // SICI: v_cmp_f_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x00,0x7c]
41 // VI: v_cmp_f_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x80,0x7c]
43 v_cmp_lt_f32 vcc, v2, v4
44 // SICI: v_cmp_lt_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x02,0x7c]
45 // VI: v_cmp_lt_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x82,0x7c]
47 // TODO: Add tests for the rest of v_cmp_*_f32
48 // TODO: Add tests for v_cmpx_*_f32
50 v_cmp_f_f64 vcc, v[2:3], v[4:5]
51 // SICI: v_cmp_f_f64_e32 vcc, v[2:3], v[4:5] ; encoding: [0x02,0x09,0x40,0x7c]
52 // VI: v_cmp_f_f64_e32 vcc, v[2:3], v[4:5] ; encoding: [0x02,0x09,0xc0,0x7c]
54 // TODO: Add tests for the rest of v_cmp_*_f64
55 // TODO: Add tests for the rest of the floating-point comparision instructions.
57 v_cmp_f_i32 vcc, v2, v4
58 // SICI: v_cmp_f_i32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x00,0x7d]
59 // VI: v_cmp_f_i32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x80,0x7d]
61 // TODO: Add test for the rest of v_cmp_*_i32
63 v_cmp_f_i64 vcc, v[2:3], v[4:5]
64 // SICI: v_cmp_f_i64_e32 vcc, v[2:3], v[4:5] ; encoding: [0x02,0x09,0x40,0x7d]
65 // VI: v_cmp_f_i64_e32 vcc, v[2:3], v[4:5] ; encoding: [0x02,0x09,0xc0,0x7d]
67 // TODO: Add tests for the rest of the instructions.