2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 #define feature_name c
20 #define static_test_c (__riscv_c)
21 #define dynamic_test (riscv_hwp[0].key >= 0 ? riscv_hwp[0].value & (1ULL << 1) : trap_insn("01000100"))
24 #define feature_name zba
25 #define static_test_zba (__riscv_zba)
26 #define dynamic_test (riscv_hwp[0].key >= 0 ? riscv_hwp[0].value & (1ULL << 3) : trap_insn("33200020"))
29 #define feature_name zbb
30 #define static_test_zbb (__riscv_zbb)
31 #define dynamic_test (riscv_hwp[0].key >= 0 ? riscv_hwp[0].value & (1ULL << 4) : trap_insn("13100060"))
34 #define feature_name zbs
35 #define static_test_zbs (__riscv_zbs)
36 #define dynamic_test (riscv_hwp[0].key >= 0 ? riscv_hwp[0].value & (1ULL << 5) : trap_insn("33100048"))
39 #define feature_name unaligned
40 #define static_test_unaligned 0
41 #define dynamic_test (riscv_hwp[1].key >= 0 && (riscv_hwp[1].value & 7) == 3)
44 /* riscv_zicond = trap_insn("3350000e"); */