1 ; Expect the constant propagation to evaluate signed and unsigned bit extract.
2 ; RUN: llc -march=hexagon -O2 < %s | FileCheck %s
4 target triple = "hexagon"
6 @x = common global i32 0, align 4
7 @y = common global i32 0, align 4
9 define void @foo() #0 {
11 ; extractu(0x000ABCD0, 16, 4)
12 ; should evaluate to 0xABCD (dec 43981)
13 %0 = call i32 @llvm.hexagon.S2.extractu(i32 703696, i32 16, i32 4)
16 store i32 %0, i32* @x, align 4
17 ; extract(0x000ABCD0, 16, 4)
18 ; should evaluate to 0xFFFFABCD (dec 4294945741 or -21555)
19 %1 = call i32 @llvm.hexagon.S4.extract(i32 703696, i32 16, i32 4)
22 store i32 %1, i32* @y, align 4
26 declare i32 @llvm.hexagon.S2.extractu(i32, i32, i32) #1
28 declare i32 @llvm.hexagon.S4.extract(i32, i32, i32) #1
30 attributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
31 attributes #1 = { nounwind readnone }