mirror of https://git.wuffs.org/MWCC
70 lines
2.0 KiB
C
70 lines
2.0 KiB
C
|
#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() {
|
||
|
}
|