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 4 5//===----------------------------------------------------------------------===// 6// Generic Checks 7//===----------------------------------------------------------------------===// 8 9// src0 sgpr 10v_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] 13 14// src0 inline immediate 15v_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] 18 19// src0 literal 20v_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] 23 24// src0, src1 max vgpr 25v_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] 28 29// force 32-bit encoding 30v_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] 33 34 35//===----------------------------------------------------------------------===// 36// Instructions 37//===----------------------------------------------------------------------===// 38 39v_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] 42 43v_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] 46 47// TODO: Add tests for the rest of v_cmp_*_f32 48// TODO: Add tests for v_cmpx_*_f32 49 50v_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] 53 54// TODO: Add tests for the rest of v_cmp_*_f64 55// TODO: Add tests for the rest of the floating-point comparision instructions. 56 57v_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] 60 61// TODO: Add test for the rest of v_cmp_*_i32 62 63v_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] 66 67// TODO: Add tests for the rest of the instructions. 68