6 int main(int argc
, char **argv
)
8 /* This program is passed in a minimum ISA that the underlying hardware
9 * needs to support. If the HW supports this ISA or newer, return 0
10 * for supported. Otherwise, return 1 for not supported. Return 2 for
13 * First argument is required, it must be an ISA version number.
14 * Second argument "-debug" is optional. If passed, then the defined ISA
21 /* set the isa_level set by the Make */
23 if ((argc
== 3) && (strcmp(argv
[2], "-debug") == 0)) {
26 } else if (argc
!= 2) {
27 fprintf(stderr
, "usage: min_power_ISA <ISA> [-debug]\n" );
34 if (debug
) printf("HAS_ISA_2_05 is set\n");
39 if (debug
) printf("HAS_ISA_2_06 is set\n");
44 if (debug
) printf("HAS_ISA_2_07 is set\n");
49 if (debug
) printf("HAS_ISA_3_00 is set\n");
53 /* return 0 for supported (success), 1 for not supported (failure) */
54 if (strcmp (min_isa
, "2.05") == 0) {
55 return !(isa_level
>= 5);
57 } else if (strcmp (min_isa
, "2.06") == 0) {
58 return !(isa_level
>= 6);
60 } else if (strcmp (min_isa
, "2.07") == 0) {
61 return !(isa_level
>= 7);
63 } else if (strcmp (min_isa
, "3.00") == 0) {
64 return !(isa_level
>= 8);
67 fprintf(stderr
, "ERROR: invalid ISA version '%s'. Valid versions numbers are:\n", min_isa
);
68 fprintf(stderr
, " 2.05, 2.06, 2.07, 3.00\n" );