Skip to content

Commit f931290

Browse files
committed
[PowerPC] Parse and ignore .machine
glibc/sysdeps/powerpc/powerpc64 has .machine {altivec,power4,power5,power6,power7,power8} (.machine power9 is planned in sysdeps/powerpc/powerpc64/power9/strcmp.S). The diagnostic is not useful anyway so just delete it.
1 parent 6d02d12 commit f931290

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,11 +1656,7 @@ bool PPCAsmParser::ParseDirectiveMachine(SMLoc L) {
16561656

16571657
// FIXME: Right now, the parser always allows any available
16581658
// instruction, so the .machine directive is not useful.
1659-
// Implement ".machine any" (by doing nothing) for the benefit
1660-
// of existing assembler code. Likewise, we can then implement
1661-
// ".machine push" and ".machine pop" as no-op.
1662-
if (CPU != "any" && CPU != "push" && CPU != "pop" && CPU != "ppc64")
1663-
return TokError("unrecognized machine type");
1659+
// In the wild, any/push/pop/ppc64/altivec/power[4-9] are seen.
16641660

16651661
Parser.Lex();
16661662

llvm/test/MC/PowerPC/ppc-machine.s

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@
1515
.machine "pop"
1616

1717
.machine ppc64
18+
19+
# Used in glibc.
20+
.machine altivec
21+
.machine power4
22+
.machine power8

0 commit comments

Comments
 (0)