powerc: Fix asm machine directive for some CPUs
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Tue, 18 Jan 2022 11:44:53 +0000 (12:44 +0100)
committerSebastian Huber <sebastian.huber@embedded-brains.de>
Wed, 19 Jan 2022 06:50:49 +0000 (07:50 +0100)
For some CPUs, the assembler machine directive cannot be determined by ISA
flags.

gcc/

PR target/104090
* config/rs6000/rs6000.cc (rs6000_machine_from_flags): Use also
rs6000_cpu.

gcc/config/rs6000/rs6000.cc

index 7a4ef5e..2a338a2 100644 (file)
@@ -5935,6 +5935,31 @@ 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";
+    }
+
   HOST_WIDE_INT flags = rs6000_isa_flags;
 
   /* Disable the flags that should never influence the .machine selection.  */