1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[AArch64][GlobalISel] Legalize arithmetic ops for <4 x s16>

This commit is contained in:
Amara Emerson 2020-09-18 16:45:12 -07:00
parent f298c20805
commit 7600b7ba0c
4 changed files with 33 additions and 11 deletions

View File

@ -90,7 +90,7 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
.widenScalarToNextPow2(0);
getActionDefinitionsBuilder({G_ADD, G_SUB, G_MUL, G_AND, G_OR, G_XOR})
.legalFor({s32, s64, v2s32, v4s32, v2s64, v8s16, v16s8})
.legalFor({s32, s64, v2s32, v4s32, v2s64, v4s16, v8s16, v16s8})
.clampScalar(0, s32, s64)
.widenScalarToNextPow2(0)
.clampNumElements(0, v2s32, v4s32)

View File

@ -161,14 +161,6 @@ entry:
ret i32 0
}
; FALLBACK-WITH-REPORT-ERR: remark: <unknown>:0:0: cannot select: %2:fpr(<4 x s16>) = G_ZEXT %0:fpr(<4 x s8>) (in function: zext_v4s8)
; FALLBACK-WITH-REPORT-ERR: warning: Instruction selection used fallback path for zext_v4s8
; FALLBACK-WITH-REPORT-OUT-LABEL: zext_v4s8
define <4 x i16> @zext_v4s8(<4 x i8> %in) {
%ext = zext <4 x i8> %in to <4 x i16>
ret <4 x i16> %ext
}
; FALLBACK-WITH-REPORT-ERR: remark: <unknown>:0:0: cannot select: RET_ReallyLR implicit $x0 (in function: strict_align_feature)
; FALLBACK-WITH-REPORT-ERR: warning: Instruction selection used fallback path for strict_align_feature
; FALLBACK-WITH-REPORT-OUT-LABEL: strict_align_feature

View File

@ -172,3 +172,25 @@ body: |
RET_ReallyLR implicit $q0
...
---
name: add_v4i16
alignment: 4
tracksRegLiveness: true
machineFunctionInfo: {}
body: |
bb.1:
liveins: $d0, $d1
; CHECK-LABEL: name: add_v4i16
; CHECK: liveins: $d0, $d1
; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
; CHECK: [[ADD:%[0-9]+]]:_(<4 x s16>) = G_ADD [[COPY]], [[COPY1]]
; CHECK: $d0 = COPY [[ADD]](<4 x s16>)
; CHECK: RET_ReallyLR implicit $d0
%0:_(<4 x s16>) = COPY $d0
%1:_(<4 x s16>) = COPY $d1
%2:_(<4 x s16>) = G_ADD %0, %1
$d0 = COPY %2(<4 x s16>)
RET_ReallyLR implicit $d0
...

View File

@ -968,8 +968,16 @@ define <2 x i32> @abspattern1(<2 x i32> %a) nounwind {
define <4 x i16> @abspattern2(<4 x i16> %a) nounwind {
; CHECK-LABEL: abspattern2:
; CHECK: abs.4h
; CHECK-NEXT: ret
; DAG: abs.4h
; DAG-NEXT: ret
; For GlobalISel, this generates terrible code until we can pattern match this to abs.
; GISEL-DAG: sub.4h
; GISEL-DAG: cmgt.4h
; GISEL: csel
; GISEL: csel
; GISEL: csel
; GISEL: csel
%tmp1neg = sub <4 x i16> zeroinitializer, %a
%b = icmp sgt <4 x i16> %a, zeroinitializer
%abs = select <4 x i1> %b, <4 x i16> %a, <4 x i16> %tmp1neg