summaryrefslogtreecommitdiff
path: root/unsorted/TargetOptimizer-ppc-mach.c
blob: 6c86356361e049ad34831521e94977b19efd44e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#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 = PrefCPU_Generic;
            break;
        case 'S1':
            pBackEnd.processor = schedule_ppc_default = PrefCPU_601;
            break;
        case 'S3':
            pBackEnd.processor = schedule_ppc_default = PrefCPU_603;
            break;
        case 'S#':
            pBackEnd.processor = schedule_ppc_default = PrefCPU_603e;
            break;
        case 'S4':
            pBackEnd.processor = schedule_ppc_default = PrefCPU_604;
            break;
        case 'S%':
            pBackEnd.processor = schedule_ppc_default = PrefCPU_604e;
            break;
        case 'S7':
            pBackEnd.processor = schedule_ppc_default = PrefCPU_750;
            break;
        case 'SA':
            pBackEnd.processor = schedule_ppc_default = PrefCPU_Altivec;
            break;
        default:
            return 0;
    }

    return 1;
}

void TargetDisplayOptimizationOptions(Handle txt) {
    PrefCPU p;

    if (!pBackEnd.schedule) {
        HPrintF(txt, "\t- no instruction scheduling\n");
    } else {
        HPrintF(txt, "\t- schedule for %s\n",
                !(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) {
}