1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O3 < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
5 target triple = "arm64--linux-gnu"
7 ; Function Attrs: nounwind readnone
8 define i32 @test1(i8 %a) {
10 ; CHECK: // %bb.0: // %entry
11 ; CHECK-NEXT: ubfx w0, w0, #3, #5
14 %conv = zext i8 %a to i32
15 %shr1 = lshr i32 %conv, 3
19 ; Function Attrs: nounwind readnone
20 define i32 @test2(i8 %a) {
22 ; CHECK: // %bb.0: // %entry
23 ; CHECK-NEXT: and w8, w0, #0xff
24 ; CHECK-NEXT: ubfx w9, w0, #3, #5
25 ; CHECK-NEXT: cmp w8, #47
26 ; CHECK-NEXT: csel w0, w9, w8, hi
29 %conv = zext i8 %a to i32
30 %cmp = icmp ugt i8 %a, 47
31 %shr5 = lshr i32 %conv, 3
32 %retval.0 = select i1 %cmp, i32 %shr5, i32 %conv