# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
#
# Test patterns related to logical_shifted_reg32/logical_shifted_reg64 which
# are not shared with arith_shifted_reg32/arith_shifted_reg64.
---
name: and_xor_bicxrs
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x0
; CHECK-LABEL: name: and_xor_bicxrs
; CHECK: liveins: $x0
; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
; CHECK: [[BICXrs:%[0-9]+]]:gpr64 = BICXrs [[COPY]], [[COPY]], 8
; CHECK: $x0 = COPY [[BICXrs]]
; CHECK: RET_ReallyLR implicit $x0
%0:gpr(s64) = COPY $x0
%1:gpr(s64) = G_CONSTANT i64 8
%2:gpr(s64) = G_CONSTANT i64 -1
%3:gpr(s64) = G_SHL %0, %1:gpr(s64)
%4:gpr(s64) = G_XOR %3, %2:gpr(s64)
%5:gpr(s64) = G_AND %0, %4:gpr(s64)
$x0 = COPY %5:gpr(s64)
RET_ReallyLR implicit $x0
...
---
name: or_xor_ornxrs
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x0
; CHECK-LABEL: name: or_xor_ornxrs
; CHECK: liveins: $x0
; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
; CHECK: [[ORNXrs:%[0-9]+]]:gpr64 = ORNXrs [[COPY]], [[COPY]], 8
; CHECK: $x0 = COPY [[ORNXrs]]
; CHECK: RET_ReallyLR implicit $x0
%0:gpr(s64) = COPY $x0
%1:gpr(s64) = G_CONSTANT i64 8
%2:gpr(s64) = G_CONSTANT i64 -1
%3:gpr(s64) = G_SHL %0, %1:gpr(s64)
%4:gpr(s64) = G_XOR %3, %2:gpr(s64)
%5:gpr(s64) = G_OR %0, %4:gpr(s64)
$x0 = COPY %5:gpr(s64)
RET_ReallyLR implicit $x0
...
---
name: xor_xor_eonxrs
legalized: true
regBankSelected: true
tracksRegLiveness: true
body: |
bb.0:
liveins: $x0
; CHECK-LABEL: name: xor_xor_eonxrs
; CHECK: liveins: $x0
; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
; CHECK: [[EONXrs:%[0-9]+]]:gpr64 = EONXrs [[COPY]], [[COPY]], 8
; CHECK: $x0 = COPY [[EONXrs]]
; CHECK: RET_ReallyLR implicit $x0
%0:gpr(s64) = COPY $x0
%1:gpr(s64) = G_CONSTANT i64 8
%2:gpr(s64) = G_CONSTANT i64 -1
%3:gpr(s64) = G_SHL %0, %1:gpr(s64)
%4:gpr(s64) = G_XOR %3, %2:gpr(s64)
%5:gpr(s64) = G_XOR %0, %4:gpr(s64)
$x0 = COPY %5:gpr(s64)
RET_ReallyLR implicit $x0
...