1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 target triple = "hexagon"
6 ; CHECK: extractu(r0,#26,#0)
7 define i32 @ua(i32 %x) local_unnamed_addr #0 {
9 %shl = and i32 %x, 67108863
14 ; CHECK: extractu(r0,#16,#4)
15 define i32 @ub(i32 %x) local_unnamed_addr #0 {
18 %shr = and i32 %0, 65535
23 ; CHECK: extractu(r0,#24,#0)
24 define i32 @uc(i32 %x) local_unnamed_addr #0 {
26 %shl = and i32 %x, 16777215
31 ; CHECK: extractu(r0,#16,#8)
32 define i32 @ud(i32 %x) local_unnamed_addr #0 {
34 %bf.lshr = lshr i32 %x, 8
35 %bf.clear = and i32 %bf.lshr, 65535
40 ; CHECK: extract(r0,#26,#0)
41 define i32 @sa(i32 %x) local_unnamed_addr #0 {
44 %shr = ashr exact i32 %shl, 6
49 ; CHECK: extract(r0,#16,#4)
50 define i32 @sb(i32 %x) local_unnamed_addr #0 {
53 %shr = ashr i32 %shl, 16
58 ; CHECK: extract(r0,#24,#0)
59 define i32 @sc(i32 %x) local_unnamed_addr #0 {
62 %shr = ashr exact i32 %shl, 8
67 ; CHECK: extract(r0,#16,#8)
68 define i32 @sd(i32 %x) local_unnamed_addr #0 {
70 %bf.shl = shl i32 %x, 8
71 %bf.ashr = ashr i32 %bf.shl, 16
75 attributes #0 = { noinline norecurse nounwind readnone "target-cpu"="hexagonv60" "target-features"="-hvx,-long-calls" }