Message ID | 20220118115139.48203-1-sebastian.huber@embedded-brains.de |
---|---|
State | New |
Headers | show |
Series | powerc: Fix asm machine directive for some CPUs | expand |
Hi! On Tue, Jan 18, 2022 at 12:51:39PM +0100, Sebastian Huber wrote: > For some CPUs, the assembler machine directive cannot be determined by ISA > flags. That may be the best we can do here, with the current setup, yes. > PR 104090/target > * config/rs6000/rs6000.cc (rs6000_machine_from_flags): Use also > rtems_cpu. rs6000_cpu you mean :-) > + /* 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"; Ah I could not figure out what core those two are. But you know it :-) > + default: > + break; Please don't do that. You can do default: break; break; /* And just to make sure: */ break; break; and it will do exactly the same as not having a default at all. Not having such useless code is by far the most readable, so please don't include a default case at all. Okay with those changes. Thanks! Segher
On 18/01/2022 22:42, Segher Boessenkool wrote: >> + default: >> + break; > Please don't do that. You can do > > default: > break; > break; > /* And just to make sure: */ > break; > break; > > and it will do exactly the same as not having a default at all. Not > having such useless code is by far the most readable, so please don't > include a default case at all. I removed the default case. I hope this is what you wanted. > > Okay with those changes. Thanks! Thanks for having a look at this. I would like to back port this patch also to the GCC 10 and 11 branches.
On 19/01/2022 07:54, Sebastian Huber wrote: > >> >> Okay with those changes. Thanks! > > Thanks for having a look at this. I would like to back port this patch > also to the GCC 10 and 11 branches. The default is to ask for back ports after a break. Can I back port the patch (with the default: break) to GCC 10 and 11 now?
On Wed, Feb 02, 2022 at 06:07:38PM +0100, Sebastian Huber wrote: > On 19/01/2022 07:54, Sebastian Huber wrote: > >>Okay with those changes. Thanks! > > > >Thanks for having a look at this. I would like to back port this patch > >also to the GCC 10 and 11 branches. > > The default is to ask for back ports after a break. Can I back port the > patch (with the default: break) to GCC 10 and 11 now? I have many more changes, but I'll deal with that. Okay for 11 and 10. Thanks! Segher
diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 7a4ef5e6c0a8..d37775ece84d 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -5935,6 +5935,34 @@ 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; + } + HOST_WIDE_INT flags = rs6000_isa_flags; /* Disable the flags that should never influence the .machine selection. */