From d1f153d34b023d81768f6087f67dbfff714bafc9 Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 19 Oct 2022 21:16:13 +0100 Subject: let's commit all this before my VM blows up and nukes my work --- unsorted/TargetOptimizer-ppc-mach.c | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 unsorted/TargetOptimizer-ppc-mach.c (limited to 'unsorted/TargetOptimizer-ppc-mach.c') diff --git a/unsorted/TargetOptimizer-ppc-mach.c b/unsorted/TargetOptimizer-ppc-mach.c new file mode 100644 index 0000000..10fe33e --- /dev/null +++ b/unsorted/TargetOptimizer-ppc-mach.c @@ -0,0 +1,69 @@ +#include "parser.h" + +char schedule_ppc_default; + +int TargetSetOptFlags(short val, Boolean set) { + switch (val) { + case 'Pe': + pBackEnd.peephole = set; + break; + case 'Sn': + pBackEnd.schedule = 0; + break; + case 'Sh': + pBackEnd.schedule = set; + break; + case 'S?': + pBackEnd.processor = schedule_ppc_default; + break; + case 'SG': + pBackEnd.processor = schedule_ppc_default = 0; + break; + case 'S1': + pBackEnd.processor = schedule_ppc_default = 1; + break; + case 'S3': + pBackEnd.processor = schedule_ppc_default = 2; + break; + case 'S#': + pBackEnd.processor = schedule_ppc_default = 3; + break; + case 'S4': + pBackEnd.processor = schedule_ppc_default = 4; + break; + case 'S%': + pBackEnd.processor = schedule_ppc_default = 5; + break; + case 'S7': + pBackEnd.processor = schedule_ppc_default = 6; + break; + case 'SA': + pBackEnd.processor = schedule_ppc_default = 7; + break; + default: + return 0; + } + + return 1; +} + +void TargetDisplayOptimizationOptions(Handle txt) { + 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" : + "???" + ); + } +} + +void TargetSetPragmaOptimizationsToUnspecified() { +} -- cgit v1.2.3