forked from OSchip/llvm-project
127 lines
6.0 KiB
LLVM
127 lines
6.0 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
; RUN: llc -mtriple=thumbv8.1m.main-arm-none-eabi -mattr=+mve.fp -enable-arm-maskedgatscat %s -o - | FileCheck %s
|
|
|
|
define arm_aapcs_vfpcc <8 x i16> @zext_unscaled_i8_i16(i8* %base, <8 x i16>* %offptr) {
|
|
; CHECK-LABEL: zext_unscaled_i8_i16:
|
|
; CHECK: @ %bb.0: @ %entry
|
|
; CHECK-NEXT: vldrh.u16 q1, [r1]
|
|
; CHECK-NEXT: vldrb.u16 q0, [r0, q1]
|
|
; CHECK-NEXT: bx lr
|
|
entry:
|
|
%offs = load <8 x i16>, <8 x i16>* %offptr, align 2
|
|
%offs.zext = zext <8 x i16> %offs to <8 x i32>
|
|
%ptrs = getelementptr inbounds i8, i8* %base, <8 x i32> %offs.zext
|
|
%gather = call <8 x i8> @llvm.masked.gather.v8i8.v8p0i8(<8 x i8*> %ptrs, i32 1, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i8> undef)
|
|
%gather.zext = zext <8 x i8> %gather to <8 x i16>
|
|
ret <8 x i16> %gather.zext
|
|
}
|
|
|
|
define arm_aapcs_vfpcc <8 x i16> @sext_unscaled_i8_i16(i8* %base, <8 x i16>* %offptr) {
|
|
; CHECK-LABEL: sext_unscaled_i8_i16:
|
|
; CHECK: @ %bb.0: @ %entry
|
|
; CHECK-NEXT: vldrh.u16 q1, [r1]
|
|
; CHECK-NEXT: vldrb.s16 q0, [r0, q1]
|
|
; CHECK-NEXT: bx lr
|
|
entry:
|
|
%offs = load <8 x i16>, <8 x i16>* %offptr, align 2
|
|
%offs.zext = zext <8 x i16> %offs to <8 x i32>
|
|
%ptrs = getelementptr inbounds i8, i8* %base, <8 x i32> %offs.zext
|
|
%gather = call <8 x i8> @llvm.masked.gather.v8i8.v8p0i8(<8 x i8*> %ptrs, i32 1, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i8> undef)
|
|
%gather.sext = sext <8 x i8> %gather to <8 x i16>
|
|
ret <8 x i16> %gather.sext
|
|
}
|
|
|
|
define arm_aapcs_vfpcc <8 x i16> @unscaled_i16_i16(i8* %base, <8 x i16>* %offptr) {
|
|
; CHECK-LABEL: unscaled_i16_i16:
|
|
; CHECK: @ %bb.0: @ %entry
|
|
; CHECK-NEXT: vldrh.u16 q1, [r1]
|
|
; CHECK-NEXT: vldrh.u16 q0, [r0, q1]
|
|
; CHECK-NEXT: bx lr
|
|
entry:
|
|
%offs = load <8 x i16>, <8 x i16>* %offptr, align 2
|
|
%offs.zext = zext <8 x i16> %offs to <8 x i32>
|
|
%byte_ptrs = getelementptr inbounds i8, i8* %base, <8 x i32> %offs.zext
|
|
%ptrs = bitcast <8 x i8*> %byte_ptrs to <8 x i16*>
|
|
%gather = call <8 x i16> @llvm.masked.gather.v8i16.v8p0i16(<8 x i16*> %ptrs, i32 2, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i16> undef)
|
|
ret <8 x i16> %gather
|
|
}
|
|
|
|
define arm_aapcs_vfpcc <8 x half> @unscaled_f16_i16(i8* %base, <8 x i16>* %offptr) {
|
|
; CHECK-LABEL: unscaled_f16_i16:
|
|
; CHECK: @ %bb.0: @ %entry
|
|
; CHECK-NEXT: vldrh.u16 q1, [r1]
|
|
; CHECK-NEXT: vldrh.u16 q0, [r0, q1]
|
|
; CHECK-NEXT: bx lr
|
|
entry:
|
|
%offs = load <8 x i16>, <8 x i16>* %offptr, align 2
|
|
%offs.zext = zext <8 x i16> %offs to <8 x i32>
|
|
%byte_ptrs = getelementptr inbounds i8, i8* %base, <8 x i32> %offs.zext
|
|
%ptrs = bitcast <8 x i8*> %byte_ptrs to <8 x half*>
|
|
%gather = call <8 x half> @llvm.masked.gather.v8f16.v8p0f16(<8 x half*> %ptrs, i32 2, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x half> undef)
|
|
ret <8 x half> %gather
|
|
}
|
|
|
|
define arm_aapcs_vfpcc <8 x i16> @zext_unsigned_unscaled_i8_i8(i8* %base, <8 x i8>* %offptr) {
|
|
; CHECK-LABEL: zext_unsigned_unscaled_i8_i8:
|
|
; CHECK: @ %bb.0: @ %entry
|
|
; CHECK-NEXT: vldrb.u16 q1, [r1]
|
|
; CHECK-NEXT: vldrb.u16 q0, [r0, q1]
|
|
; CHECK-NEXT: bx lr
|
|
entry:
|
|
%offs = load <8 x i8>, <8 x i8>* %offptr, align 1
|
|
%offs.zext = zext <8 x i8> %offs to <8 x i32>
|
|
%ptrs = getelementptr inbounds i8, i8* %base, <8 x i32> %offs.zext
|
|
%gather = call <8 x i8> @llvm.masked.gather.v8i8.v8p0i8(<8 x i8*> %ptrs, i32 1, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i8> undef)
|
|
%gather.zext = zext <8 x i8> %gather to <8 x i16>
|
|
ret <8 x i16> %gather.zext
|
|
}
|
|
|
|
define arm_aapcs_vfpcc <8 x i16> @sext_unsigned_unscaled_i8_i8(i8* %base, <8 x i8>* %offptr) {
|
|
; CHECK-LABEL: sext_unsigned_unscaled_i8_i8:
|
|
; CHECK: @ %bb.0: @ %entry
|
|
; CHECK-NEXT: vldrb.u16 q1, [r1]
|
|
; CHECK-NEXT: vldrb.s16 q0, [r0, q1]
|
|
; CHECK-NEXT: bx lr
|
|
entry:
|
|
%offs = load <8 x i8>, <8 x i8>* %offptr, align 1
|
|
%offs.zext = zext <8 x i8> %offs to <8 x i32>
|
|
%ptrs = getelementptr inbounds i8, i8* %base, <8 x i32> %offs.zext
|
|
%gather = call <8 x i8> @llvm.masked.gather.v8i8.v8p0i8(<8 x i8*> %ptrs, i32 1, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i8> undef)
|
|
%gather.sext = sext <8 x i8> %gather to <8 x i16>
|
|
ret <8 x i16> %gather.sext
|
|
}
|
|
|
|
define arm_aapcs_vfpcc <8 x i16> @unsigned_unscaled_i16_i8(i8* %base, <8 x i8>* %offptr) {
|
|
; CHECK-LABEL: unsigned_unscaled_i16_i8:
|
|
; CHECK: @ %bb.0: @ %entry
|
|
; CHECK-NEXT: vldrb.u16 q1, [r1]
|
|
; CHECK-NEXT: vldrh.u16 q0, [r0, q1]
|
|
; CHECK-NEXT: bx lr
|
|
entry:
|
|
%offs = load <8 x i8>, <8 x i8>* %offptr, align 1
|
|
%offs.zext = zext <8 x i8> %offs to <8 x i32>
|
|
%byte_ptrs = getelementptr inbounds i8, i8* %base, <8 x i32> %offs.zext
|
|
%ptrs = bitcast <8 x i8*> %byte_ptrs to <8 x i16*>
|
|
%gather = call <8 x i16> @llvm.masked.gather.v8i16.v8p0i16(<8 x i16*> %ptrs, i32 2, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x i16> undef)
|
|
ret <8 x i16> %gather
|
|
}
|
|
|
|
define arm_aapcs_vfpcc <8 x half> @unsigned_unscaled_f16_i8(i8* %base, <8 x i8>* %offptr) {
|
|
; CHECK-LABEL: unsigned_unscaled_f16_i8:
|
|
; CHECK: @ %bb.0: @ %entry
|
|
; CHECK-NEXT: vldrb.u16 q1, [r1]
|
|
; CHECK-NEXT: vldrh.u16 q0, [r0, q1]
|
|
; CHECK-NEXT: bx lr
|
|
entry:
|
|
%offs = load <8 x i8>, <8 x i8>* %offptr, align 1
|
|
%offs.zext = zext <8 x i8> %offs to <8 x i32>
|
|
%byte_ptrs = getelementptr inbounds i8, i8* %base, <8 x i32> %offs.zext
|
|
%ptrs = bitcast <8 x i8*> %byte_ptrs to <8 x half*>
|
|
%gather = call <8 x half> @llvm.masked.gather.v8f16.v8p0f16(<8 x half*> %ptrs, i32 2, <8 x i1> <i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true, i1 true>, <8 x half> undef)
|
|
ret <8 x half> %gather
|
|
}
|
|
|
|
declare <8 x i8> @llvm.masked.gather.v8i8.v8p0i8(<8 x i8*>, i32, <8 x i1>, <8 x i8>) #1
|
|
declare <8 x i16> @llvm.masked.gather.v8i16.v8p0i16(<8 x i16*>, i32, <8 x i1>, <8 x i16>) #1
|
|
declare <8 x half> @llvm.masked.gather.v8f16.v8p0f16(<8 x half*>, i32, <8 x i1>, <8 x half>) #1
|