General cleanup; add -t options support to print all options
[deliverable/binutils-gdb.git] / sim / ppc / options.c
1 /* This file is part of the program psim.
2
3 Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 */
20
21 #ifndef _OPTIONS_C_
22 #define _OPTIONS_C_
23
24 #include "basics.h"
25 #include "options.h"
26
27 STATIC_INLINE const char *
28 options_byte_order (int order)
29 {
30 switch (order) {
31 case 0: return "0";
32 case BIG_ENDIAN: return "BIG_ENDIAN";
33 case LITTLE_ENDIAN: return "LITTLE_ENDIAN";
34 }
35
36 return "UNKNOWN";
37 }
38
39 STATIC_INLINE const char *
40 options_env (int env)
41 {
42 switch (env) {
43 case OPERATING_ENVIRONMENT: return "OPERATING";
44 case VIRTUAL_ENVIRONMENT: return "VIRTUAL";
45 case USER_ENVIRONMENT: return "USER";
46 case 0: return 0;
47 }
48
49 return "UNKNOWN";
50 }
51
52 STATIC_INLINE const char *
53 options_align (int align)
54 {
55 switch (align) {
56 case NONSTRICT_ALIGNMENT: return "NONSTRICT";
57 case STRICT_ALIGNMENT: return "STRICT";
58 case 0: return "0";
59 }
60
61 return "UNKNOWN";
62 }
63
64 STATIC_INLINE const char *
65 options_float (int float_type)
66 {
67 switch (float_type) {
68 case SOFT_FLOATING_POINT: return "SOFTWARE";
69 case HARD_FLOATING_POINT: return "HARDWARE";
70 }
71
72 return "UNKNOWN";
73 }
74
75 STATIC_INLINE const char *
76 options_mon (int mon)
77 {
78 switch (mon) {
79 case MONITOR_INSTRUCTION_ISSUE|MONITOR_LOAD_STORE_UNIT: return "ALL";
80 case MONITOR_INSTRUCTION_ISSUE: return "INSTRUCTION";
81 case MONITOR_LOAD_STORE_UNIT: return "MEMORY";
82 case 0: return "0";
83 }
84
85 return "UNKNOWN";
86 }
87
88 STATIC_INLINE const char *
89 options_ppc (ppc_model ppc)
90 {
91 switch (ppc) {
92 case PPC_MODEL_UNKNOWN: return "NONE";
93 case PPC_MODEL_601: return "601";
94 case PPC_MODEL_602: return "602";
95 case PPC_MODEL_603: return "603";
96 case PPC_MODEL_603e: return "603e";
97 case PPC_MODEL_604: return "604";
98 case PPC_MODEL_403: return "403";
99 case PPC_MODEL_505: return "505";
100 case PPC_MODEL_821: return "821";
101 case PPC_MODEL_860: return "860";
102 }
103
104 return "UNKNOWN";
105 }
106
107 void
108 print_options (void)
109 {
110 printf_filtered ("WITH_HOST_BYTE_ORDER = %s\n", options_byte_order (WITH_HOST_BYTE_ORDER));
111 printf_filtered ("WITH_TARGET_BYTE_ORDER = %s\n", options_byte_order (WITH_TARGET_BYTE_ORDER));
112 printf_filtered ("WITH_BSWAP = %d\n", WITH_BSWAP);
113 printf_filtered ("WITH_SMP = %d\n", WITH_SMP);
114 printf_filtered ("WITH_HOST_WORD_BITSIZE = %d\n", WITH_HOST_WORD_BITSIZE);
115 printf_filtered ("WITH_TARGET_WORD_BITSIZE = %d\n", WITH_TARGET_WORD_BITSIZE);
116 printf_filtered ("WITH_ENVIRONMENT = %s\n", options_env(WITH_ENVIRONMENT));
117 printf_filtered ("WITH_EVENTS = %d\n", WITH_EVENTS);
118 printf_filtered ("WITH_TIME_BASE = %d\n", WITH_TIME_BASE);
119 printf_filtered ("WITH_CALLBACK_MEMORY = %d\n", WITH_CALLBACK_MEMORY);
120 printf_filtered ("WITH_ALIGNMENT = %s\n", options_align (WITH_ALIGNMENT));
121 printf_filtered ("WITH_FLOATING_POINT = %s\n", options_float (WITH_FLOATING_POINT));
122 printf_filtered ("WITH_TRACE = %d\n", WITH_TRACE);
123 printf_filtered ("WITH_ASSERT = %d\n", WITH_ASSERT);
124 printf_filtered ("WITH_MON = %s\n", options_mon (WITH_MON));
125 printf_filtered ("WITH_FUNCTION_UNIT = %d\n", WITH_FUNCTION_UNIT);
126 printf_filtered ("WITH_DEFAULT_PPC_MODEL = %s\n", options_ppc (WITH_DEFAULT_PPC_MODEL));
127 printf_filtered ("WITH_PPC_MODEL = %s\n", options_ppc (WITH_PPC_MODEL));
128 printf_filtered ("DEFAULT_INLINE = %d\n", DEFAULT_INLINE);
129 printf_filtered ("SIM_ENDIAN_INLINE = %d\n", SIM_ENDIAN_INLINE);
130 printf_filtered ("BITS_INLINE = %d\n", BITS_INLINE);
131 printf_filtered ("CPU_INLINE = %d\n", CPU_INLINE);
132 printf_filtered ("VM_INLINE = %d\n", VM_INLINE);
133 printf_filtered ("CORE_INLINE = %d\n", CORE_INLINE);
134 printf_filtered ("EVENTS_INLINE = %d\n", EVENTS_INLINE);
135 printf_filtered ("MON_INLINE = %d\n", MON_INLINE);
136 printf_filtered ("INTERRUPTS_INLINE = %d\n", INTERRUPTS_INLINE);
137 printf_filtered ("REGISTERS_INLINE = %d\n", REGISTERS_INLINE);
138 printf_filtered ("DEVICE_TREE_INLINE = %d\n", DEVICE_TREE_INLINE);
139 printf_filtered ("DEVICES_INLINE = %d\n", DEVICES_INLINE);
140 printf_filtered ("SPREG_INLINE = %d\n", SPREG_INLINE);
141 printf_filtered ("SEMANTICS_INLINE = %d\n", SEMANTICS_INLINE);
142 printf_filtered ("IDECODE_INLINE = %d\n", IDECODE_INLINE);
143 printf_filtered ("FUNCTION_UNIT_INLINE = %d\n", FUNCTION_UNIT_INLINE);
144 }
145
146 #endif /* _OPTIONS_C_ */
This page took 0.038093 seconds and 5 git commands to generate.