1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[AArch64][GlobalISel] Make <8 x s8> integer arithmetic ops legal.

This commit is contained in:
Amara Emerson 2020-10-01 14:28:23 -07:00
parent 2e35d9215f
commit b838382ceb
3 changed files with 27 additions and 3 deletions

View File

@ -100,7 +100,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, v4s16, v8s16, v16s8})
.legalFor({s32, s64, v2s32, v4s32, v4s16, v8s16, v16s8, v8s8})
.scalarizeIf(
[=](const LegalityQuery &Query) {
return Query.Opcode == G_MUL && Query.Types[0] == v2s64;

View File

@ -194,3 +194,23 @@ body: |
$d0 = COPY %2(<4 x s16>)
RET_ReallyLR implicit $d0
...
---
name: add_v8s8
tracksRegLiveness: true
body: |
bb.1:
liveins: $d0, $d1
; CHECK-LABEL: name: add_v8s8
; CHECK: liveins: $d0, $d1
; CHECK: [[COPY:%[0-9]+]]:_(<8 x s8>) = COPY $d0
; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s8>) = COPY $d1
; CHECK: [[ADD:%[0-9]+]]:_(<8 x s8>) = G_ADD [[COPY]], [[COPY1]]
; CHECK: $d0 = COPY [[ADD]](<8 x s8>)
; CHECK: RET_ReallyLR implicit $d0
%0:_(<8 x s8>) = COPY $d0
%1:_(<8 x s8>) = COPY $d1
%2:_(<8 x s8>) = G_ADD %0, %1
$d0 = COPY %2(<8 x s8>)
RET_ReallyLR implicit $d0
...

View File

@ -982,8 +982,12 @@ define <4 x i16> @abspattern2(<4 x i16> %a) nounwind {
define <8 x i8> @abspattern3(<8 x i8> %a) nounwind {
; CHECK-LABEL: abspattern3:
; CHECK: abs.8b
; CHECK-NEXT: ret
; DAG: abs.8b
; DAG-NEXT: ret
; GISEL-DAG: neg.8b
; GISEL-DAG: cmgt.8b
; GISEL: bit.8b
%tmp1neg = sub <8 x i8> zeroinitializer, %a
%b = icmp slt <8 x i8> %a, zeroinitializer
%abs = select <8 x i1> %b, <8 x i8> %tmp1neg, <8 x i8> %a