[AArch64][GlobalISel] Make <4 x s16> G_ASHR and G_LSHR legal.

Selection support for these is coming up.
This commit is contained in:
Amara Emerson 2020-09-21 11:17:53 -07:00
parent 0f6facca97
commit 825203daae
2 changed files with 29 additions and 0 deletions

View File

@ -144,6 +144,7 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST)
{v4s32, v4s32},
{v2s64, v2s64},
{v16s8, v16s8},
{v4s16, v4s16},
{v8s16, v8s16}})
.clampScalar(1, s32, s64)
.clampScalar(0, s32, s64)

View File

@ -382,3 +382,31 @@ body: |
%2:_(<4 x s16>) = G_SHL %0, %1
$d0 = COPY %2
...
---
name: test_lshr_v4i16
body: |
bb.0:
; CHECK-LABEL: name: test_lshr_v4i16
; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
; CHECK: [[LSHR:%[0-9]+]]:_(<4 x s16>) = G_LSHR [[COPY]], [[COPY1]](<4 x s16>)
; CHECK: $d0 = COPY [[LSHR]](<4 x s16>)
%0:_(<4 x s16>) = COPY $d0
%1:_(<4 x s16>) = COPY $d1
%2:_(<4 x s16>) = G_LSHR %0, %1
$d0 = COPY %2
...
---
name: test_ashr_v4i16
body: |
bb.0:
; CHECK-LABEL: name: test_ashr_v4i16
; CHECK: [[COPY:%[0-9]+]]:_(<4 x s16>) = COPY $d0
; CHECK: [[COPY1:%[0-9]+]]:_(<4 x s16>) = COPY $d1
; CHECK: [[ASHR:%[0-9]+]]:_(<4 x s16>) = G_ASHR [[COPY]], [[COPY1]](<4 x s16>)
; CHECK: $d0 = COPY [[ASHR]](<4 x s16>)
%0:_(<4 x s16>) = COPY $d0
%1:_(<4 x s16>) = COPY $d1
%2:_(<4 x s16>) = G_ASHR %0, %1
$d0 = COPY %2
...