1 ; RUN: llc -O3 < %s | FileCheck %s
2 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
3 target triple = "arm64--linux-gnu"
5 ; Function Attrs: nounwind readnone
6 define i32 @test1(i8 %a) {
8 ; CHECK: ubfx {{w[0-9]+}}, w0, #3, #5
10 %conv = zext i8 %a to i32
11 %shr1 = lshr i32 %conv, 3
15 ; Function Attrs: nounwind readnone
16 define i32 @test2(i8 %a) {
18 ; CHECK: and {{w[0-9]+}}, w0, #0xff
19 ; CHECK: ubfx {{w[0-9]+}}, w0, #3, #5
21 %conv = zext i8 %a to i32
22 %cmp = icmp ugt i8 %a, 47
23 %shr5 = lshr i32 %conv, 3
24 %retval.0 = select i1 %cmp, i32 %shr5, i32 %conv