1 ; RUN: llc -march=hexagon < %s | FileCheck %s
3 ; Check that we generate 'cmph.gtu' instruction.
4 ; CHECK-LABEL: @cmphgtu
7 @glob = common global i8 0, align 1
9 define i32 @cmphgtu(i32 %a0, i32 %a1) #0 {
11 %v3 = xor i32 %a1, %a0
12 %v4 = and i32 %v3, 65535
13 %v5 = icmp ugt i32 %v4, 40
14 br i1 %v5, label %b6, label %b8
17 %v7 = trunc i32 %a0 to i8
18 store i8 %v7, ptr @glob, align 1
21 b8: ; preds = %b6, %b2
22 %v9 = phi i32 [ 1, %b6 ], [ 0, %b2 ]
26 ; With zxtb, we must not generate a cmph.gtu instruction.
27 ; CHECK-LABEL: @nocmphgtu
29 define i32 @nocmphgtu(i32 %a0, i32 %a1) #0 {
31 %v3 = xor i32 %a1, %a0
32 %v4 = and i32 %v3, 255
33 %v5 = icmp ugt i32 %v4, 40
34 br i1 %v5, label %b6, label %b8
37 %v7 = trunc i32 %a0 to i8
38 store i8 %v7, ptr @glob, align 1
41 b8: ; preds = %b6, %b2
42 %v9 = phi i32 [ 1, %b6 ], [ 0, %b2 ]
46 attributes #0 = { nounwind }