1*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -arch=amdgcn -show-encoding %s | FileCheck %s --check-prefix=SICI 2*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -arch=amdgcn -mcpu=SI -show-encoding %s | FileCheck %s --check-prefix=SICI 3*9880d681SAndroid Build Coastguard Worker// RUN: llvm-mc -arch=amdgcn -mcpu=tonga -show-encoding %s | FileCheck %s --check-prefix=VI 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===// 6*9880d681SAndroid Build Coastguard Worker// Generic Checks 7*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===// 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Worker// src0 sgpr 10*9880d681SAndroid Build Coastguard Workerv_cmp_lt_f32 vcc, s2, v4 11*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_lt_f32_e32 vcc, s2, v4 ; encoding: [0x02,0x08,0x02,0x7c] 12*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_lt_f32_e32 vcc, s2, v4 ; encoding: [0x02,0x08,0x82,0x7c] 13*9880d681SAndroid Build Coastguard Worker 14*9880d681SAndroid Build Coastguard Worker// src0 inline immediate 15*9880d681SAndroid Build Coastguard Workerv_cmp_lt_f32 vcc, 0, v4 16*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_lt_f32_e32 vcc, 0, v4 ; encoding: [0x80,0x08,0x02,0x7c] 17*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_lt_f32_e32 vcc, 0, v4 ; encoding: [0x80,0x08,0x82,0x7c] 18*9880d681SAndroid Build Coastguard Worker 19*9880d681SAndroid Build Coastguard Worker// src0 literal 20*9880d681SAndroid Build Coastguard Workerv_cmp_lt_f32 vcc, 10.0, v4 21*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_lt_f32_e32 vcc, 0x41200000, v4 ; encoding: [0xff,0x08,0x02,0x7c,0x00,0x00,0x20,0x41] 22*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_lt_f32_e32 vcc, 0x41200000, v4 ; encoding: [0xff,0x08,0x82,0x7c,0x00,0x00,0x20,0x41] 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Worker// src0, src1 max vgpr 25*9880d681SAndroid Build Coastguard Workerv_cmp_lt_f32 vcc, v255, v255 26*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_lt_f32_e32 vcc, v255, v255 ; encoding: [0xff,0xff,0x03,0x7c] 27*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_lt_f32_e32 vcc, v255, v255 ; encoding: [0xff,0xff,0x83,0x7c] 28*9880d681SAndroid Build Coastguard Worker 29*9880d681SAndroid Build Coastguard Worker// force 32-bit encoding 30*9880d681SAndroid Build Coastguard Workerv_cmp_lt_f32_e32 vcc, v2, v4 31*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_lt_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x02,0x7c] 32*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_lt_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x82,0x7c] 33*9880d681SAndroid Build Coastguard Worker 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===// 36*9880d681SAndroid Build Coastguard Worker// Instructions 37*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===// 38*9880d681SAndroid Build Coastguard Worker 39*9880d681SAndroid Build Coastguard Workerv_cmp_f_f32 vcc, v2, v4 40*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_f_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x00,0x7c] 41*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_f_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x80,0x7c] 42*9880d681SAndroid Build Coastguard Worker 43*9880d681SAndroid Build Coastguard Workerv_cmp_lt_f32 vcc, v2, v4 44*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_lt_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x02,0x7c] 45*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_lt_f32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x82,0x7c] 46*9880d681SAndroid Build Coastguard Worker 47*9880d681SAndroid Build Coastguard Worker// TODO: Add tests for the rest of v_cmp_*_f32 48*9880d681SAndroid Build Coastguard Worker// TODO: Add tests for v_cmpx_*_f32 49*9880d681SAndroid Build Coastguard Worker 50*9880d681SAndroid Build Coastguard Workerv_cmp_f_f64 vcc, v[2:3], v[4:5] 51*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_f_f64_e32 vcc, v[2:3], v[4:5] ; encoding: [0x02,0x09,0x40,0x7c] 52*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_f_f64_e32 vcc, v[2:3], v[4:5] ; encoding: [0x02,0x09,0xc0,0x7c] 53*9880d681SAndroid Build Coastguard Worker 54*9880d681SAndroid Build Coastguard Worker// TODO: Add tests for the rest of v_cmp_*_f64 55*9880d681SAndroid Build Coastguard Worker// TODO: Add tests for the rest of the floating-point comparision instructions. 56*9880d681SAndroid Build Coastguard Worker 57*9880d681SAndroid Build Coastguard Workerv_cmp_f_i32 vcc, v2, v4 58*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_f_i32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x00,0x7d] 59*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_f_i32_e32 vcc, v2, v4 ; encoding: [0x02,0x09,0x80,0x7d] 60*9880d681SAndroid Build Coastguard Worker 61*9880d681SAndroid Build Coastguard Worker// TODO: Add test for the rest of v_cmp_*_i32 62*9880d681SAndroid Build Coastguard Worker 63*9880d681SAndroid Build Coastguard Workerv_cmp_f_i64 vcc, v[2:3], v[4:5] 64*9880d681SAndroid Build Coastguard Worker// SICI: v_cmp_f_i64_e32 vcc, v[2:3], v[4:5] ; encoding: [0x02,0x09,0x40,0x7d] 65*9880d681SAndroid Build Coastguard Worker// VI: v_cmp_f_i64_e32 vcc, v[2:3], v[4:5] ; encoding: [0x02,0x09,0xc0,0x7d] 66*9880d681SAndroid Build Coastguard Worker 67*9880d681SAndroid Build Coastguard Worker// TODO: Add tests for the rest of the instructions. 68