Skip to content

Commit 5eebb58

Browse files
authored
PPC: Fix regression for 32-bit ppc with 64-bit support (llvm#159893)
Fixes regression after e5bbaa9. e5500 accidentally still had the 64bit feature applied instead of 64bit-support.
1 parent 3baddef commit 5eebb58

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

llvm/lib/Target/PowerPC/PPC.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ def : ProcessorModel<"e500mc", PPCE500mcModel,
695695
FeatureSTFIWX, FeatureICBT, FeatureBookE,
696696
FeatureISEL, FeatureMFTB]>;
697697
def : ProcessorModel<"e5500", PPCE5500Model,
698-
[DirectiveE5500, FeatureMFOCRF, Feature64Bit,
698+
[DirectiveE5500, FeatureMFOCRF, Feature64BitSupport,
699699
FeatureSTFIWX, FeatureICBT, FeatureBookE,
700700
FeatureISEL, FeatureMFTB]>;
701701
def : ProcessorModel<"a2", PPCA2Model,
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
2+
; RUN: llc -mtriple=powerpc-unknown-linux-gnu -mcpu=e5500 < %s | FileCheck -check-prefix=PPC32 %s
3+
; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=e5500 < %s | FileCheck -check-prefix=PPC64 %s
4+
5+
; Test that ppc32 triples work on cpus that support 64-bit.
6+
7+
declare void @func(ptr)
8+
declare void @func_no_args()
9+
10+
define void @call_assert() #0 {
11+
; PPC32-LABEL: call_assert:
12+
; PPC32: # %bb.0:
13+
; PPC32-NEXT: mflr 0
14+
; PPC32-NEXT: stwu 1, -16(1)
15+
; PPC32-NEXT: li 3, 0
16+
; PPC32-NEXT: stw 0, 20(1)
17+
; PPC32-NEXT: bl func
18+
; PPC32-NEXT: lwz 0, 20(1)
19+
; PPC32-NEXT: addi 1, 1, 16
20+
; PPC32-NEXT: mtlr 0
21+
; PPC32-NEXT: blr
22+
;
23+
; PPC64-LABEL: call_assert:
24+
; PPC64: # %bb.0:
25+
; PPC64-NEXT: mflr 0
26+
; PPC64-NEXT: stdu 1, -112(1)
27+
; PPC64-NEXT: li 3, 0
28+
; PPC64-NEXT: std 0, 128(1)
29+
; PPC64-NEXT: bl func
30+
; PPC64-NEXT: nop
31+
; PPC64-NEXT: addi 1, 1, 112
32+
; PPC64-NEXT: ld 0, 16(1)
33+
; PPC64-NEXT: mtlr 0
34+
; PPC64-NEXT: blr
35+
call void @func(ptr null)
36+
ret void
37+
}
38+
39+
define void @call_nop_select_fail() #0 {
40+
; PPC32-LABEL: call_nop_select_fail:
41+
; PPC32: # %bb.0:
42+
; PPC32-NEXT: mflr 0
43+
; PPC32-NEXT: stwu 1, -16(1)
44+
; PPC32-NEXT: stw 0, 20(1)
45+
; PPC32-NEXT: bl func_no_args
46+
; PPC32-NEXT: lwz 0, 20(1)
47+
; PPC32-NEXT: addi 1, 1, 16
48+
; PPC32-NEXT: mtlr 0
49+
; PPC32-NEXT: blr
50+
;
51+
; PPC64-LABEL: call_nop_select_fail:
52+
; PPC64: # %bb.0:
53+
; PPC64-NEXT: mflr 0
54+
; PPC64-NEXT: stdu 1, -112(1)
55+
; PPC64-NEXT: std 0, 128(1)
56+
; PPC64-NEXT: bl func_no_args
57+
; PPC64-NEXT: nop
58+
; PPC64-NEXT: addi 1, 1, 112
59+
; PPC64-NEXT: ld 0, 16(1)
60+
; PPC64-NEXT: mtlr 0
61+
; PPC64-NEXT: blr
62+
call void @func_no_args()
63+
ret void
64+
}
65+
66+
attributes #0 = { nounwind }

0 commit comments

Comments
 (0)