1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs -run-pass=legalizer %s -o - | FileCheck %s
3 # RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs -mattr=+cssc -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=CHECK-CSSC
7 tracksRegLiveness: true
11 ; CHECK-LABEL: name: s8
14 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
15 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 256
16 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[DEF]], [[C]]
17 ; CHECK-NEXT: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE [[OR]]
18 ; CHECK-NEXT: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[BITREVERSE]](s32)
19 ; CHECK-NEXT: $w0 = COPY [[CTLZ]](s32)
20 ; CHECK-NEXT: RET_ReallyLR implicit $w0
21 ; CHECK-CSSC-LABEL: name: s8
22 ; CHECK-CSSC: liveins: $w0
23 ; CHECK-CSSC-NEXT: {{ $}}
24 ; CHECK-CSSC-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
25 ; CHECK-CSSC-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 256
26 ; CHECK-CSSC-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[DEF]], [[C]]
27 ; CHECK-CSSC-NEXT: [[CTTZ:%[0-9]+]]:_(s32) = G_CTTZ [[OR]](s32)
28 ; CHECK-CSSC-NEXT: $w0 = COPY [[CTTZ]](s32)
29 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $w0
30 %val:_(s8) = G_IMPLICIT_DEF
31 %cttz:_(s8) = G_CTTZ_ZERO_UNDEF %val(s8)
32 %ext:_(s32) = G_ANYEXT %cttz(s8)
34 RET_ReallyLR implicit $w0
39 tracksRegLiveness: true
43 ; CHECK-LABEL: name: s16
46 ; CHECK-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
47 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65536
48 ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[DEF]], [[C]]
49 ; CHECK-NEXT: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE [[OR]]
50 ; CHECK-NEXT: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[BITREVERSE]](s32)
51 ; CHECK-NEXT: $w0 = COPY [[CTLZ]](s32)
52 ; CHECK-NEXT: RET_ReallyLR implicit $w0
53 ; CHECK-CSSC-LABEL: name: s16
54 ; CHECK-CSSC: liveins: $w0
55 ; CHECK-CSSC-NEXT: {{ $}}
56 ; CHECK-CSSC-NEXT: [[DEF:%[0-9]+]]:_(s32) = G_IMPLICIT_DEF
57 ; CHECK-CSSC-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65536
58 ; CHECK-CSSC-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[DEF]], [[C]]
59 ; CHECK-CSSC-NEXT: [[CTTZ:%[0-9]+]]:_(s32) = G_CTTZ [[OR]](s32)
60 ; CHECK-CSSC-NEXT: $w0 = COPY [[CTTZ]](s32)
61 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $w0
62 %val:_(s16) = G_IMPLICIT_DEF
63 %cttz:_(s16) = G_CTTZ_ZERO_UNDEF %val(s16)
64 %ext:_(s32) = G_ANYEXT %cttz(s16)
66 RET_ReallyLR implicit $w0
72 tracksRegLiveness: true
77 ; CHECK-LABEL: name: s32
80 ; CHECK-NEXT: %val:_(s32) = COPY $w0
81 ; CHECK-NEXT: [[BITREVERSE:%[0-9]+]]:_(s32) = G_BITREVERSE %val
82 ; CHECK-NEXT: [[CTLZ:%[0-9]+]]:_(s32) = G_CTLZ [[BITREVERSE]](s32)
83 ; CHECK-NEXT: $w0 = COPY [[CTLZ]](s32)
84 ; CHECK-NEXT: RET_ReallyLR implicit $w0
85 ; CHECK-CSSC-LABEL: name: s32
86 ; CHECK-CSSC: liveins: $w0
87 ; CHECK-CSSC-NEXT: {{ $}}
88 ; CHECK-CSSC-NEXT: %val:_(s32) = COPY $w0
89 ; CHECK-CSSC-NEXT: [[CTTZ:%[0-9]+]]:_(s32) = G_CTTZ %val(s32)
90 ; CHECK-CSSC-NEXT: $w0 = COPY [[CTTZ]](s32)
91 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $w0
92 %val:_(s32) = COPY $w0
93 %1:_(s32) = G_CTTZ_ZERO_UNDEF %val(s32)
95 RET_ReallyLR implicit $w0
101 tracksRegLiveness: true
106 ; CHECK-LABEL: name: s64
107 ; CHECK: liveins: $x0
109 ; CHECK-NEXT: %val:_(s64) = COPY $x0
110 ; CHECK-NEXT: [[BITREVERSE:%[0-9]+]]:_(s64) = G_BITREVERSE %val
111 ; CHECK-NEXT: [[CTLZ:%[0-9]+]]:_(s64) = G_CTLZ [[BITREVERSE]](s64)
112 ; CHECK-NEXT: $x0 = COPY [[CTLZ]](s64)
113 ; CHECK-NEXT: RET_ReallyLR implicit $x0
114 ; CHECK-CSSC-LABEL: name: s64
115 ; CHECK-CSSC: liveins: $x0
116 ; CHECK-CSSC-NEXT: {{ $}}
117 ; CHECK-CSSC-NEXT: %val:_(s64) = COPY $x0
118 ; CHECK-CSSC-NEXT: [[CTTZ:%[0-9]+]]:_(s64) = G_CTTZ %val(s64)
119 ; CHECK-CSSC-NEXT: $x0 = COPY [[CTTZ]](s64)
120 ; CHECK-CSSC-NEXT: RET_ReallyLR implicit $x0
121 %val:_(s64) = COPY $x0
122 %1:_(s64) = G_CTTZ_ZERO_UNDEF %val(s64)
124 RET_ReallyLR implicit $x0