diff options
author | Ash Wolf <ninji@wuffs.org> | 2022-10-19 21:16:13 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2022-10-19 21:16:13 +0100 |
commit | d1f153d34b023d81768f6087f67dbfff714bafc9 (patch) | |
tree | a694d470a60655d0cda15a70791fbdb90a2398cf /unsorted/TargetOptimizer-ppc-mach.c | |
parent | 775b6861666af36d317fb577cf489e2c6377f878 (diff) | |
download | MWCC-d1f153d34b023d81768f6087f67dbfff714bafc9.tar.gz MWCC-d1f153d34b023d81768f6087f67dbfff714bafc9.zip |
let's commit all this before my VM blows up and nukes my work
Diffstat (limited to 'unsorted/TargetOptimizer-ppc-mach.c')
-rw-r--r-- | unsorted/TargetOptimizer-ppc-mach.c | 69 |
1 files changed, 69 insertions, 0 deletions
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() { +} |