1*207e5cccSFangrui Song // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py 2*207e5cccSFangrui Song // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve \ 3*207e5cccSFangrui Song // RUN: -disable-O0-optnone \ 4*207e5cccSFangrui Song // RUN: -emit-llvm -o - %s | opt -S -passes=sroa | FileCheck %s 5*207e5cccSFangrui Song 6*207e5cccSFangrui Song // REQUIRES: aarch64-registered-target 7*207e5cccSFangrui Song 8*207e5cccSFangrui Song #include <arm_sve.h> 9*207e5cccSFangrui Song 10*207e5cccSFangrui Song // EQ 11*207e5cccSFangrui Song 12*207e5cccSFangrui Song // CHECK-LABEL: @eq_bool( 13*207e5cccSFangrui Song // CHECK-NEXT: entry: 14*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 16 x i1> [[A:%.*]], [[B:%.*]] 15*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i1> [[CMP]] 16*207e5cccSFangrui Song // 17*207e5cccSFangrui Song svbool_t eq_bool(svbool_t a, svbool_t b) { 18*207e5cccSFangrui Song return a == b; 19*207e5cccSFangrui Song } 20*207e5cccSFangrui Song 21*207e5cccSFangrui Song // CHECK-LABEL: @eq_i8( 22*207e5cccSFangrui Song // CHECK-NEXT: entry: 23*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 24*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 25*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 26*207e5cccSFangrui Song // 27*207e5cccSFangrui Song svint8_t eq_i8(svint8_t a, svint8_t b) { 28*207e5cccSFangrui Song return a == b; 29*207e5cccSFangrui Song } 30*207e5cccSFangrui Song 31*207e5cccSFangrui Song // CHECK-LABEL: @eq_i16( 32*207e5cccSFangrui Song // CHECK-NEXT: entry: 33*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 34*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 35*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 36*207e5cccSFangrui Song // 37*207e5cccSFangrui Song svint16_t eq_i16(svint16_t a, svint16_t b) { 38*207e5cccSFangrui Song return a == b; 39*207e5cccSFangrui Song } 40*207e5cccSFangrui Song 41*207e5cccSFangrui Song // CHECK-LABEL: @eq_i32( 42*207e5cccSFangrui Song // CHECK-NEXT: entry: 43*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 44*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 45*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 46*207e5cccSFangrui Song // 47*207e5cccSFangrui Song svint32_t eq_i32(svint32_t a, svint32_t b) { 48*207e5cccSFangrui Song return a == b; 49*207e5cccSFangrui Song } 50*207e5cccSFangrui Song 51*207e5cccSFangrui Song // CHECK-LABEL: @eq_i64( 52*207e5cccSFangrui Song // CHECK-NEXT: entry: 53*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 54*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 55*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 56*207e5cccSFangrui Song // 57*207e5cccSFangrui Song svint64_t eq_i64(svint64_t a, svint64_t b) { 58*207e5cccSFangrui Song return a == b; 59*207e5cccSFangrui Song } 60*207e5cccSFangrui Song 61*207e5cccSFangrui Song // CHECK-LABEL: @eq_u8( 62*207e5cccSFangrui Song // CHECK-NEXT: entry: 63*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 64*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 65*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 66*207e5cccSFangrui Song // 67*207e5cccSFangrui Song svint8_t eq_u8(svuint8_t a, svuint8_t b) { 68*207e5cccSFangrui Song return a == b; 69*207e5cccSFangrui Song } 70*207e5cccSFangrui Song 71*207e5cccSFangrui Song // CHECK-LABEL: @eq_u16( 72*207e5cccSFangrui Song // CHECK-NEXT: entry: 73*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 74*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 75*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 76*207e5cccSFangrui Song // 77*207e5cccSFangrui Song svint16_t eq_u16(svuint16_t a, svuint16_t b) { 78*207e5cccSFangrui Song return a == b; 79*207e5cccSFangrui Song } 80*207e5cccSFangrui Song 81*207e5cccSFangrui Song // CHECK-LABEL: @eq_u32( 82*207e5cccSFangrui Song // CHECK-NEXT: entry: 83*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 84*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 85*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 86*207e5cccSFangrui Song // 87*207e5cccSFangrui Song svint32_t eq_u32(svuint32_t a, svuint32_t b) { 88*207e5cccSFangrui Song return a == b; 89*207e5cccSFangrui Song } 90*207e5cccSFangrui Song 91*207e5cccSFangrui Song // CHECK-LABEL: @eq_u64( 92*207e5cccSFangrui Song // CHECK-NEXT: entry: 93*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp eq <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 94*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 95*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 96*207e5cccSFangrui Song // 97*207e5cccSFangrui Song svint64_t eq_u64(svuint64_t a, svuint64_t b) { 98*207e5cccSFangrui Song return a == b; 99*207e5cccSFangrui Song } 100*207e5cccSFangrui Song 101*207e5cccSFangrui Song // CHECK-LABEL: @eq_f16( 102*207e5cccSFangrui Song // CHECK-NEXT: entry: 103*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp oeq <vscale x 8 x half> [[A:%.*]], [[B:%.*]] 104*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 105*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 106*207e5cccSFangrui Song // 107*207e5cccSFangrui Song svint16_t eq_f16(svfloat16_t a, svfloat16_t b) { 108*207e5cccSFangrui Song return a == b; 109*207e5cccSFangrui Song } 110*207e5cccSFangrui Song 111*207e5cccSFangrui Song // CHECK-LABEL: @eq_f32( 112*207e5cccSFangrui Song // CHECK-NEXT: entry: 113*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp oeq <vscale x 4 x float> [[A:%.*]], [[B:%.*]] 114*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 115*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 116*207e5cccSFangrui Song // 117*207e5cccSFangrui Song svint32_t eq_f32(svfloat32_t a, svfloat32_t b) { 118*207e5cccSFangrui Song return a == b; 119*207e5cccSFangrui Song } 120*207e5cccSFangrui Song 121*207e5cccSFangrui Song // CHECK-LABEL: @eq_f64( 122*207e5cccSFangrui Song // CHECK-NEXT: entry: 123*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp oeq <vscale x 2 x double> [[A:%.*]], [[B:%.*]] 124*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 125*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 126*207e5cccSFangrui Song // 127*207e5cccSFangrui Song svint64_t eq_f64(svfloat64_t a, svfloat64_t b) { 128*207e5cccSFangrui Song return a == b; 129*207e5cccSFangrui Song } 130*207e5cccSFangrui Song 131*207e5cccSFangrui Song // NEQ 132*207e5cccSFangrui Song 133*207e5cccSFangrui Song // CHECK-LABEL: @neq_bool( 134*207e5cccSFangrui Song // CHECK-NEXT: entry: 135*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 16 x i1> [[A:%.*]], [[B:%.*]] 136*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i1> [[CMP]] 137*207e5cccSFangrui Song // 138*207e5cccSFangrui Song svbool_t neq_bool(svbool_t a, svbool_t b) { 139*207e5cccSFangrui Song return a != b; 140*207e5cccSFangrui Song } 141*207e5cccSFangrui Song 142*207e5cccSFangrui Song // CHECK-LABEL: @neq_i8( 143*207e5cccSFangrui Song // CHECK-NEXT: entry: 144*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 145*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 146*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 147*207e5cccSFangrui Song // 148*207e5cccSFangrui Song svint8_t neq_i8(svint8_t a, svint8_t b) { 149*207e5cccSFangrui Song return a != b; 150*207e5cccSFangrui Song } 151*207e5cccSFangrui Song 152*207e5cccSFangrui Song // CHECK-LABEL: @neq_i16( 153*207e5cccSFangrui Song // CHECK-NEXT: entry: 154*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 155*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 156*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 157*207e5cccSFangrui Song // 158*207e5cccSFangrui Song svint16_t neq_i16(svint16_t a, svint16_t b) { 159*207e5cccSFangrui Song return a != b; 160*207e5cccSFangrui Song } 161*207e5cccSFangrui Song 162*207e5cccSFangrui Song // CHECK-LABEL: @neq_i32( 163*207e5cccSFangrui Song // CHECK-NEXT: entry: 164*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 165*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 166*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 167*207e5cccSFangrui Song // 168*207e5cccSFangrui Song svint32_t neq_i32(svint32_t a, svint32_t b) { 169*207e5cccSFangrui Song return a != b; 170*207e5cccSFangrui Song } 171*207e5cccSFangrui Song 172*207e5cccSFangrui Song // CHECK-LABEL: @neq_i64( 173*207e5cccSFangrui Song // CHECK-NEXT: entry: 174*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 175*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 176*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 177*207e5cccSFangrui Song // 178*207e5cccSFangrui Song svint64_t neq_i64(svint64_t a, svint64_t b) { 179*207e5cccSFangrui Song return a != b; 180*207e5cccSFangrui Song } 181*207e5cccSFangrui Song 182*207e5cccSFangrui Song // CHECK-LABEL: @neq_u8( 183*207e5cccSFangrui Song // CHECK-NEXT: entry: 184*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 185*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 186*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 187*207e5cccSFangrui Song // 188*207e5cccSFangrui Song svint8_t neq_u8(svuint8_t a, svuint8_t b) { 189*207e5cccSFangrui Song return a != b; 190*207e5cccSFangrui Song } 191*207e5cccSFangrui Song 192*207e5cccSFangrui Song // CHECK-LABEL: @neq_u16( 193*207e5cccSFangrui Song // CHECK-NEXT: entry: 194*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 195*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 196*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 197*207e5cccSFangrui Song // 198*207e5cccSFangrui Song svint16_t neq_u16(svuint16_t a, svuint16_t b) { 199*207e5cccSFangrui Song return a != b; 200*207e5cccSFangrui Song } 201*207e5cccSFangrui Song 202*207e5cccSFangrui Song // CHECK-LABEL: @neq_u32( 203*207e5cccSFangrui Song // CHECK-NEXT: entry: 204*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 205*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 206*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 207*207e5cccSFangrui Song // 208*207e5cccSFangrui Song svint32_t neq_u32(svuint32_t a, svuint32_t b) { 209*207e5cccSFangrui Song return a != b; 210*207e5cccSFangrui Song } 211*207e5cccSFangrui Song 212*207e5cccSFangrui Song // CHECK-LABEL: @neq_u64( 213*207e5cccSFangrui Song // CHECK-NEXT: entry: 214*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ne <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 215*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 216*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 217*207e5cccSFangrui Song // 218*207e5cccSFangrui Song svint64_t neq_u64(svuint64_t a, svuint64_t b) { 219*207e5cccSFangrui Song return a != b; 220*207e5cccSFangrui Song } 221*207e5cccSFangrui Song 222*207e5cccSFangrui Song // CHECK-LABEL: @neq_f16( 223*207e5cccSFangrui Song // CHECK-NEXT: entry: 224*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp une <vscale x 8 x half> [[A:%.*]], [[B:%.*]] 225*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 226*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 227*207e5cccSFangrui Song // 228*207e5cccSFangrui Song svint16_t neq_f16(svfloat16_t a, svfloat16_t b) { 229*207e5cccSFangrui Song return a != b; 230*207e5cccSFangrui Song } 231*207e5cccSFangrui Song 232*207e5cccSFangrui Song // CHECK-LABEL: @neq_f32( 233*207e5cccSFangrui Song // CHECK-NEXT: entry: 234*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp une <vscale x 4 x float> [[A:%.*]], [[B:%.*]] 235*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 236*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 237*207e5cccSFangrui Song // 238*207e5cccSFangrui Song svint32_t neq_f32(svfloat32_t a, svfloat32_t b) { 239*207e5cccSFangrui Song return a != b; 240*207e5cccSFangrui Song } 241*207e5cccSFangrui Song 242*207e5cccSFangrui Song // CHECK-LABEL: @neq_f64( 243*207e5cccSFangrui Song // CHECK-NEXT: entry: 244*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp une <vscale x 2 x double> [[A:%.*]], [[B:%.*]] 245*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 246*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 247*207e5cccSFangrui Song // 248*207e5cccSFangrui Song svint64_t neq_f64(svfloat64_t a, svfloat64_t b) { 249*207e5cccSFangrui Song return a != b; 250*207e5cccSFangrui Song } 251*207e5cccSFangrui Song 252*207e5cccSFangrui Song // LT 253*207e5cccSFangrui Song 254*207e5cccSFangrui Song // CHECK-LABEL: @lt_bool( 255*207e5cccSFangrui Song // CHECK-NEXT: entry: 256*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 16 x i1> [[A:%.*]], [[B:%.*]] 257*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i1> [[CMP]] 258*207e5cccSFangrui Song // 259*207e5cccSFangrui Song svbool_t lt_bool(svbool_t a, svbool_t b) { 260*207e5cccSFangrui Song return a < b; 261*207e5cccSFangrui Song } 262*207e5cccSFangrui Song 263*207e5cccSFangrui Song // CHECK-LABEL: @lt_i8( 264*207e5cccSFangrui Song // CHECK-NEXT: entry: 265*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 266*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 267*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 268*207e5cccSFangrui Song // 269*207e5cccSFangrui Song svint8_t lt_i8(svint8_t a, svint8_t b) { 270*207e5cccSFangrui Song return a < b; 271*207e5cccSFangrui Song } 272*207e5cccSFangrui Song 273*207e5cccSFangrui Song // CHECK-LABEL: @lt_i16( 274*207e5cccSFangrui Song // CHECK-NEXT: entry: 275*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 276*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 277*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 278*207e5cccSFangrui Song // 279*207e5cccSFangrui Song svint16_t lt_i16(svint16_t a, svint16_t b) { 280*207e5cccSFangrui Song return a < b; 281*207e5cccSFangrui Song } 282*207e5cccSFangrui Song 283*207e5cccSFangrui Song // CHECK-LABEL: @lt_i32( 284*207e5cccSFangrui Song // CHECK-NEXT: entry: 285*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 286*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 287*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 288*207e5cccSFangrui Song // 289*207e5cccSFangrui Song svint32_t lt_i32(svint32_t a, svint32_t b) { 290*207e5cccSFangrui Song return a < b; 291*207e5cccSFangrui Song } 292*207e5cccSFangrui Song 293*207e5cccSFangrui Song // CHECK-LABEL: @lt_i64( 294*207e5cccSFangrui Song // CHECK-NEXT: entry: 295*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 296*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 297*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 298*207e5cccSFangrui Song // 299*207e5cccSFangrui Song svint64_t lt_i64(svint64_t a, svint64_t b) { 300*207e5cccSFangrui Song return a < b; 301*207e5cccSFangrui Song } 302*207e5cccSFangrui Song 303*207e5cccSFangrui Song // CHECK-LABEL: @lt_u8( 304*207e5cccSFangrui Song // CHECK-NEXT: entry: 305*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 306*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 307*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 308*207e5cccSFangrui Song // 309*207e5cccSFangrui Song svint8_t lt_u8(svuint8_t a, svuint8_t b) { 310*207e5cccSFangrui Song return a < b; 311*207e5cccSFangrui Song } 312*207e5cccSFangrui Song 313*207e5cccSFangrui Song // CHECK-LABEL: @lt_u16( 314*207e5cccSFangrui Song // CHECK-NEXT: entry: 315*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 316*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 317*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 318*207e5cccSFangrui Song // 319*207e5cccSFangrui Song svint16_t lt_u16(svuint16_t a, svuint16_t b) { 320*207e5cccSFangrui Song return a < b; 321*207e5cccSFangrui Song } 322*207e5cccSFangrui Song 323*207e5cccSFangrui Song // CHECK-LABEL: @lt_u32( 324*207e5cccSFangrui Song // CHECK-NEXT: entry: 325*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 326*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 327*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 328*207e5cccSFangrui Song // 329*207e5cccSFangrui Song svint32_t lt_u32(svuint32_t a, svuint32_t b) { 330*207e5cccSFangrui Song return a < b; 331*207e5cccSFangrui Song } 332*207e5cccSFangrui Song 333*207e5cccSFangrui Song // CHECK-LABEL: @lt_u64( 334*207e5cccSFangrui Song // CHECK-NEXT: entry: 335*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ult <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 336*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 337*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 338*207e5cccSFangrui Song // 339*207e5cccSFangrui Song svint64_t lt_u64(svuint64_t a, svuint64_t b) { 340*207e5cccSFangrui Song return a < b; 341*207e5cccSFangrui Song } 342*207e5cccSFangrui Song 343*207e5cccSFangrui Song // CHECK-LABEL: @lt_f16( 344*207e5cccSFangrui Song // CHECK-NEXT: entry: 345*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp olt <vscale x 8 x half> [[A:%.*]], [[B:%.*]] 346*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 347*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 348*207e5cccSFangrui Song // 349*207e5cccSFangrui Song svint16_t lt_f16(svfloat16_t a, svfloat16_t b) { 350*207e5cccSFangrui Song return a < b; 351*207e5cccSFangrui Song } 352*207e5cccSFangrui Song 353*207e5cccSFangrui Song // CHECK-LABEL: @lt_f32( 354*207e5cccSFangrui Song // CHECK-NEXT: entry: 355*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp olt <vscale x 4 x float> [[A:%.*]], [[B:%.*]] 356*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 357*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 358*207e5cccSFangrui Song // 359*207e5cccSFangrui Song svint32_t lt_f32(svfloat32_t a, svfloat32_t b) { 360*207e5cccSFangrui Song return a < b; 361*207e5cccSFangrui Song } 362*207e5cccSFangrui Song 363*207e5cccSFangrui Song // CHECK-LABEL: @lt_f64( 364*207e5cccSFangrui Song // CHECK-NEXT: entry: 365*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp olt <vscale x 2 x double> [[A:%.*]], [[B:%.*]] 366*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 367*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 368*207e5cccSFangrui Song // 369*207e5cccSFangrui Song svint64_t lt_f64(svfloat64_t a, svfloat64_t b) { 370*207e5cccSFangrui Song return a < b; 371*207e5cccSFangrui Song } 372*207e5cccSFangrui Song 373*207e5cccSFangrui Song // LEQ 374*207e5cccSFangrui Song 375*207e5cccSFangrui Song // CHECK-LABEL: @leq_bool( 376*207e5cccSFangrui Song // CHECK-NEXT: entry: 377*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 16 x i1> [[A:%.*]], [[B:%.*]] 378*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i1> [[CMP]] 379*207e5cccSFangrui Song // 380*207e5cccSFangrui Song svbool_t leq_bool(svbool_t a, svbool_t b) { 381*207e5cccSFangrui Song return a <= b; 382*207e5cccSFangrui Song } 383*207e5cccSFangrui Song 384*207e5cccSFangrui Song // CHECK-LABEL: @leq_i8( 385*207e5cccSFangrui Song // CHECK-NEXT: entry: 386*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 387*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 388*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 389*207e5cccSFangrui Song // 390*207e5cccSFangrui Song svint8_t leq_i8(svint8_t a, svint8_t b) { 391*207e5cccSFangrui Song return a <= b; 392*207e5cccSFangrui Song } 393*207e5cccSFangrui Song 394*207e5cccSFangrui Song // CHECK-LABEL: @leq_i16( 395*207e5cccSFangrui Song // CHECK-NEXT: entry: 396*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 397*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 398*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 399*207e5cccSFangrui Song // 400*207e5cccSFangrui Song svint16_t leq_i16(svint16_t a, svint16_t b) { 401*207e5cccSFangrui Song return a <= b; 402*207e5cccSFangrui Song } 403*207e5cccSFangrui Song 404*207e5cccSFangrui Song // CHECK-LABEL: @leq_i32( 405*207e5cccSFangrui Song // CHECK-NEXT: entry: 406*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 407*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 408*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 409*207e5cccSFangrui Song // 410*207e5cccSFangrui Song svint32_t leq_i32(svint32_t a, svint32_t b) { 411*207e5cccSFangrui Song return a <= b; 412*207e5cccSFangrui Song } 413*207e5cccSFangrui Song 414*207e5cccSFangrui Song // CHECK-LABEL: @leq_i64( 415*207e5cccSFangrui Song // CHECK-NEXT: entry: 416*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 417*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 418*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 419*207e5cccSFangrui Song // 420*207e5cccSFangrui Song svint64_t leq_i64(svint64_t a, svint64_t b) { 421*207e5cccSFangrui Song return a <= b; 422*207e5cccSFangrui Song } 423*207e5cccSFangrui Song 424*207e5cccSFangrui Song // CHECK-LABEL: @leq_u8( 425*207e5cccSFangrui Song // CHECK-NEXT: entry: 426*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 427*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 428*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 429*207e5cccSFangrui Song // 430*207e5cccSFangrui Song svint8_t leq_u8(svuint8_t a, svuint8_t b) { 431*207e5cccSFangrui Song return a <= b; 432*207e5cccSFangrui Song } 433*207e5cccSFangrui Song 434*207e5cccSFangrui Song // CHECK-LABEL: @leq_u16( 435*207e5cccSFangrui Song // CHECK-NEXT: entry: 436*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 437*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 438*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 439*207e5cccSFangrui Song // 440*207e5cccSFangrui Song svint16_t leq_u16(svuint16_t a, svuint16_t b) { 441*207e5cccSFangrui Song return a <= b; 442*207e5cccSFangrui Song } 443*207e5cccSFangrui Song 444*207e5cccSFangrui Song // CHECK-LABEL: @leq_u32( 445*207e5cccSFangrui Song // CHECK-NEXT: entry: 446*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 447*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 448*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 449*207e5cccSFangrui Song // 450*207e5cccSFangrui Song svint32_t leq_u32(svuint32_t a, svuint32_t b) { 451*207e5cccSFangrui Song return a <= b; 452*207e5cccSFangrui Song } 453*207e5cccSFangrui Song 454*207e5cccSFangrui Song // CHECK-LABEL: @leq_u64( 455*207e5cccSFangrui Song // CHECK-NEXT: entry: 456*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ule <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 457*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 458*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 459*207e5cccSFangrui Song // 460*207e5cccSFangrui Song svint64_t leq_u64(svuint64_t a, svuint64_t b) { 461*207e5cccSFangrui Song return a <= b; 462*207e5cccSFangrui Song } 463*207e5cccSFangrui Song 464*207e5cccSFangrui Song // CHECK-LABEL: @leq_f16( 465*207e5cccSFangrui Song // CHECK-NEXT: entry: 466*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp ole <vscale x 8 x half> [[A:%.*]], [[B:%.*]] 467*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 468*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 469*207e5cccSFangrui Song // 470*207e5cccSFangrui Song svint16_t leq_f16(svfloat16_t a, svfloat16_t b) { 471*207e5cccSFangrui Song return a <= b; 472*207e5cccSFangrui Song } 473*207e5cccSFangrui Song 474*207e5cccSFangrui Song // CHECK-LABEL: @leq_f32( 475*207e5cccSFangrui Song // CHECK-NEXT: entry: 476*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp ole <vscale x 4 x float> [[A:%.*]], [[B:%.*]] 477*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 478*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 479*207e5cccSFangrui Song // 480*207e5cccSFangrui Song svint32_t leq_f32(svfloat32_t a, svfloat32_t b) { 481*207e5cccSFangrui Song return a <= b; 482*207e5cccSFangrui Song } 483*207e5cccSFangrui Song 484*207e5cccSFangrui Song // CHECK-LABEL: @leq_f64( 485*207e5cccSFangrui Song // CHECK-NEXT: entry: 486*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp ole <vscale x 2 x double> [[A:%.*]], [[B:%.*]] 487*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 488*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 489*207e5cccSFangrui Song // 490*207e5cccSFangrui Song svint64_t leq_f64(svfloat64_t a, svfloat64_t b) { 491*207e5cccSFangrui Song return a <= b; 492*207e5cccSFangrui Song } 493*207e5cccSFangrui Song 494*207e5cccSFangrui Song // GT 495*207e5cccSFangrui Song 496*207e5cccSFangrui Song // CHECK-LABEL: @gt_bool( 497*207e5cccSFangrui Song // CHECK-NEXT: entry: 498*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 16 x i1> [[A:%.*]], [[B:%.*]] 499*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i1> [[CMP]] 500*207e5cccSFangrui Song // 501*207e5cccSFangrui Song svbool_t gt_bool(svbool_t a, svbool_t b) { 502*207e5cccSFangrui Song return a > b; 503*207e5cccSFangrui Song } 504*207e5cccSFangrui Song 505*207e5cccSFangrui Song // CHECK-LABEL: @gt_i8( 506*207e5cccSFangrui Song // CHECK-NEXT: entry: 507*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 508*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 509*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 510*207e5cccSFangrui Song // 511*207e5cccSFangrui Song svint8_t gt_i8(svint8_t a, svint8_t b) { 512*207e5cccSFangrui Song return a > b; 513*207e5cccSFangrui Song } 514*207e5cccSFangrui Song 515*207e5cccSFangrui Song // CHECK-LABEL: @gt_i16( 516*207e5cccSFangrui Song // CHECK-NEXT: entry: 517*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 518*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 519*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 520*207e5cccSFangrui Song // 521*207e5cccSFangrui Song svint16_t gt_i16(svint16_t a, svint16_t b) { 522*207e5cccSFangrui Song return a > b; 523*207e5cccSFangrui Song } 524*207e5cccSFangrui Song 525*207e5cccSFangrui Song // CHECK-LABEL: @gt_i32( 526*207e5cccSFangrui Song // CHECK-NEXT: entry: 527*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 528*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 529*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 530*207e5cccSFangrui Song // 531*207e5cccSFangrui Song svint32_t gt_i32(svint32_t a, svint32_t b) { 532*207e5cccSFangrui Song return a > b; 533*207e5cccSFangrui Song } 534*207e5cccSFangrui Song 535*207e5cccSFangrui Song // CHECK-LABEL: @gt_i64( 536*207e5cccSFangrui Song // CHECK-NEXT: entry: 537*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 538*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 539*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 540*207e5cccSFangrui Song // 541*207e5cccSFangrui Song svint64_t gt_i64(svint64_t a, svint64_t b) { 542*207e5cccSFangrui Song return a > b; 543*207e5cccSFangrui Song } 544*207e5cccSFangrui Song 545*207e5cccSFangrui Song // CHECK-LABEL: @gt_u8( 546*207e5cccSFangrui Song // CHECK-NEXT: entry: 547*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 548*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 549*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 550*207e5cccSFangrui Song // 551*207e5cccSFangrui Song svint8_t gt_u8(svuint8_t a, svuint8_t b) { 552*207e5cccSFangrui Song return a > b; 553*207e5cccSFangrui Song } 554*207e5cccSFangrui Song 555*207e5cccSFangrui Song // CHECK-LABEL: @gt_u16( 556*207e5cccSFangrui Song // CHECK-NEXT: entry: 557*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 558*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 559*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 560*207e5cccSFangrui Song // 561*207e5cccSFangrui Song svint16_t gt_u16(svuint16_t a, svuint16_t b) { 562*207e5cccSFangrui Song return a > b; 563*207e5cccSFangrui Song } 564*207e5cccSFangrui Song 565*207e5cccSFangrui Song // CHECK-LABEL: @gt_u32( 566*207e5cccSFangrui Song // CHECK-NEXT: entry: 567*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 568*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 569*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 570*207e5cccSFangrui Song // 571*207e5cccSFangrui Song svint32_t gt_u32(svuint32_t a, svuint32_t b) { 572*207e5cccSFangrui Song return a > b; 573*207e5cccSFangrui Song } 574*207e5cccSFangrui Song 575*207e5cccSFangrui Song // CHECK-LABEL: @gt_u64( 576*207e5cccSFangrui Song // CHECK-NEXT: entry: 577*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp ugt <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 578*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 579*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 580*207e5cccSFangrui Song // 581*207e5cccSFangrui Song svint64_t gt_u64(svuint64_t a, svuint64_t b) { 582*207e5cccSFangrui Song return a > b; 583*207e5cccSFangrui Song } 584*207e5cccSFangrui Song 585*207e5cccSFangrui Song // CHECK-LABEL: @gt_f16( 586*207e5cccSFangrui Song // CHECK-NEXT: entry: 587*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp ogt <vscale x 8 x half> [[A:%.*]], [[B:%.*]] 588*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 589*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 590*207e5cccSFangrui Song // 591*207e5cccSFangrui Song svint16_t gt_f16(svfloat16_t a, svfloat16_t b) { 592*207e5cccSFangrui Song return a > b; 593*207e5cccSFangrui Song } 594*207e5cccSFangrui Song 595*207e5cccSFangrui Song // CHECK-LABEL: @gt_f32( 596*207e5cccSFangrui Song // CHECK-NEXT: entry: 597*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp ogt <vscale x 4 x float> [[A:%.*]], [[B:%.*]] 598*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 599*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 600*207e5cccSFangrui Song // 601*207e5cccSFangrui Song svint32_t gt_f32(svfloat32_t a, svfloat32_t b) { 602*207e5cccSFangrui Song return a > b; 603*207e5cccSFangrui Song } 604*207e5cccSFangrui Song 605*207e5cccSFangrui Song // CHECK-LABEL: @gt_f64( 606*207e5cccSFangrui Song // CHECK-NEXT: entry: 607*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp ogt <vscale x 2 x double> [[A:%.*]], [[B:%.*]] 608*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 609*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 610*207e5cccSFangrui Song // 611*207e5cccSFangrui Song svint64_t gt_f64(svfloat64_t a, svfloat64_t b) { 612*207e5cccSFangrui Song return a > b; 613*207e5cccSFangrui Song } 614*207e5cccSFangrui Song 615*207e5cccSFangrui Song // GEQ 616*207e5cccSFangrui Song 617*207e5cccSFangrui Song // CHECK-LABEL: @geq_bool( 618*207e5cccSFangrui Song // CHECK-NEXT: entry: 619*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 16 x i1> [[A:%.*]], [[B:%.*]] 620*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i1> [[CMP]] 621*207e5cccSFangrui Song // 622*207e5cccSFangrui Song svbool_t geq_bool(svbool_t a, svbool_t b) { 623*207e5cccSFangrui Song return a >= b; 624*207e5cccSFangrui Song } 625*207e5cccSFangrui Song 626*207e5cccSFangrui Song // CHECK-LABEL: @geq_i8( 627*207e5cccSFangrui Song // CHECK-NEXT: entry: 628*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 629*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 630*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 631*207e5cccSFangrui Song // 632*207e5cccSFangrui Song svint8_t geq_i8(svint8_t a, svint8_t b) { 633*207e5cccSFangrui Song return a >= b; 634*207e5cccSFangrui Song } 635*207e5cccSFangrui Song 636*207e5cccSFangrui Song // CHECK-LABEL: @geq_i16( 637*207e5cccSFangrui Song // CHECK-NEXT: entry: 638*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 639*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 640*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 641*207e5cccSFangrui Song // 642*207e5cccSFangrui Song svint16_t geq_i16(svint16_t a, svint16_t b) { 643*207e5cccSFangrui Song return a >= b; 644*207e5cccSFangrui Song } 645*207e5cccSFangrui Song 646*207e5cccSFangrui Song // CHECK-LABEL: @geq_i32( 647*207e5cccSFangrui Song // CHECK-NEXT: entry: 648*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 649*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 650*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 651*207e5cccSFangrui Song // 652*207e5cccSFangrui Song svint32_t geq_i32(svint32_t a, svint32_t b) { 653*207e5cccSFangrui Song return a >= b; 654*207e5cccSFangrui Song } 655*207e5cccSFangrui Song 656*207e5cccSFangrui Song // CHECK-LABEL: @geq_i64( 657*207e5cccSFangrui Song // CHECK-NEXT: entry: 658*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 659*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 660*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 661*207e5cccSFangrui Song // 662*207e5cccSFangrui Song svint64_t geq_i64(svint64_t a, svint64_t b) { 663*207e5cccSFangrui Song return a >= b; 664*207e5cccSFangrui Song } 665*207e5cccSFangrui Song 666*207e5cccSFangrui Song // CHECK-LABEL: @geq_u8( 667*207e5cccSFangrui Song // CHECK-NEXT: entry: 668*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 16 x i8> [[A:%.*]], [[B:%.*]] 669*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 16 x i1> [[CMP]] to <vscale x 16 x i8> 670*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 16 x i8> [[CONV]] 671*207e5cccSFangrui Song // 672*207e5cccSFangrui Song svint8_t geq_u8(svuint8_t a, svuint8_t b) { 673*207e5cccSFangrui Song return a >= b; 674*207e5cccSFangrui Song } 675*207e5cccSFangrui Song 676*207e5cccSFangrui Song // CHECK-LABEL: @geq_u16( 677*207e5cccSFangrui Song // CHECK-NEXT: entry: 678*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 8 x i16> [[A:%.*]], [[B:%.*]] 679*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 680*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 681*207e5cccSFangrui Song // 682*207e5cccSFangrui Song svint16_t geq_u16(svuint16_t a, svuint16_t b) { 683*207e5cccSFangrui Song return a >= b; 684*207e5cccSFangrui Song } 685*207e5cccSFangrui Song 686*207e5cccSFangrui Song // CHECK-LABEL: @geq_u32( 687*207e5cccSFangrui Song // CHECK-NEXT: entry: 688*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 4 x i32> [[A:%.*]], [[B:%.*]] 689*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 690*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 691*207e5cccSFangrui Song // 692*207e5cccSFangrui Song svint32_t geq_u32(svuint32_t a, svuint32_t b) { 693*207e5cccSFangrui Song return a >= b; 694*207e5cccSFangrui Song } 695*207e5cccSFangrui Song 696*207e5cccSFangrui Song // CHECK-LABEL: @geq_u64( 697*207e5cccSFangrui Song // CHECK-NEXT: entry: 698*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = icmp uge <vscale x 2 x i64> [[A:%.*]], [[B:%.*]] 699*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 700*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 701*207e5cccSFangrui Song // 702*207e5cccSFangrui Song svint64_t geq_u64(svuint64_t a, svuint64_t b) { 703*207e5cccSFangrui Song return a >= b; 704*207e5cccSFangrui Song } 705*207e5cccSFangrui Song 706*207e5cccSFangrui Song // CHECK-LABEL: @geq_f16( 707*207e5cccSFangrui Song // CHECK-NEXT: entry: 708*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp oge <vscale x 8 x half> [[A:%.*]], [[B:%.*]] 709*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 8 x i1> [[CMP]] to <vscale x 8 x i16> 710*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 8 x i16> [[CONV]] 711*207e5cccSFangrui Song // 712*207e5cccSFangrui Song svint16_t geq_f16(svfloat16_t a, svfloat16_t b) { 713*207e5cccSFangrui Song return a >= b; 714*207e5cccSFangrui Song } 715*207e5cccSFangrui Song 716*207e5cccSFangrui Song // CHECK-LABEL: @geq_f32( 717*207e5cccSFangrui Song // CHECK-NEXT: entry: 718*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp oge <vscale x 4 x float> [[A:%.*]], [[B:%.*]] 719*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 4 x i1> [[CMP]] to <vscale x 4 x i32> 720*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 4 x i32> [[CONV]] 721*207e5cccSFangrui Song // 722*207e5cccSFangrui Song svint32_t geq_f32(svfloat32_t a, svfloat32_t b) { 723*207e5cccSFangrui Song return a >= b; 724*207e5cccSFangrui Song } 725*207e5cccSFangrui Song 726*207e5cccSFangrui Song // CHECK-LABEL: @geq_f64( 727*207e5cccSFangrui Song // CHECK-NEXT: entry: 728*207e5cccSFangrui Song // CHECK-NEXT: [[CMP:%.*]] = fcmp oge <vscale x 2 x double> [[A:%.*]], [[B:%.*]] 729*207e5cccSFangrui Song // CHECK-NEXT: [[CONV:%.*]] = zext <vscale x 2 x i1> [[CMP]] to <vscale x 2 x i64> 730*207e5cccSFangrui Song // CHECK-NEXT: ret <vscale x 2 x i64> [[CONV]] 731*207e5cccSFangrui Song // 732*207e5cccSFangrui Song svint64_t geq_f64(svfloat64_t a, svfloat64_t b) { 733*207e5cccSFangrui Song return a >= b; 734*207e5cccSFangrui Song } 735