6 static void init_riscv(const struct target
*self
)
8 if (arch_cmodel
== CMODEL_UNKNOWN
)
9 arch_cmodel
= CMODEL_MEDLOW
;
11 arch_cmodel
= CMODEL_PIC
;
14 static void predefine_riscv(const struct target
*self
)
16 static const char *cmodels
[CMODEL_LAST
] = {
17 [CMODEL_MEDANY
] = "medany",
18 [CMODEL_MEDLOW
] = "medlow",
21 const char *cmodel
= cmodels
[arch_cmodel
];
23 predefine("__riscv", 1, "1");
24 predefine("__riscv_xlen", 1, "%d", ptr_ctype
.bit_size
);
27 predefine_strong("__riscv_cmodel_%s", cmodel
);
30 const struct target target_riscv32
= {
36 .target_64bit
= &target_riscv64
,
39 .predefine
= predefine_riscv
,
42 const struct target target_riscv64
= {
49 .target_32bit
= &target_riscv32
,
52 .predefine
= predefine_riscv
,