-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquirks.h
More file actions
36 lines (31 loc) · 1011 Bytes
/
quirks.h
File metadata and controls
36 lines (31 loc) · 1011 Bytes
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
#ifndef QUIRKS_H
#define QUIRKS_H
/*
* X-macro list of all quirk fields.
* Format: X(field_name, default_value)
* This is the single source of truth — the struct, defaults,
* and INI field table are all generated from this list.
*/
#define QUIRK_FIELDS(X) \
X(load_store_quirk, 1) \
X(shift_quirk, 1) \
X(jump_quirk, 0) \
X(logic_vf_quirk, 0) \
X(i_overflow_quirk, 0) \
X(draw_flag_quirk, 0) \
X(vwrap, 1) \
X(hwrap, 0)
struct quirks {
#define QUIRK_X_FIELD(name, default_val) bool name;
QUIRK_FIELDS(QUIRK_X_FIELD)
#undef QUIRK_X_FIELD
};
/* Get default quirks */
static inline struct quirks quirks_get_defaults(void) {
struct quirks defaults;
#define QUIRK_X_DEFAULT(name, default_val) defaults.name = default_val;
QUIRK_FIELDS(QUIRK_X_DEFAULT)
#undef QUIRK_X_DEFAULT
return defaults;
}
#endif // QUIRKS_H