public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Sebastian Huber <sh@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r10-10858] rs6000: Improve .machine Date: Mon, 20 Jun 2022 20:25:32 +0000 (GMT) [thread overview] Message-ID: <20220620202532.263123858287@sourceware.org> (raw) https://gcc.gnu.org/g:6142d65f4f528067f31e86bb97c07a661f2d66e7 commit r10-10858-g6142d65f4f528067f31e86bb97c07a661f2d66e7 Author: Segher Boessenkool <segher@kernel.crashing.org> Date: Tue Mar 1 17:04:29 2022 +0000 rs6000: Improve .machine This adds more correct .machine for most older CPUs. It should be conservative in the sense that everything we handled before we handle at least as well now. This does not yet revamp the server CPU handling, it is too risky at this point in time. Tested on powerpc64-linux {-m32,-m64}. Also manually tested with all -mcpu=, and the output of that passed through the GNU assembler. 2022-03-04 Segher Boessenkool <segher@kernel.crashing.org> * config/rs6000/rs6000.c (rs6000_machine_from_flags): Restructure a bit. Handle most older CPUs. (cherry picked from commit 77eccbf39ed55297802bb66dff5f62507a7239e3) Diff: --- gcc/config/rs6000/rs6000.c | 81 ++++++++++++++++++++++++++++++---------------- 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 9e6f8bee6bf..0b00799bffd 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -5547,33 +5547,60 @@ const char *rs6000_machine; const char * rs6000_machine_from_flags (void) { - /* For some CPUs, the machine cannot be determined by ISA flags. We have to - check them first. */ - switch (rs6000_cpu) - { - case PROCESSOR_PPC8540: - case PROCESSOR_PPC8548: - return "e500"; - - case PROCESSOR_PPCE300C2: - case PROCESSOR_PPCE300C3: - return "e300"; - - case PROCESSOR_PPCE500MC: - return "e500mc"; - - case PROCESSOR_PPCE500MC64: - return "e500mc64"; - - case PROCESSOR_PPCE5500: - return "e5500"; - - case PROCESSOR_PPCE6500: - return "e6500"; - - default: - break; - } + /* e300 and e500 */ + if (rs6000_cpu == PROCESSOR_PPCE300C2 || rs6000_cpu == PROCESSOR_PPCE300C3) + return "e300"; + if (rs6000_cpu == PROCESSOR_PPC8540 || rs6000_cpu == PROCESSOR_PPC8548) + return "e500"; + if (rs6000_cpu == PROCESSOR_PPCE500MC) + return "e500mc"; + if (rs6000_cpu == PROCESSOR_PPCE500MC64) + return "e500mc64"; + if (rs6000_cpu == PROCESSOR_PPCE5500) + return "e5500"; + if (rs6000_cpu == PROCESSOR_PPCE6500) + return "e6500"; + + /* 400 series */ + if (rs6000_cpu == PROCESSOR_PPC403) + return "\"403\""; + if (rs6000_cpu == PROCESSOR_PPC405) + return "\"405\""; + if (rs6000_cpu == PROCESSOR_PPC440) + return "\"440\""; + if (rs6000_cpu == PROCESSOR_PPC476) + return "\"476\""; + + /* A2 */ + if (rs6000_cpu == PROCESSOR_PPCA2) + return "a2"; + + /* Cell BE */ + if (rs6000_cpu == PROCESSOR_CELL) + return "cell"; + + /* Titan */ + if (rs6000_cpu == PROCESSOR_TITAN) + return "titan"; + + /* 500 series and 800 series */ + if (rs6000_cpu == PROCESSOR_MPCCORE) + return "\"821\""; + + /* 600 series and 700 series, "classic" */ + if (rs6000_cpu == PROCESSOR_PPC601 || rs6000_cpu == PROCESSOR_PPC603 + || rs6000_cpu == PROCESSOR_PPC604 || rs6000_cpu == PROCESSOR_PPC604e + || rs6000_cpu == PROCESSOR_PPC750 || rs6000_cpu == PROCESSOR_POWERPC) + return "ppc"; + + /* Classic with AltiVec, "G4" */ + if (rs6000_cpu == PROCESSOR_PPC7400 || rs6000_cpu == PROCESSOR_PPC7450) + return "\"7450\""; + + /* The older 64-bit CPUs */ + if (rs6000_cpu == PROCESSOR_PPC620 || rs6000_cpu == PROCESSOR_PPC630 + || rs6000_cpu == PROCESSOR_RS64A || rs6000_cpu == PROCESSOR_POWERPC64) + return "ppc64"; HOST_WIDE_INT flags = rs6000_isa_flags;
reply other threads:[~2022-06-20 20:25 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220620202532.263123858287@sourceware.org \ --to=sh@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).