select-logical-shifted-reg.mir
2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# 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
...