; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Signed Comparisons ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; CMPEQ ; define @ir_cmpeq_b( %a) { ; CHECK-LABEL: ir_cmpeq_b ; CHECK: cmpeq p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp eq %a, %splat ret %out } define @int_cmpeq_b( %pg, %a) { ; CHECK-LABEL: int_cmpeq_b ; CHECK: cmpeq p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpeq.nxv16i8( %pg, %a, %splat) ret %out } define @wide_cmpeq_b( %pg, %a) { ; CHECK-LABEL: wide_cmpeq_b ; CHECK: cmpeq p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpeq.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmpeq_h( %a) { ; CHECK-LABEL: ir_cmpeq_h ; CHECK: cmpeq p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp eq %a, %splat ret %out } define @int_cmpeq_h( %pg, %a) { ; CHECK-LABEL: int_cmpeq_h ; CHECK: cmpeq p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpeq.nxv8i16( %pg, %a, %splat) ret %out } define @wide_cmpeq_h( %pg, %a) { ; CHECK-LABEL: wide_cmpeq_h ; CHECK: cmpeq p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i64 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpeq.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmpeq_s( %a) { ; CHECK-LABEL: ir_cmpeq_s ; CHECK: cmpeq p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp eq %a, %splat ret %out } define @int_cmpeq_s( %pg, %a) { ; CHECK-LABEL: int_cmpeq_s ; CHECK: cmpeq p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpeq.nxv4i32( %pg, %a, %splat) ret %out } define @wide_cmpeq_s( %pg, %a) { ; CHECK-LABEL: wide_cmpeq_s ; CHECK: cmpeq p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i64 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpeq.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmpeq_d( %a) { ; CHECK-LABEL: ir_cmpeq_d ; CHECK: cmpeq p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp eq %a, %splat ret %out } define @int_cmpeq_d( %pg, %a) { ; CHECK-LABEL: int_cmpeq_d ; CHECK: cmpeq p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpeq.nxv2i64( %pg, %a, %splat) ret %out } ; ; CMPGE ; define @ir_cmpge_b( %a) { ; CHECK-LABEL: ir_cmpge_b ; CHECK: cmpge p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sge %a, %splat ret %out } define @int_cmpge_b( %pg, %a) { ; CHECK-LABEL: int_cmpge_b ; CHECK: cmpge p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.nxv16i8( %pg, %a, %splat) ret %out } define @wide_cmpge_b( %pg, %a) { ; CHECK-LABEL: wide_cmpge_b ; CHECK: cmpge p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmpge_h( %a) { ; CHECK-LABEL: ir_cmpge_h ; CHECK: cmpge p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sge %a, %splat ret %out } define @int_cmpge_h( %pg, %a) { ; CHECK-LABEL: int_cmpge_h ; CHECK: cmpge p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.nxv8i16( %pg, %a, %splat) ret %out } define @wide_cmpge_h( %pg, %a) { ; CHECK-LABEL: wide_cmpge_h ; CHECK: cmpge p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i64 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmpge_s( %a) { ; CHECK-LABEL: ir_cmpge_s ; CHECK: cmpge p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sge %a, %splat ret %out } define @int_cmpge_s( %pg, %a) { ; CHECK-LABEL: int_cmpge_s ; CHECK: cmpge p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.nxv4i32( %pg, %a, %splat) ret %out } define @wide_cmpge_s( %pg, %a) { ; CHECK-LABEL: wide_cmpge_s ; CHECK: cmpge p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i64 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmpge_d( %a) { ; CHECK-LABEL: ir_cmpge_d ; CHECK: cmpge p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sge %a, %splat ret %out } define @int_cmpge_d( %pg, %a) { ; CHECK-LABEL: int_cmpge_d ; CHECK: cmpge p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.nxv2i64( %pg, %a, %splat) ret %out } ; ; CMPGT ; define @ir_cmpgt_b( %a) { ; CHECK-LABEL: ir_cmpgt_b ; CHECK: cmpgt p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sgt %a, %splat ret %out } define @int_cmpgt_b( %pg, %a) { ; CHECK-LABEL: int_cmpgt_b ; CHECK: cmpgt p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.nxv16i8( %pg, %a, %splat) ret %out } define @wide_cmpgt_b( %pg, %a) { ; CHECK-LABEL: wide_cmpgt_b ; CHECK: cmpgt p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmpgt_h( %a) { ; CHECK-LABEL: ir_cmpgt_h ; CHECK: cmpgt p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sgt %a, %splat ret %out } define @int_cmpgt_h( %pg, %a) { ; CHECK-LABEL: int_cmpgt_h ; CHECK: cmpgt p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.nxv8i16( %pg, %a, %splat) ret %out } define @wide_cmpgt_h( %pg, %a) { ; CHECK-LABEL: wide_cmpgt_h ; CHECK: cmpgt p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i64 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmpgt_s( %a) { ; CHECK-LABEL: ir_cmpgt_s ; CHECK: cmpgt p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sgt %a, %splat ret %out } define @int_cmpgt_s( %pg, %a) { ; CHECK-LABEL: int_cmpgt_s ; CHECK: cmpgt p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.nxv4i32( %pg, %a, %splat) ret %out } define @wide_cmpgt_s( %pg, %a) { ; CHECK-LABEL: wide_cmpgt_s ; CHECK: cmpgt p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i64 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmpgt_d( %a) { ; CHECK-LABEL: ir_cmpgt_d ; CHECK: cmpgt p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sgt %a, %splat ret %out } define @int_cmpgt_d( %pg, %a) { ; CHECK-LABEL: int_cmpgt_d ; CHECK: cmpgt p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.nxv2i64( %pg, %a, %splat) ret %out } ; ; CMPLE ; define @ir_cmple_b( %a) { ; CHECK-LABEL: ir_cmple_b ; CHECK: cmple p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sle %a, %splat ret %out } define @int_cmple_b( %pg, %a) { ; CHECK-LABEL: int_cmple_b ; CHECK: cmple p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.nxv16i8( %pg, %splat, %a) ret %out } define @wide_cmple_b( %pg, %a) { ; CHECK-LABEL: wide_cmple_b ; CHECK: cmple p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmple.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmple_h( %a) { ; CHECK-LABEL: ir_cmple_h ; CHECK: cmple p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sle %a, %splat ret %out } define @int_cmple_h( %pg, %a) { ; CHECK-LABEL: int_cmple_h ; CHECK: cmple p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.nxv8i16( %pg, %splat, %a) ret %out } define @wide_cmple_h( %pg, %a) { ; CHECK-LABEL: wide_cmple_h ; CHECK: cmple p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i64 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmple.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmple_s( %a) { ; CHECK-LABEL: ir_cmple_s ; CHECK: cmple p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sle %a, %splat ret %out } define @int_cmple_s( %pg, %a) { ; CHECK-LABEL: int_cmple_s ; CHECK: cmple p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.nxv4i32( %pg, %splat, %a) ret %out } define @wide_cmple_s( %pg, %a) { ; CHECK-LABEL: wide_cmple_s ; CHECK: cmple p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i64 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmple.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmple_d( %a) { ; CHECK-LABEL: ir_cmple_d ; CHECK: cmple p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp sle %a, %splat ret %out } define @int_cmple_d( %pg, %a) { ; CHECK-LABEL: int_cmple_d ; CHECK: cmple p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpge.nxv2i64( %pg, %splat, %a) ret %out } ; ; CMPLT ; define @ir_cmplt_b( %a) { ; CHECK-LABEL: ir_cmplt_b ; CHECK: cmplt p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp slt %a, %splat ret %out } define @int_cmplt_b( %pg, %a) { ; CHECK-LABEL: int_cmplt_b ; CHECK: cmplt p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.nxv16i8( %pg, %splat, %a) ret %out } define @wide_cmplt_b( %pg, %a) { ; CHECK-LABEL: wide_cmplt_b ; CHECK: cmplt p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmplt.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmplt_h( %a) { ; CHECK-LABEL: ir_cmplt_h ; CHECK: cmplt p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp slt %a, %splat ret %out } define @int_cmplt_h( %pg, %a) { ; CHECK-LABEL: int_cmplt_h ; CHECK: cmplt p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.nxv8i16( %pg, %splat, %a) ret %out } define @wide_cmplt_h( %pg, %a) { ; CHECK-LABEL: wide_cmplt_h ; CHECK: cmplt p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i64 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmplt.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmplt_s( %a) { ; CHECK-LABEL: ir_cmplt_s ; CHECK: cmplt p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp slt %a, %splat ret %out } define @int_cmplt_s( %pg, %a) { ; CHECK-LABEL: int_cmplt_s ; CHECK: cmplt p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.nxv4i32( %pg, %splat, %a) ret %out } define @wide_cmplt_s( %pg, %a) { ; CHECK-LABEL: wide_cmplt_s ; CHECK: cmplt p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i64 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmplt.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmplt_d( %a) { ; CHECK-LABEL: ir_cmplt_d ; CHECK: cmplt p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp slt %a, %splat ret %out } define @int_cmplt_d( %pg, %a) { ; CHECK-LABEL: int_cmplt_d ; CHECK: cmplt p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpgt.nxv2i64( %pg, %splat, %a) ret %out } ; ; CMPNE ; define @ir_cmpne_b( %a) { ; CHECK-LABEL: ir_cmpne_b ; CHECK: cmpne p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ne %a, %splat ret %out } define @int_cmpne_b( %pg, %a) { ; CHECK-LABEL: int_cmpne_b ; CHECK: cmpne p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpne.nxv16i8( %pg, %a, %splat) ret %out } define @wide_cmpne_b( %pg, %a) { ; CHECK-LABEL: wide_cmpne_b ; CHECK: cmpne p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpne.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmpne_h( %a) { ; CHECK-LABEL: ir_cmpne_h ; CHECK: cmpne p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ne %a, %splat ret %out } define @int_cmpne_h( %pg, %a) { ; CHECK-LABEL: int_cmpne_h ; CHECK: cmpne p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i16 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpne.nxv8i16( %pg, %a, %splat) ret %out } define @wide_cmpne_h( %pg, %a) { ; CHECK-LABEL: wide_cmpne_h ; CHECK: cmpne p0.h, p0/z, z0.h, #-16 ; CHECK-NEXT: ret %elt = insertelement undef, i64 -16, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpne.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmpne_s( %a) { ; CHECK-LABEL: ir_cmpne_s ; CHECK: cmpne p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ne %a, %splat ret %out } define @int_cmpne_s( %pg, %a) { ; CHECK-LABEL: int_cmpne_s ; CHECK: cmpne p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i32 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpne.nxv4i32( %pg, %a, %splat) ret %out } define @wide_cmpne_s( %pg, %a) { ; CHECK-LABEL: wide_cmpne_s ; CHECK: cmpne p0.s, p0/z, z0.s, #15 ; CHECK-NEXT: ret %elt = insertelement undef, i64 15, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpne.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmpne_d( %a) { ; CHECK-LABEL: ir_cmpne_d ; CHECK: cmpne p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ne %a, %splat ret %out } define @int_cmpne_d( %pg, %a) { ; CHECK-LABEL: int_cmpne_d ; CHECK: cmpne p0.d, p0/z, z0.d, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpne.nxv2i64( %pg, %a, %splat) ret %out } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Unsigned Comparisons ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; CMPHI ; define @ir_cmphi_b( %a) { ; CHECK-LABEL: ir_cmphi_b ; CHECK: cmphi p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ugt %a, %splat ret %out } define @int_cmphi_b( %pg, %a) { ; CHECK-LABEL: int_cmphi_b ; CHECK: cmphi p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.nxv16i8( %pg, %a, %splat) ret %out } define @wide_cmphi_b( %pg, %a) { ; CHECK-LABEL: wide_cmphi_b ; CHECK: cmphi p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmphi_h( %a) { ; CHECK-LABEL: ir_cmphi_h ; CHECK: cmpne p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i16 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ugt %a, %splat ret %out } define @int_cmphi_h( %pg, %a) { ; CHECK-LABEL: int_cmphi_h ; CHECK: cmphi p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i16 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.nxv8i16( %pg, %a, %splat) ret %out } define @wide_cmphi_h( %pg, %a) { ; CHECK-LABEL: wide_cmphi_h ; CHECK: cmphi p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmphi_s( %a) { ; CHECK-LABEL: ir_cmphi_s ; CHECK: cmphi p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i32 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ugt %a, %splat ret %out } define @int_cmphi_s( %pg, %a) { ; CHECK-LABEL: int_cmphi_s ; CHECK: cmphi p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i32 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.nxv4i32( %pg, %a, %splat) ret %out } define @wide_cmphi_s( %pg, %a) { ; CHECK-LABEL: wide_cmphi_s ; CHECK: cmphi p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i64 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmphi_d( %a) { ; CHECK-LABEL: ir_cmphi_d ; CHECK: cmphi p0.d, p0/z, z0.d, #127 ; CHECK-NEXT: ret %elt = insertelement undef, i64 127, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ugt %a, %splat ret %out } define @int_cmphi_d( %pg, %a) { ; CHECK-LABEL: int_cmphi_d ; CHECK: cmphi p0.d, p0/z, z0.d, #127 ; CHECK-NEXT: ret %elt = insertelement undef, i64 127, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.nxv2i64( %pg, %a, %splat) ret %out } ; ; CMPHS ; define @ir_cmphs_b( %a) { ; CHECK-LABEL: ir_cmphs_b ; CHECK: cmphs p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp uge %a, %splat ret %out } define @int_cmphs_b( %pg, %a) { ; CHECK-LABEL: int_cmphs_b ; CHECK: cmphs p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.nxv16i8( %pg, %a, %splat) ret %out } define @wide_cmphs_b( %pg, %a) { ; CHECK-LABEL: wide_cmphs_b ; CHECK: cmphs p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmphs_h( %a) { ; CHECK-LABEL: ir_cmphs_h ; CHECK: ptrue p0.h ; CHECK-NEXT: ret %elt = insertelement undef, i16 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp uge %a, %splat ret %out } define @int_cmphs_h( %pg, %a) { ; CHECK-LABEL: int_cmphs_h ; CHECK: cmphs p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i16 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.nxv8i16( %pg, %a, %splat) ret %out } define @wide_cmphs_h( %pg, %a) { ; CHECK-LABEL: wide_cmphs_h ; CHECK: cmphs p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmphs_s( %a) { ; CHECK-LABEL: ir_cmphs_s ; CHECK: cmphs p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i32 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp uge %a, %splat ret %out } define @int_cmphs_s( %pg, %a) { ; CHECK-LABEL: int_cmphs_s ; CHECK: cmphs p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i32 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.nxv4i32( %pg, %a, %splat) ret %out } define @wide_cmphs_s( %pg, %a) { ; CHECK-LABEL: wide_cmphs_s ; CHECK: cmphs p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i64 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmphs_d( %a) { ; CHECK-LABEL: ir_cmphs_d ; CHECK: cmphs p0.d, p0/z, z0.d, #127 ; CHECK-NEXT: ret %elt = insertelement undef, i64 127, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp uge %a, %splat ret %out } define @int_cmphs_d( %pg, %a) { ; CHECK-LABEL: int_cmphs_d ; CHECK: cmphs p0.d, p0/z, z0.d, #127 ; CHECK-NEXT: ret %elt = insertelement undef, i64 127, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.nxv2i64( %pg, %a, %splat) ret %out } ; ; CMPLO ; define @ir_cmplo_b( %a) { ; CHECK-LABEL: ir_cmplo_b ; CHECK: cmplo p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ult %a, %splat ret %out } define @int_cmplo_b( %pg, %a) { ; CHECK-LABEL: int_cmplo_b ; CHECK: cmplo p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.nxv16i8( %pg, %splat, %a) ret %out } define @wide_cmplo_b( %pg, %a) { ; CHECK-LABEL: wide_cmplo_b ; CHECK: cmplo p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmplo.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmplo_h( %a) { ; CHECK-LABEL: ir_cmplo_h ; CHECK: whilelo p0.h, xzr, xzr ; CHECK-NEXT: ret %elt = insertelement undef, i16 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ult %a, %splat ret %out } define @int_cmplo_h( %pg, %a) { ; CHECK-LABEL: int_cmplo_h ; CHECK: cmplo p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i16 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.nxv8i16( %pg, %splat, %a) ret %out } define @wide_cmplo_h( %pg, %a) { ; CHECK-LABEL: wide_cmplo_h ; CHECK: cmplo p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmplo.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmplo_s( %a) { ; CHECK-LABEL: ir_cmplo_s ; CHECK: cmplo p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i32 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ult %a, %splat ret %out } define @int_cmplo_s( %pg, %a) { ; CHECK-LABEL: int_cmplo_s ; CHECK: cmplo p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i32 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.nxv4i32( %pg, %splat, %a) ret %out } define @wide_cmplo_s( %pg, %a) { ; CHECK-LABEL: wide_cmplo_s ; CHECK: cmplo p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i64 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmplo.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmplo_d( %a) { ; CHECK-LABEL: ir_cmplo_d ; CHECK: cmplo p0.d, p0/z, z0.d, #127 ; CHECK-NEXT: ret %elt = insertelement undef, i64 127, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ult %a, %splat ret %out } define @int_cmplo_d( %pg, %a) { ; CHECK-LABEL: int_cmplo_d ; CHECK: cmplo p0.d, p0/z, z0.d, #127 ; CHECK-NEXT: ret %elt = insertelement undef, i64 127, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphi.nxv2i64( %pg, %splat, %a) ret %out } ; ; CMPLS ; define @ir_cmpls_b( %a) { ; CHECK-LABEL: ir_cmpls_b ; CHECK: cmpls p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ule %a, %splat ret %out } define @int_cmpls_b( %pg, %a) { ; CHECK-LABEL: int_cmpls_b ; CHECK: cmpls p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i8 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.nxv16i8( %pg, %splat, %a) ret %out } define @wide_cmpls_b( %pg, %a) { ; CHECK-LABEL: wide_cmpls_b ; CHECK: cmpls p0.b, p0/z, z0.b, #4 ; CHECK-NEXT: ret %elt = insertelement undef, i64 4, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpls.wide.nxv16i8( %pg, %a, %splat) ret %out } define @ir_cmpls_h( %a) { ; CHECK-LABEL: ir_cmpls_h ; CHECK: cmpls p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i16 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ule %a, %splat ret %out } define @int_cmpls_h( %pg, %a) { ; CHECK-LABEL: int_cmpls_h ; CHECK: cmpls p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i16 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.nxv8i16( %pg, %splat, %a) ret %out } define @wide_cmpls_h( %pg, %a) { ; CHECK-LABEL: wide_cmpls_h ; CHECK: cmpls p0.h, p0/z, z0.h, #0 ; CHECK-NEXT: ret %elt = insertelement undef, i64 0, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpls.wide.nxv8i16( %pg, %a, %splat) ret %out } define @ir_cmpls_s( %a) { ; CHECK-LABEL: ir_cmpls_s ; CHECK: cmpls p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i32 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ule %a, %splat ret %out } define @int_cmpls_s( %pg, %a) { ; CHECK-LABEL: int_cmpls_s ; CHECK: cmpls p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i32 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.nxv4i32( %pg, %splat, %a) ret %out } define @wide_cmpls_s( %pg, %a) { ; CHECK-LABEL: wide_cmpls_s ; CHECK: cmpls p0.s, p0/z, z0.s, #68 ; CHECK-NEXT: ret %elt = insertelement undef, i64 68, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmpls.wide.nxv4i32( %pg, %a, %splat) ret %out } define @ir_cmpls_d( %a) { ; CHECK-LABEL: ir_cmpls_d ; CHECK: cmpls p0.d, p0/z, z0.d, #127 ; CHECK-NEXT: ret %elt = insertelement undef, i64 127, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = icmp ule %a, %splat ret %out } define @int_cmpls_d( %pg, %a) { ; CHECK-LABEL: int_cmpls_d ; CHECK: cmpls p0.d, p0/z, z0.d, #127 ; CHECK-NEXT: ret %elt = insertelement undef, i64 127, i32 0 %splat = shufflevector %elt, undef, zeroinitializer %out = call @llvm.aarch64.sve.cmphs.nxv2i64( %pg, %splat, %a) ret %out } declare @llvm.aarch64.sve.cmpeq.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpeq.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpeq.nxv4i32(, , ) declare @llvm.aarch64.sve.cmpeq.nxv2i64(, , ) declare @llvm.aarch64.sve.cmpeq.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpeq.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpeq.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmpge.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpge.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpge.nxv4i32(, , ) declare @llvm.aarch64.sve.cmpge.nxv2i64(, , ) declare @llvm.aarch64.sve.cmpge.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpge.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpge.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmpgt.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpgt.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpgt.nxv4i32(, , ) declare @llvm.aarch64.sve.cmpgt.nxv2i64(, , ) declare @llvm.aarch64.sve.cmpgt.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpgt.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpgt.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmphi.nxv16i8(, , ) declare @llvm.aarch64.sve.cmphi.nxv8i16(, , ) declare @llvm.aarch64.sve.cmphi.nxv4i32(, , ) declare @llvm.aarch64.sve.cmphi.nxv2i64(, , ) declare @llvm.aarch64.sve.cmphi.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmphi.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmphi.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmphs.nxv16i8(, , ) declare @llvm.aarch64.sve.cmphs.nxv8i16(, , ) declare @llvm.aarch64.sve.cmphs.nxv4i32(, , ) declare @llvm.aarch64.sve.cmphs.nxv2i64(, , ) declare @llvm.aarch64.sve.cmphs.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmphs.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmphs.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmple.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmple.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmple.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmplo.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmplo.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmplo.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmpls.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpls.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpls.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmplt.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmplt.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmplt.wide.nxv4i32(, , ) declare @llvm.aarch64.sve.cmpne.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpne.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpne.nxv4i32(, , ) declare @llvm.aarch64.sve.cmpne.nxv2i64(, , ) declare @llvm.aarch64.sve.cmpne.wide.nxv16i8(, , ) declare @llvm.aarch64.sve.cmpne.wide.nxv8i16(, , ) declare @llvm.aarch64.sve.cmpne.wide.nxv4i32(, , )