1 /* RISC-V-specific code for C family languages.
2 Copyright (C) 2011-2017 Free Software Foundation, Inc.
3 Contributed by Andrew Waterman (andrew@sifive.com).
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
23 #include "coretypes.h"
25 #include "c-family/c-common.h"
28 #define builtin_define(TXT) cpp_define (pfile, TXT)
30 /* Implement TARGET_CPU_CPP_BUILTINS. */
33 riscv_cpu_cpp_builtins (cpp_reader
*pfile
)
35 builtin_define ("__riscv");
38 builtin_define ("__riscv_compressed");
41 builtin_define ("__riscv_atomic");
44 builtin_define ("__riscv_mul");
46 builtin_define ("__riscv_div");
47 if (TARGET_DIV
&& TARGET_MUL
)
48 builtin_define ("__riscv_muldiv");
50 builtin_define_with_int_value ("__riscv_xlen", UNITS_PER_WORD
* 8);
51 if (TARGET_HARD_FLOAT
)
52 builtin_define_with_int_value ("__riscv_flen", UNITS_PER_FP_REG
* 8);
54 if (TARGET_HARD_FLOAT
&& TARGET_FDIV
)
56 builtin_define ("__riscv_fdiv");
57 builtin_define ("__riscv_fsqrt");
64 builtin_define ("__riscv_float_abi_soft");
69 builtin_define ("__riscv_float_abi_single");
74 builtin_define ("__riscv_float_abi_double");
81 builtin_define ("__riscv_cmodel_medlow");
85 builtin_define ("__riscv_cmodel_medany");
89 builtin_define ("__riscv_cmodel_pic");