From 0bec4f557a96e1a40437cf5af20cc78a5eec8a63 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 11 Jan 2023 22:29:53 +0000 Subject: getting closer --- unsorted/TargetOptimizer-ppc-mach.c | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'unsorted/TargetOptimizer-ppc-mach.c') diff --git a/unsorted/TargetOptimizer-ppc-mach.c b/unsorted/TargetOptimizer-ppc-mach.c index 10fe33e..6c86356 100644 --- a/unsorted/TargetOptimizer-ppc-mach.c +++ b/unsorted/TargetOptimizer-ppc-mach.c @@ -17,28 +17,28 @@ int TargetSetOptFlags(short val, Boolean set) { pBackEnd.processor = schedule_ppc_default; break; case 'SG': - pBackEnd.processor = schedule_ppc_default = 0; + pBackEnd.processor = schedule_ppc_default = PrefCPU_Generic; break; case 'S1': - pBackEnd.processor = schedule_ppc_default = 1; + pBackEnd.processor = schedule_ppc_default = PrefCPU_601; break; case 'S3': - pBackEnd.processor = schedule_ppc_default = 2; + pBackEnd.processor = schedule_ppc_default = PrefCPU_603; break; case 'S#': - pBackEnd.processor = schedule_ppc_default = 3; + pBackEnd.processor = schedule_ppc_default = PrefCPU_603e; break; case 'S4': - pBackEnd.processor = schedule_ppc_default = 4; + pBackEnd.processor = schedule_ppc_default = PrefCPU_604; break; case 'S%': - pBackEnd.processor = schedule_ppc_default = 5; + pBackEnd.processor = schedule_ppc_default = PrefCPU_604e; break; case 'S7': - pBackEnd.processor = schedule_ppc_default = 6; + pBackEnd.processor = schedule_ppc_default = PrefCPU_750; break; case 'SA': - pBackEnd.processor = schedule_ppc_default = 7; + pBackEnd.processor = schedule_ppc_default = PrefCPU_Altivec; break; default: return 0; @@ -48,22 +48,24 @@ int TargetSetOptFlags(short val, Boolean set) { } void TargetDisplayOptimizationOptions(Handle txt) { + PrefCPU p; + if (!pBackEnd.schedule) { HPrintF(txt, "\t- no instruction scheduling\n"); } else { HPrintF(txt, "\t- schedule for %s\n", - (pBackEnd.processor == 0) ? "generic PPC" : - (pBackEnd.processor == 1) ? "601" : - (pBackEnd.processor == 2) ? "603" : - (pBackEnd.processor == 3) ? "603e" : - (pBackEnd.processor == 4) ? "604" : - (pBackEnd.processor == 5) ? "604e" : - (pBackEnd.processor == 6) ? "750" : - (pBackEnd.processor == 7) ? "Altivec" : + !(p = (PrefCPU) pBackEnd.processor) ? "generic PPC" : + (p == PrefCPU_601) ? "601" : + (p == PrefCPU_603) ? "603" : + (p == PrefCPU_603e) ? "603e" : + (p == PrefCPU_604) ? "604" : + (p == PrefCPU_604e) ? "604e" : + (p == PrefCPU_750) ? "750" : + (p == PrefCPU_Altivec) ? "Altivec" : "???" ); } } -void TargetSetPragmaOptimizationsToUnspecified() { +void TargetSetPragmaOptimizationsToUnspecified(void) { } -- cgit v1.2.3