Author: Fangrui Song Date: 2020-12-28T12:20:40-08:00 New Revision: f931290308abd0eebecae385cd32ca3a25ddd9be
URL: https://github.com/llvm/llvm-project/commit/f931290308abd0eebecae385cd32ca3a25ddd9be DIFF: https://github.com/llvm/llvm-project/commit/f931290308abd0eebecae385cd32ca3a25ddd9be.diff LOG: [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. Added: Modified: llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp llvm/test/MC/PowerPC/ppc-machine.s Removed: ################################################################################ diff --git a/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp b/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp index 2ff87c20ab25..085acffdb5f0 100644 --- a/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp +++ b/llvm/lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp @@ -1656,11 +1656,7 @@ bool PPCAsmParser::ParseDirectiveMachine(SMLoc L) { // FIXME: Right now, the parser always allows any available // instruction, so the .machine directive is not useful. - // Implement ".machine any" (by doing nothing) for the benefit - // of existing assembler code. Likewise, we can then implement - // ".machine push" and ".machine pop" as no-op. - if (CPU != "any" && CPU != "push" && CPU != "pop" && CPU != "ppc64") - return TokError("unrecognized machine type"); + // In the wild, any/push/pop/ppc64/altivec/power[4-9] are seen. Parser.Lex(); diff --git a/llvm/test/MC/PowerPC/ppc-machine.s b/llvm/test/MC/PowerPC/ppc-machine.s index 22a6cd7ef73a..f7b71f868799 100644 --- a/llvm/test/MC/PowerPC/ppc-machine.s +++ b/llvm/test/MC/PowerPC/ppc-machine.s @@ -15,3 +15,8 @@ .machine "pop" .machine ppc64 + +# Used in glibc. + .machine altivec + .machine power4 + .machine power8 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits