1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le-linux-gnu < %s | FileCheck %s
3 define i16 @SEXTParam(i16 signext %0) #0 {
4 ; CHECK-LABEL: SEXTParam:
5 ; CHECK: # %bb.0: # %top
7 ; CHECK-NEXT: sth 4, -4(1)
8 ; CHECK-NEXT: addi 4, 1, -4
10 ; CHECK-NEXT: .LBB0_1: # %top
12 ; CHECK-NEXT: lharx 5, 0, 4
13 ; CHECK-NEXT: extsh 5, 5
14 ; CHECK-NEXT: cmpw 3, 5
15 ; CHECK-NEXT: bge 0, .LBB0_3
16 ; CHECK-NEXT: # %bb.2: # %top
18 ; CHECK-NEXT: sthcx. 3, 0, 4
19 ; CHECK-NEXT: bne 0, .LBB0_1
20 ; CHECK-NEXT: .LBB0_3: # %top
22 ; CHECK-NEXT: lhz 3, -4(1)
23 ; CHECK-NEXT: cmpd 7, 3, 3
24 ; CHECK-NEXT: bne- 7, .+4
28 %1 = alloca i16, align 4
29 %2 = bitcast i16* %1 to i8*
30 store i16 0, i16* %1, align 4
31 %rv.i = atomicrmw min i16* %1, i16 %0 acq_rel
32 %rv.i2 = load atomic i16, i16* %1 acquire, align 16
36 define i16 @noSEXTParam(i16 %0) #0 {
37 ; CHECK-LABEL: noSEXTParam:
38 ; CHECK: # %bb.0: # %top
40 ; CHECK-NEXT: extsh 3, 3
41 ; CHECK-NEXT: sth 4, -4(1)
42 ; CHECK-NEXT: addi 4, 1, -4
44 ; CHECK-NEXT: .LBB1_1: # %top
46 ; CHECK-NEXT: lharx 5, 0, 4
47 ; CHECK-NEXT: extsh 5, 5
48 ; CHECK-NEXT: cmpw 3, 5
49 ; CHECK-NEXT: bge 0, .LBB1_3
50 ; CHECK-NEXT: # %bb.2: # %top
52 ; CHECK-NEXT: sthcx. 3, 0, 4
53 ; CHECK-NEXT: bne 0, .LBB1_1
54 ; CHECK-NEXT: .LBB1_3: # %top
56 ; CHECK-NEXT: lhz 3, -4(1)
57 ; CHECK-NEXT: cmpd 7, 3, 3
58 ; CHECK-NEXT: bne- 7, .+4
62 %1 = alloca i16, align 4
63 %2 = bitcast i16* %1 to i8*
64 store i16 0, i16* %1, align 4
65 %rv.i = atomicrmw min i16* %1, i16 %0 acq_rel
66 %rv.i2 = load atomic i16, i16* %1 acquire, align 16
70 define i16 @noSEXTLoad(i16 *%p) #0 {
71 ; CHECK-LABEL: noSEXTLoad:
72 ; CHECK: # %bb.0: # %top
73 ; CHECK-NEXT: lhz 5, 0(3)
75 ; CHECK-NEXT: addi 3, 1, -4
76 ; CHECK-NEXT: sth 4, -4(1)
77 ; CHECK-NEXT: extsh 4, 5
79 ; CHECK-NEXT: .LBB2_1: # %top
81 ; CHECK-NEXT: lharx 5, 0, 3
82 ; CHECK-NEXT: extsh 5, 5
83 ; CHECK-NEXT: cmpw 4, 5
84 ; CHECK-NEXT: bge 0, .LBB2_3
85 ; CHECK-NEXT: # %bb.2: # %top
87 ; CHECK-NEXT: sthcx. 4, 0, 3
88 ; CHECK-NEXT: bne 0, .LBB2_1
89 ; CHECK-NEXT: .LBB2_3: # %top
91 ; CHECK-NEXT: lhz 3, -4(1)
92 ; CHECK-NEXT: cmpd 7, 3, 3
93 ; CHECK-NEXT: bne- 7, .+4
97 %0 = load i16, i16* %p, align 2
98 %1 = alloca i16, align 4
99 %2 = bitcast i16* %1 to i8*
100 store i16 0, i16* %1, align 4
101 %rv.i = atomicrmw min i16* %1, i16 %0 acq_rel
102 %rv.i2 = load atomic i16, i16* %1 acquire, align 16
105 attributes #0 = { nounwind }