1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
7 tracksRegLiveness: true
11 ; CHECK-LABEL: name: s32_legal
13 ; CHECK: %copy:_(s32) = COPY $w0
14 ; CHECK: %bitreverse:_(s32) = G_BITREVERSE %copy
15 ; CHECK: $w0 = COPY %bitreverse(s32)
16 ; CHECK: RET_ReallyLR implicit $w0
17 %copy:_(s32) = COPY $w0
18 %bitreverse:_(s32) = G_BITREVERSE %copy
19 $w0 = COPY %bitreverse
20 RET_ReallyLR implicit $w0
24 tracksRegLiveness: true
28 ; CHECK-LABEL: name: s64_legal
30 ; CHECK: %copy:_(s64) = COPY $x0
31 ; CHECK: %bitreverse:_(s64) = G_BITREVERSE %copy
32 ; CHECK: $x0 = COPY %bitreverse(s64)
33 ; CHECK: RET_ReallyLR implicit $x0
34 %copy:_(s64) = COPY $x0
35 %bitreverse:_(s64) = G_BITREVERSE %copy
36 $x0 = COPY %bitreverse
37 RET_ReallyLR implicit $x0
41 tracksRegLiveness: true
45 ; CHECK-LABEL: name: v8s8_legal
47 ; CHECK: %vec:_(<8 x s8>) = G_IMPLICIT_DEF
48 ; CHECK: %bitreverse:_(<8 x s8>) = G_BITREVERSE %vec
49 ; CHECK: $x0 = COPY %bitreverse(<8 x s8>)
50 ; CHECK: RET_ReallyLR implicit $x0
51 %vec:_(<8 x s8>) = G_IMPLICIT_DEF
52 %bitreverse:_(<8 x s8>) = G_BITREVERSE %vec
53 $x0 = COPY %bitreverse
54 RET_ReallyLR implicit $x0
58 tracksRegLiveness: true
62 ; CHECK-LABEL: name: v16s8_legal
64 ; CHECK: %vec:_(<16 x s8>) = G_IMPLICIT_DEF
65 ; CHECK: %bitreverse:_(<16 x s8>) = G_BITREVERSE %vec
66 ; CHECK: $q0 = COPY %bitreverse(<16 x s8>)
67 ; CHECK: RET_ReallyLR implicit $q0
68 %vec:_(<16 x s8>) = G_IMPLICIT_DEF
69 %bitreverse:_(<16 x s8>) = G_BITREVERSE %vec
70 $q0 = COPY %bitreverse
71 RET_ReallyLR implicit $q0
75 tracksRegLiveness: true
79 ; CHECK-LABEL: name: s8_widen
81 ; CHECK: %copy:_(s8) = COPY $b0
82 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %copy(s8)
83 ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE [[ANYEXT]]
84 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 24
85 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITREVERSE]], [[C]](s64)
86 ; CHECK: %bitreverse:_(s8) = G_TRUNC [[LSHR]](s32)
87 ; CHECK: $b0 = COPY %bitreverse(s8)
88 ; CHECK: RET_ReallyLR implicit $b0
89 %copy:_(s8) = COPY $b0
90 %bitreverse:_(s8) = G_BITREVERSE %copy
91 $b0 = COPY %bitreverse
92 RET_ReallyLR implicit $b0
96 tracksRegLiveness: true
100 ; CHECK-LABEL: name: s3_widen
101 ; CHECK: liveins: $b0
102 ; CHECK: %copy:_(s8) = COPY $b0
103 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT %copy(s8)
104 ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE [[ANYEXT]]
105 ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 29
106 ; CHECK: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[BITREVERSE]], [[C]](s64)
107 ; CHECK: %ext:_(s8) = G_TRUNC [[LSHR]](s32)
108 ; CHECK: $b0 = COPY %ext(s8)
109 ; CHECK: RET_ReallyLR implicit $b0
110 %copy:_(s8) = COPY $b0
111 %trunc:_(s3) = G_TRUNC %copy
112 %bitreverse:_(s3) = G_BITREVERSE %trunc
113 %ext:_(s8) = G_ANYEXT %bitreverse
115 RET_ReallyLR implicit $b0
119 tracksRegLiveness: true
123 ; CHECK-LABEL: name: s128_narrow
124 ; CHECK: liveins: $q0
125 ; CHECK: %copy:_(s128) = COPY $q0
126 ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES %copy(s128)
127 ; CHECK: [[BITREVERSE:%[0-9]+]]:_(s64) = G_BITREVERSE [[UV1]]
128 ; CHECK: [[BITREVERSE1:%[0-9]+]]:_(s64) = G_BITREVERSE [[UV]]
129 ; CHECK: %bitreverse:_(s128) = G_MERGE_VALUES [[BITREVERSE]](s64), [[BITREVERSE1]](s64)
130 ; CHECK: $q0 = COPY %bitreverse(s128)
131 ; CHECK: RET_ReallyLR implicit $q0
132 %copy:_(s128) = COPY $q0
133 %bitreverse:_(s128) = G_BITREVERSE %copy
134 $q0 = COPY %bitreverse
135 RET_ReallyLR implicit $q0