1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=aarch64 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3
4...
5---
6name:            ubfx_s32
7legalized:       true
8regBankSelected: true
9tracksRegLiveness: true
10body:             |
11  bb.0:
12    liveins: $w0
13    ; CHECK-LABEL: name: ubfx_s32
14    ; CHECK: liveins: $w0
15    ; CHECK: %copy:gpr32 = COPY $w0
16    ; CHECK: %ubfx:gpr32 = UBFMWri %copy, 0, 9
17    ; CHECK: $w0 = COPY %ubfx
18    ; CHECK: RET_ReallyLR implicit $w0
19    %copy:gpr(s32) = COPY $w0
20    %cst1:gpr(s32) = G_CONSTANT i32 0
21    %cst2:gpr(s32) = G_CONSTANT i32 10
22    %ubfx:gpr(s32) = G_UBFX %copy, %cst1, %cst2
23    $w0 = COPY %ubfx
24    RET_ReallyLR implicit $w0
25
26...
27---
28name:            ubfx_s64
29legalized:       true
30regBankSelected: true
31tracksRegLiveness: true
32body:             |
33  bb.0:
34    liveins: $x0
35    ; CHECK-LABEL: name: ubfx_s64
36    ; CHECK: liveins: $x0
37    ; CHECK: %copy:gpr64 = COPY $x0
38    ; CHECK: %ubfx:gpr64 = UBFMXri %copy, 0, 9
39    ; CHECK: $x0 = COPY %ubfx
40    ; CHECK: RET_ReallyLR implicit $x0
41    %copy:gpr(s64) = COPY $x0
42    %cst1:gpr(s64) = G_CONSTANT i64 0
43    %cst2:gpr(s64) = G_CONSTANT i64 10
44    %ubfx:gpr(s64) = G_UBFX %copy, %cst1, %cst2
45    $x0 = COPY %ubfx
46    RET_ReallyLR implicit $x0
47
48...
49---
50name:            ubfx_s32_31_1
51legalized:       true
52regBankSelected: true
53tracksRegLiveness: true
54body:             |
55  bb.0:
56    liveins: $w0
57
58    ; This is just a lsr, so it's okay.
59
60    ; CHECK-LABEL: name: ubfx_s32_31_1
61    ; CHECK: liveins: $w0
62    ; CHECK: %copy:gpr32 = COPY $w0
63    ; CHECK: %ubfx:gpr32 = UBFMWri %copy, 31, 31
64    ; CHECK: $w0 = COPY %ubfx
65    ; CHECK: RET_ReallyLR implicit $w0
66    %copy:gpr(s32) = COPY $w0
67    %cst1:gpr(s32) = G_CONSTANT i32 31
68    %cst2:gpr(s32) = G_CONSTANT i32 1
69    %ubfx:gpr(s32) = G_UBFX %copy, %cst1, %cst2
70    $w0 = COPY %ubfx
71    RET_ReallyLR implicit $w0
72---
73name:            ubfx_s32_10_5
74legalized:       true
75regBankSelected: true
76tracksRegLiveness: true
77body:             |
78  bb.0:
79    liveins: $w0
80    ; CHECK-LABEL: name: ubfx_s32_10_5
81    ; CHECK: liveins: $w0
82    ; CHECK: %copy:gpr32 = COPY $w0
83    ; CHECK: %ubfx:gpr32 = UBFMWri %copy, 10, 14
84    ; CHECK: $w0 = COPY %ubfx
85    ; CHECK: RET_ReallyLR implicit $w0
86    %copy:gpr(s32) = COPY $w0
87    %cst1:gpr(s32) = G_CONSTANT i32 10
88    %cst2:gpr(s32) = G_CONSTANT i32 5
89    %ubfx:gpr(s32) = G_UBFX %copy, %cst1, %cst2
90    $w0 = COPY %ubfx
91    RET_ReallyLR implicit $w0
92
93...
94---
95name:            ubfx_s64_10_5
96legalized:       true
97regBankSelected: true
98tracksRegLiveness: true
99body:             |
100  bb.0:
101    liveins: $x0
102    ; CHECK-LABEL: name: ubfx_s64_10_5
103    ; CHECK: liveins: $x0
104    ; CHECK: %copy:gpr64 = COPY $x0
105    ; CHECK: %ubfx:gpr64 = UBFMXri %copy, 10, 14
106    ; CHECK: $x0 = COPY %ubfx
107    ; CHECK: RET_ReallyLR implicit $x0
108    %copy:gpr(s64) = COPY $x0
109    %cst1:gpr(s64) = G_CONSTANT i64 10
110    %cst2:gpr(s64) = G_CONSTANT i64 5
111    %ubfx:gpr(s64) = G_UBFX %copy, %cst1, %cst2
112    $x0 = COPY %ubfx
113    RET_ReallyLR implicit $x0
114