137 lines
4 KiB
Text
137 lines
4 KiB
Text
|
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
||
|
# RUN: llc -mtriple=aarch64 -run-pass=legalizer %s -o - -verify-machineinstrs | FileCheck %s
|
||
|
|
||
|
...
|
||
|
---
|
||
|
name: bswap_s16
|
||
|
tracksRegLiveness: true
|
||
|
body: |
|
||
|
bb.1:
|
||
|
liveins: $w0
|
||
|
|
||
|
; CHECK-LABEL: name: bswap_s16
|
||
|
; CHECK: liveins: $w0
|
||
|
; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w0
|
||
|
; CHECK: [[BSWAP:%[0-9]+]]:_(s32) = G_BSWAP [[COPY]]
|
||
|
; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
|
||
|
; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BSWAP]], [[C]](s64)
|
||
|
; CHECK: $w0 = COPY [[LSHR]](s32)
|
||
|
; CHECK: RET_ReallyLR implicit $w0
|
||
|
%1:_(s32) = COPY $w0
|
||
|
%0:_(s16) = G_TRUNC %1(s32)
|
||
|
%2:_(s16) = G_BSWAP %0
|
||
|
%3:_(s32) = G_ANYEXT %2(s16)
|
||
|
$w0 = COPY %3(s32)
|
||
|
RET_ReallyLR implicit $w0
|
||
|
...
|
||
|
---
|
||
|
name: bswap_s32_legal
|
||
|
tracksRegLiveness: true
|
||
|
body: |
|
||
|
bb.0:
|
||
|
liveins: $w0
|
||
|
; CHECK-LABEL: name: bswap_s32_legal
|
||
|
; CHECK: liveins: $w0
|
||
|
; CHECK: %copy:_(s32) = COPY $w0
|
||
|
; CHECK: %bswap:_(s32) = G_BSWAP %copy
|
||
|
; CHECK: $w0 = COPY %bswap(s32)
|
||
|
; CHECK: RET_ReallyLR implicit $w0
|
||
|
%copy:_(s32) = COPY $w0
|
||
|
%bswap:_(s32) = G_BSWAP %copy
|
||
|
$w0 = COPY %bswap(s32)
|
||
|
RET_ReallyLR implicit $w0
|
||
|
...
|
||
|
---
|
||
|
name: bswap_s64_legal
|
||
|
tracksRegLiveness: true
|
||
|
body: |
|
||
|
bb.0:
|
||
|
liveins: $x0
|
||
|
; CHECK-LABEL: name: bswap_s64_legal
|
||
|
; CHECK: liveins: $x0
|
||
|
; CHECK: %copy:_(s64) = COPY $x0
|
||
|
; CHECK: %bswap:_(s64) = G_BSWAP %copy
|
||
|
; CHECK: $x0 = COPY %bswap(s64)
|
||
|
; CHECK: RET_ReallyLR implicit $x0
|
||
|
%copy:_(s64) = COPY $x0
|
||
|
%bswap:_(s64) = G_BSWAP %copy
|
||
|
$x0 = COPY %bswap(s64)
|
||
|
RET_ReallyLR implicit $x0
|
||
|
...
|
||
|
---
|
||
|
name: bswap_v4s32_legal
|
||
|
tracksRegLiveness: true
|
||
|
body: |
|
||
|
bb.0:
|
||
|
liveins: $q0
|
||
|
; CHECK-LABEL: name: bswap_v4s32_legal
|
||
|
; CHECK: liveins: $q0
|
||
|
; CHECK: %copy:_(<4 x s32>) = COPY $q0
|
||
|
; CHECK: %bswap:_(<4 x s32>) = G_BSWAP %copy
|
||
|
; CHECK: $q0 = COPY %bswap(<4 x s32>)
|
||
|
; CHECK: RET_ReallyLR implicit $q0
|
||
|
%copy:_(<4 x s32>) = COPY $q0
|
||
|
%bswap:_(<4 x s32>) = G_BSWAP %copy
|
||
|
$q0 = COPY %bswap(<4 x s32>)
|
||
|
RET_ReallyLR implicit $q0
|
||
|
...
|
||
|
---
|
||
|
name: bswap_v2s32_legal
|
||
|
tracksRegLiveness: true
|
||
|
body: |
|
||
|
bb.0:
|
||
|
liveins: $d0
|
||
|
; CHECK-LABEL: name: bswap_v2s32_legal
|
||
|
; CHECK: liveins: $d0
|
||
|
; CHECK: %copy:_(<2 x s32>) = COPY $d0
|
||
|
; CHECK: %bswap:_(<2 x s32>) = G_BSWAP %copy
|
||
|
; CHECK: $d0 = COPY %bswap(<2 x s32>)
|
||
|
; CHECK: RET_ReallyLR implicit $d0
|
||
|
%copy:_(<2 x s32>) = COPY $d0
|
||
|
%bswap:_(<2 x s32>) = G_BSWAP %copy
|
||
|
$d0 = COPY %bswap(<2 x s32>)
|
||
|
RET_ReallyLR implicit $d0
|
||
|
...
|
||
|
---
|
||
|
name: bswap_v2s64_legal
|
||
|
tracksRegLiveness: true
|
||
|
body: |
|
||
|
bb.0:
|
||
|
liveins: $q0
|
||
|
; CHECK-LABEL: name: bswap_v2s64_legal
|
||
|
; CHECK: liveins: $q0
|
||
|
; CHECK: %copy:_(<2 x s64>) = COPY $q0
|
||
|
; CHECK: %bswap:_(<2 x s64>) = G_BSWAP %copy
|
||
|
; CHECK: $q0 = COPY %bswap(<2 x s64>)
|
||
|
; CHECK: RET_ReallyLR implicit $q0
|
||
|
%copy:_(<2 x s64>) = COPY $q0
|
||
|
%bswap:_(<2 x s64>) = G_BSWAP %copy
|
||
|
$q0 = COPY %bswap(<2 x s64>)
|
||
|
RET_ReallyLR implicit $q0
|
||
|
...
|
||
|
---
|
||
|
name: bswap_s80
|
||
|
tracksRegLiveness: true
|
||
|
body: |
|
||
|
bb.0:
|
||
|
liveins: $x0
|
||
|
; CHECK-LABEL: name: bswap_s80
|
||
|
; CHECK: liveins: $x0
|
||
|
; CHECK-NEXT: {{ $}}
|
||
|
; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s64) = G_IMPLICIT_DEF
|
||
|
; CHECK-NEXT: [[BSWAP:%[0-9]+]]:_(s64) = G_BSWAP [[DEF]]
|
||
|
; CHECK-NEXT: [[BSWAP1:%[0-9]+]]:_(s64) = G_BSWAP [[DEF]]
|
||
|
; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
|
||
|
; CHECK-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[BSWAP]], [[C]](s64)
|
||
|
; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 16
|
||
|
; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[BSWAP1]], [[C1]](s64)
|
||
|
; CHECK-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[LSHR]], [[SHL]]
|
||
|
; CHECK-NEXT: $x0 = COPY [[OR]](s64)
|
||
|
; CHECK-NEXT: RET_ReallyLR implicit $x0
|
||
|
%val:_(s80) = G_IMPLICIT_DEF
|
||
|
%bswap:_(s80) = G_BSWAP %val
|
||
|
%trunc:_(s64) = G_TRUNC %bswap
|
||
|
$x0 = COPY %trunc(s64)
|
||
|
RET_ReallyLR implicit $x0
|
||
|
...
|