| 1 | |
| 2 | #ifdef CAPSTONE_HAS_RISCVcxx . . $ `<built-in>:425:9`! |
| 3 | |
| 4 | #include <stdio.h> // debug |
| 5 | #include <string.h> |
| 6 | |
| 7 | #include "../../utils.h"cxx . . $ `<file>/utils.h`/ |
| 8 | |
| 9 | #include "RISCVMapping.h"cxx . . $ `<file>/arch/RISCV/RISCVMapping.h`/ |
| 10 | #include "RISCVInstPrinter.h"cxx . . $ `<file>/arch/RISCV/RISCVInstPrinter.h`/ |
| 11 | |
| 12 | #define GET_INSTRINFO_ENUMcxx . . $ `arch/RISCV/RISCVMapping.c:12:9`! |
| 13 | #include "RISCVGenInstrInfo.inc"cxx . . $ `<file>/arch/RISCV/RISCVGenInstrInfo.inc`/ |
| 14 | |
| 15 | #ifndef CAPSTONE_DIET |
| 16 | static const name_mapcxx . . $ name_map# reg_name_mapscxx . . $ reg_name_maps.[] = { |
| 17 | { RISCV_REG_INVALIDcxx . . $ RISCV_REG_INVALID., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! }, |
| 18 | |
| 19 | { RISCV_REG_X0cxx . . $ RISCV_REG_X0., "zero" }, |
| 20 | { RISCV_REG_X1cxx . . $ RISCV_REG_X1., "ra" }, |
| 21 | { RISCV_REG_X2cxx . . $ RISCV_REG_X2., "sp" }, |
| 22 | { RISCV_REG_X3cxx . . $ RISCV_REG_X3., "gp" }, |
| 23 | { RISCV_REG_X4cxx . . $ RISCV_REG_X4., "tp" }, |
| 24 | { RISCV_REG_X5cxx . . $ RISCV_REG_X5., "t0" }, |
| 25 | { RISCV_REG_X6cxx . . $ RISCV_REG_X6., "t1" }, |
| 26 | { RISCV_REG_X7cxx . . $ RISCV_REG_X7., "t2" }, |
| 27 | { RISCV_REG_X8cxx . . $ RISCV_REG_X8., "s0" }, |
| 28 | { RISCV_REG_X9cxx . . $ RISCV_REG_X9., "s1" }, |
| 29 | { RISCV_REG_X10cxx . . $ RISCV_REG_X10., "a0" }, |
| 30 | { RISCV_REG_X11cxx . . $ RISCV_REG_X11., "a1" }, |
| 31 | { RISCV_REG_X12cxx . . $ RISCV_REG_X12., "a2" }, |
| 32 | { RISCV_REG_X13cxx . . $ RISCV_REG_X13., "a3" }, |
| 33 | { RISCV_REG_X14cxx . . $ RISCV_REG_X14., "a4" }, |
| 34 | { RISCV_REG_X15cxx . . $ RISCV_REG_X15., "a5" }, |
| 35 | { RISCV_REG_X16cxx . . $ RISCV_REG_X16., "a6" }, |
| 36 | { RISCV_REG_X17cxx . . $ RISCV_REG_X17., "a7" }, |
| 37 | { RISCV_REG_X18cxx . . $ RISCV_REG_X18., "s2" }, |
| 38 | { RISCV_REG_X19cxx . . $ RISCV_REG_X19., "s3" }, |
| 39 | { RISCV_REG_X20cxx . . $ RISCV_REG_X20., "s4" }, |
| 40 | { RISCV_REG_X21cxx . . $ RISCV_REG_X21., "s5" }, |
| 41 | { RISCV_REG_X22cxx . . $ RISCV_REG_X22., "s6" }, |
| 42 | { RISCV_REG_X23cxx . . $ RISCV_REG_X23., "s7" }, |
| 43 | { RISCV_REG_X24cxx . . $ RISCV_REG_X24., "s8" }, |
| 44 | { RISCV_REG_X25cxx . . $ RISCV_REG_X25., "s9" }, |
| 45 | { RISCV_REG_X26cxx . . $ RISCV_REG_X26., "s10" }, |
| 46 | { RISCV_REG_X27cxx . . $ RISCV_REG_X27., "s11" }, |
| 47 | { RISCV_REG_X28cxx . . $ RISCV_REG_X28., "t3" }, |
| 48 | { RISCV_REG_X29cxx . . $ RISCV_REG_X29., "t4" }, |
| 49 | { RISCV_REG_X30cxx . . $ RISCV_REG_X30., "t5" }, |
| 50 | { RISCV_REG_X31cxx . . $ RISCV_REG_X31., "t6" }, |
| 51 | |
| 52 | { RISCV_REG_F0_32cxx . . $ RISCV_REG_F0_32., "ft0" }, |
| 53 | { RISCV_REG_F0_64cxx . . $ RISCV_REG_F0_64., "ft0" }, |
| 54 | { RISCV_REG_F1_32cxx . . $ RISCV_REG_F1_32., "ft1" }, |
| 55 | { RISCV_REG_F1_64cxx . . $ RISCV_REG_F1_64., "ft1" }, |
| 56 | { RISCV_REG_F2_32cxx . . $ RISCV_REG_F2_32., "ft2" }, |
| 57 | { RISCV_REG_F2_64cxx . . $ RISCV_REG_F2_64., "ft2" }, |
| 58 | { RISCV_REG_F3_32cxx . . $ RISCV_REG_F3_32., "ft3" }, |
| 59 | { RISCV_REG_F3_64cxx . . $ RISCV_REG_F3_64., "ft3" }, |
| 60 | { RISCV_REG_F4_32cxx . . $ RISCV_REG_F4_32., "ft4" }, |
| 61 | { RISCV_REG_F4_64cxx . . $ RISCV_REG_F4_64., "ft4" }, |
| 62 | { RISCV_REG_F5_32cxx . . $ RISCV_REG_F5_32., "ft5" }, |
| 63 | { RISCV_REG_F5_64cxx . . $ RISCV_REG_F5_64., "ft5" }, |
| 64 | { RISCV_REG_F6_32cxx . . $ RISCV_REG_F6_32., "ft6" }, |
| 65 | { RISCV_REG_F6_64cxx . . $ RISCV_REG_F6_64., "ft6" }, |
| 66 | { RISCV_REG_F7_32cxx . . $ RISCV_REG_F7_32., "ft7" }, |
| 67 | { RISCV_REG_F7_64cxx . . $ RISCV_REG_F7_64., "ft7" }, |
| 68 | { RISCV_REG_F8_32cxx . . $ RISCV_REG_F8_32., "fs0" }, |
| 69 | { RISCV_REG_F8_64cxx . . $ RISCV_REG_F8_64., "fs0" }, |
| 70 | { RISCV_REG_F9_32cxx . . $ RISCV_REG_F9_32., "fs1" }, |
| 71 | { RISCV_REG_F9_64cxx . . $ RISCV_REG_F9_64., "fs1" }, |
| 72 | { RISCV_REG_F10_32cxx . . $ RISCV_REG_F10_32., "fa0" }, |
| 73 | { RISCV_REG_F10_64cxx . . $ RISCV_REG_F10_64., "fa0" }, |
| 74 | { RISCV_REG_F11_32cxx . . $ RISCV_REG_F11_32., "fa1" }, |
| 75 | { RISCV_REG_F11_64cxx . . $ RISCV_REG_F11_64., "fa1" }, |
| 76 | { RISCV_REG_F12_32cxx . . $ RISCV_REG_F12_32., "fa2" }, |
| 77 | { RISCV_REG_F12_64cxx . . $ RISCV_REG_F12_64., "fa2" }, |
| 78 | { RISCV_REG_F13_32cxx . . $ RISCV_REG_F13_32., "fa3" }, |
| 79 | { RISCV_REG_F13_64cxx . . $ RISCV_REG_F13_64., "fa3" }, |
| 80 | { RISCV_REG_F14_32cxx . . $ RISCV_REG_F14_32., "fa4" }, |
| 81 | { RISCV_REG_F14_64cxx . . $ RISCV_REG_F14_64., "fa4" }, |
| 82 | { RISCV_REG_F15_32cxx . . $ RISCV_REG_F15_32., "fa5" }, |
| 83 | { RISCV_REG_F15_64cxx . . $ RISCV_REG_F15_64., "fa5" }, |
| 84 | { RISCV_REG_F16_32cxx . . $ RISCV_REG_F16_32., "fa6" }, |
| 85 | { RISCV_REG_F16_64cxx . . $ RISCV_REG_F16_64., "fa6" }, |
| 86 | { RISCV_REG_F17_32cxx . . $ RISCV_REG_F17_32., "fa7" }, |
| 87 | { RISCV_REG_F17_64cxx . . $ RISCV_REG_F17_64., "fa7" }, |
| 88 | { RISCV_REG_F18_32cxx . . $ RISCV_REG_F18_32., "fs2" }, |
| 89 | { RISCV_REG_F18_64cxx . . $ RISCV_REG_F18_64., "fs2" }, |
| 90 | { RISCV_REG_F19_32cxx . . $ RISCV_REG_F19_32., "fs3" }, |
| 91 | { RISCV_REG_F19_64cxx . . $ RISCV_REG_F19_64., "fs3" }, |
| 92 | { RISCV_REG_F20_32cxx . . $ RISCV_REG_F20_32., "fs4" }, |
| 93 | { RISCV_REG_F20_64cxx . . $ RISCV_REG_F20_64., "fs4" }, |
| 94 | { RISCV_REG_F21_32cxx . . $ RISCV_REG_F21_32., "fs5" }, |
| 95 | { RISCV_REG_F21_64cxx . . $ RISCV_REG_F21_64., "fs5" }, |
| 96 | { RISCV_REG_F22_32cxx . . $ RISCV_REG_F22_32., "fs6" }, |
| 97 | { RISCV_REG_F22_64cxx . . $ RISCV_REG_F22_64., "fs6" }, |
| 98 | { RISCV_REG_F23_32cxx . . $ RISCV_REG_F23_32., "fs7" }, |
| 99 | { RISCV_REG_F23_64cxx . . $ RISCV_REG_F23_64., "fs7" }, |
| 100 | { RISCV_REG_F24_32cxx . . $ RISCV_REG_F24_32., "fs8" }, |
| 101 | { RISCV_REG_F24_64cxx . . $ RISCV_REG_F24_64., "fs8" }, |
| 102 | { RISCV_REG_F25_32cxx . . $ RISCV_REG_F25_32., "fs9" }, |
| 103 | { RISCV_REG_F25_64cxx . . $ RISCV_REG_F25_64., "fs9" }, |
| 104 | { RISCV_REG_F26_32cxx . . $ RISCV_REG_F26_32., "fs10" }, |
| 105 | { RISCV_REG_F26_64cxx . . $ RISCV_REG_F26_64., "fs10" }, |
| 106 | { RISCV_REG_F27_32cxx . . $ RISCV_REG_F27_32., "fs11" }, |
| 107 | { RISCV_REG_F27_64cxx . . $ RISCV_REG_F27_64., "fs11" }, |
| 108 | { RISCV_REG_F28_32cxx . . $ RISCV_REG_F28_32., "ft8" }, |
| 109 | { RISCV_REG_F28_64cxx . . $ RISCV_REG_F28_64., "ft8" }, |
| 110 | { RISCV_REG_F29_32cxx . . $ RISCV_REG_F29_32., "ft9" }, |
| 111 | { RISCV_REG_F29_64cxx . . $ RISCV_REG_F29_64., "ft9" }, |
| 112 | { RISCV_REG_F30_32cxx . . $ RISCV_REG_F30_32., "ft10" }, |
| 113 | { RISCV_REG_F30_64cxx . . $ RISCV_REG_F30_64., "ft10" }, |
| 114 | { RISCV_REG_F31_32cxx . . $ RISCV_REG_F31_32., "ft11" }, |
| 115 | { RISCV_REG_F31_64cxx . . $ RISCV_REG_F31_64., "ft11" }, |
| 116 | }; |
| 117 | #endif |
| 118 | |
| 119 | const char *RISCV_reg_namecxx . . $ RISCV_reg_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int reg) |
| 120 | { |
| 121 | #ifndef CAPSTONE_DIET |
| 122 | if (reg >= RISCV_REG_ENDINGcxx . . $ RISCV_REG_ENDING.) |
| 123 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 124 | return reg_name_mapscxx . . $ reg_name_maps.[reg].namecxx . . $ name_map#name.; |
| 125 | #else |
| 126 | return NULL; |
| 127 | #endif |
| 128 | } |
| 129 | |
| 130 | static const insn_mapcxx . . $ insn_map# insnscxx . . $ insns.[] = { |
| 131 | // dummy item |
| 132 | { |
| 133 | 0, 0, |
| 134 | #ifndef CAPSTONE_DIET |
| 135 | {0}, {0}, {0}, 0, 0 |
| 136 | #endif |
| 137 | }, |
| 138 | |
| 139 | #include "RISCVMappingInsn.inc"cxx . . $ `<file>/arch/RISCV/RISCVMappingInsn.inc`/ |
| 140 | }; |
| 141 | |
| 142 | // given internal insn id, return public instruction info |
| 143 | void RISCV_get_insn_idcxx . . $ RISCV_get_insn_id(b32a94ba649bfb5a).(cs_structcxx . . $ cs_struct# * h, cs_insncxx . . $ cs_insn# * insn, unsigned int id) |
| 144 | { |
| 145 | unsigned int i; |
| 146 | |
| 147 | i = insn_findcxx . . $ insn_find(1ce6b9640f5aa651).(insnscxx . . $ insns., ARR_SIZEcxx . . $ `utils.h:24:9`!(insns), id, &h->insn_cachecxx . . $ cs_struct#insn_cache.); |
| 148 | if (i != 0) { |
| 149 | insn->idcxx . . $ cs_insn#id. = insnscxx . . $ insns.[i].mapidcxx . . $ insn_map#mapid.; |
| 150 | |
| 151 | if (h->detailcxx . . $ cs_struct#detail.) { |
| 152 | #ifndef CAPSTONE_DIET |
| 153 | memcpycxx . . $ memcpy(cc817cb175f282d).(insn->detailcxx . . $ cs_insn#detail.->regs_readcxx . . $ cs_detail#regs_read., |
| 154 | insnscxx . . $ insns.[i].regs_usecxx . . $ insn_map#regs_use., sizeof(insnscxx . . $ insns.[i].regs_usecxx . . $ insn_map#regs_use.)); |
| 155 | insn->detailcxx . . $ cs_insn#detail.->regs_read_countcxx . . $ cs_detail#regs_read_count. = (uint8_tcxx . . $ uint8_t#)count_positivecxx . . $ count_positive(ad0aaa07bfcd0593).(insnscxx . . $ insns.[i].regs_usecxx . . $ insn_map#regs_use.); |
| 156 | |
| 157 | memcpycxx . . $ memcpy(cc817cb175f282d).(insn->detailcxx . . $ cs_insn#detail.->regs_writecxx . . $ cs_detail#regs_write., insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map#regs_mod., sizeof(insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map#regs_mod.)); |
| 158 | insn->detailcxx . . $ cs_insn#detail.->regs_write_countcxx . . $ cs_detail#regs_write_count. = (uint8_tcxx . . $ uint8_t#)count_positivecxx . . $ count_positive(ad0aaa07bfcd0593).(insnscxx . . $ insns.[i].regs_modcxx . . $ insn_map#regs_mod.); |
| 159 | |
| 160 | memcpycxx . . $ memcpy(cc817cb175f282d).(insn->detailcxx . . $ cs_insn#detail.->groupscxx . . $ cs_detail#groups., insnscxx . . $ insns.[i].groupscxx . . $ insn_map#groups., sizeof(insnscxx . . $ insns.[i].groupscxx . . $ insn_map#groups.)); |
| 161 | insn->detailcxx . . $ cs_insn#detail.->groups_countcxx . . $ cs_detail#groups_count. = (uint8_tcxx . . $ uint8_t#)count_positive8cxx . . $ count_positive8(ca1608e2c87725e2).(insnscxx . . $ insns.[i].groupscxx . . $ insn_map#groups.); |
| 162 | |
| 163 | if (insnscxx . . $ insns.[i].branchcxx . . $ insn_map#branch. || insnscxx . . $ insns.[i].indirect_branchcxx . . $ insn_map#indirect_branch.) { |
| 164 | // this insn also belongs to JUMP group. add JUMP group |
| 165 | insn->detailcxx . . $ cs_insn#detail.->groupscxx . . $ cs_detail#groups.[insn->detailcxx . . $ cs_insn#detail.->groups_countcxx . . $ cs_detail#groups_count.] = RISCV_GRP_JUMPcxx . . $ RISCV_GRP_JUMP.; |
| 166 | insn->detailcxx . . $ cs_insn#detail.->groups_countcxx . . $ cs_detail#groups_count.++; |
| 167 | } |
| 168 | #endif |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | static const name_mapcxx . . $ name_map# insn_name_mapscxx . . $ insn_name_maps.[] = { |
| 174 | {RISCV_INS_INVALIDcxx . . $ RISCV_INS_INVALID., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!}, |
| 175 | |
| 176 | #include "RISCVGenInsnNameMaps.inc"cxx . . $ `<file>/arch/RISCV/RISCVGenInsnNameMaps.inc`/ |
| 177 | }; |
| 178 | |
| 179 | const char *RISCV_insn_namecxx . . $ RISCV_insn_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int id) |
| 180 | { |
| 181 | #ifndef CAPSTONE_DIET |
| 182 | if (id >= RISCV_INS_ENDINGcxx . . $ RISCV_INS_ENDING.) |
| 183 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 184 | |
| 185 | return insn_name_mapscxx . . $ insn_name_maps.[id].namecxx . . $ name_map#name.; |
| 186 | #else |
| 187 | return NULL; |
| 188 | #endif |
| 189 | } |
| 190 | |
| 191 | #ifndef CAPSTONE_DIET |
| 192 | static const name_mapcxx . . $ name_map# group_name_mapscxx . . $ group_name_maps.[] = { |
| 193 | // generic groups |
| 194 | { RISCV_GRP_INVALIDcxx . . $ RISCV_GRP_INVALID., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! }, |
| 195 | { RISCV_GRP_JUMPcxx . . $ RISCV_GRP_JUMP., "jump" }, |
| 196 | { RISCV_GRP_CALLcxx . . $ RISCV_GRP_CALL., "call" }, |
| 197 | { RISCV_GRP_RETcxx . . $ RISCV_GRP_RET., "ret" }, |
| 198 | { RISCV_GRP_INTcxx . . $ RISCV_GRP_INT., "int" }, |
| 199 | { RISCV_GRP_IRETcxx . . $ RISCV_GRP_IRET., "iret" }, |
| 200 | { RISCV_GRP_PRIVILEGEcxx . . $ RISCV_GRP_PRIVILEGE., "privileged" }, |
| 201 | { RISCV_GRP_BRANCH_RELATIVEcxx . . $ RISCV_GRP_BRANCH_RELATIVE., "branch_relative" }, |
| 202 | |
| 203 | // architecture specific |
| 204 | { RISCV_GRP_ISRV32cxx . . $ RISCV_GRP_ISRV32., "isrv32" }, |
| 205 | { RISCV_GRP_ISRV64cxx . . $ RISCV_GRP_ISRV64., "isrv64" }, |
| 206 | { RISCV_GRP_HASSTDEXTAcxx . . $ RISCV_GRP_HASSTDEXTA., "hasStdExtA" }, |
| 207 | { RISCV_GRP_HASSTDEXTCcxx . . $ RISCV_GRP_HASSTDEXTC., "hasStdExtC" }, |
| 208 | { RISCV_GRP_HASSTDEXTDcxx . . $ RISCV_GRP_HASSTDEXTD., "hasStdExtD" }, |
| 209 | { RISCV_GRP_HASSTDEXTFcxx . . $ RISCV_GRP_HASSTDEXTF., "hasStdExtF" }, |
| 210 | { RISCV_GRP_HASSTDEXTMcxx . . $ RISCV_GRP_HASSTDEXTM., "hasStdExtM" }, |
| 211 | |
| 212 | /* |
| 213 | { RISCV_GRP_ISRVA, "isrva" }, |
| 214 | { RISCV_GRP_ISRVC, "isrvc" }, |
| 215 | { RISCV_GRP_ISRVD, "isrvd" }, |
| 216 | { RISCV_GRP_ISRVCD, "isrvcd" }, |
| 217 | { RISCV_GRP_ISRVF, "isrvf" }, |
| 218 | { RISCV_GRP_ISRV32C, "isrv32c" }, |
| 219 | { RISCV_GRP_ISRV32CF, "isrv32cf" }, |
| 220 | { RISCV_GRP_ISRVM, "isrvm" }, |
| 221 | { RISCV_GRP_ISRV64A, "isrv64a" }, |
| 222 | { RISCV_GRP_ISRV64C, "isrv64c" }, |
| 223 | { RISCV_GRP_ISRV64D, "isrv64d" }, |
| 224 | { RISCV_GRP_ISRV64F, "isrv64f" }, |
| 225 | { RISCV_GRP_ISRV64M, "isrv64m" } |
| 226 | */ |
| 227 | { RISCV_GRP_ENDINGcxx . . $ RISCV_GRP_ENDING., NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`! } |
| 228 | }; |
| 229 | #endif |
| 230 | |
| 231 | const char *RISCV_group_namecxx . . $ RISCV_group_name(efd1348d9ae5172e).(cshcxx . . $ csh# handle, unsigned int id) |
| 232 | { |
| 233 | #ifndef CAPSTONE_DIET |
| 234 | // verify group id |
| 235 | if (id >= RISCV_GRP_ENDINGcxx . . $ RISCV_GRP_ENDING. || |
| 236 | (id > RISCV_GRP_BRANCH_RELATIVEcxx . . $ RISCV_GRP_BRANCH_RELATIVE. && id < RISCV_GRP_ISRV32cxx . . $ RISCV_GRP_ISRV32.)) |
| 237 | return NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/16/include/stddef.h:419:9`!; |
| 238 | return id2namecxx . . $ id2name(92d4aec78e87b576).(group_name_mapscxx . . $ group_name_maps., ARR_SIZEcxx . . $ `utils.h:24:9`!(group_name_maps), id); |
| 239 | #else |
| 240 | return NULL; |
| 241 | #endif |
| 242 | } |
| 243 | |
| 244 | // map instruction name to public instruction ID |
| 245 | riscv_regcxx . . $ riscv_reg# RISCV_map_insncxx . . $ RISCV_map_insn(ab47cba26379829d).(const char *name) |
| 246 | { |
| 247 | // handle special alias first |
| 248 | unsigned int i; |
| 249 | |
| 250 | // NOTE: skip first NULL name in insn_name_maps |
| 251 | i = name2idcxx . . $ name2id(b6128f0fa858e731).(&insn_name_mapscxx . . $ insn_name_maps.[1], ARR_SIZEcxx . . $ `utils.h:24:9`!(insn_name_maps) - 1, name); |
| 252 | |
| 253 | return (i != -1) ? i : RISCV_REG_INVALIDcxx . . $ RISCV_REG_INVALID.; |
| 254 | } |
| 255 | |
| 256 | // map internal raw register to 'public' register |
| 257 | riscv_regcxx . . $ riscv_reg# RISCV_map_registercxx . . $ RISCV_map_register(3443e78f25606d11).(unsigned int r) |
| 258 | { |
| 259 | static const unsigned int map[] = { 0, |
| 260 | RISCV_REG_X0cxx . . $ RISCV_REG_X0., |
| 261 | RISCV_REG_X1cxx . . $ RISCV_REG_X1., |
| 262 | RISCV_REG_X2cxx . . $ RISCV_REG_X2., |
| 263 | RISCV_REG_X3cxx . . $ RISCV_REG_X3., |
| 264 | RISCV_REG_X4cxx . . $ RISCV_REG_X4., |
| 265 | RISCV_REG_X5cxx . . $ RISCV_REG_X5., |
| 266 | RISCV_REG_X6cxx . . $ RISCV_REG_X6., |
| 267 | RISCV_REG_X7cxx . . $ RISCV_REG_X7., |
| 268 | RISCV_REG_X8cxx . . $ RISCV_REG_X8., |
| 269 | RISCV_REG_X9cxx . . $ RISCV_REG_X9., |
| 270 | RISCV_REG_X10cxx . . $ RISCV_REG_X10., |
| 271 | RISCV_REG_X11cxx . . $ RISCV_REG_X11., |
| 272 | RISCV_REG_X12cxx . . $ RISCV_REG_X12., |
| 273 | RISCV_REG_X13cxx . . $ RISCV_REG_X13., |
| 274 | RISCV_REG_X14cxx . . $ RISCV_REG_X14., |
| 275 | RISCV_REG_X15cxx . . $ RISCV_REG_X15., |
| 276 | RISCV_REG_X16cxx . . $ RISCV_REG_X16., |
| 277 | RISCV_REG_X17cxx . . $ RISCV_REG_X17., |
| 278 | RISCV_REG_X18cxx . . $ RISCV_REG_X18., |
| 279 | RISCV_REG_X19cxx . . $ RISCV_REG_X19., |
| 280 | RISCV_REG_X20cxx . . $ RISCV_REG_X20., |
| 281 | RISCV_REG_X21cxx . . $ RISCV_REG_X21., |
| 282 | RISCV_REG_X22cxx . . $ RISCV_REG_X22., |
| 283 | RISCV_REG_X23cxx . . $ RISCV_REG_X23., |
| 284 | RISCV_REG_X24cxx . . $ RISCV_REG_X24., |
| 285 | RISCV_REG_X25cxx . . $ RISCV_REG_X25., |
| 286 | RISCV_REG_X26cxx . . $ RISCV_REG_X26., |
| 287 | RISCV_REG_X27cxx . . $ RISCV_REG_X27., |
| 288 | RISCV_REG_X28cxx . . $ RISCV_REG_X28., |
| 289 | RISCV_REG_X29cxx . . $ RISCV_REG_X29., |
| 290 | RISCV_REG_X30cxx . . $ RISCV_REG_X30., |
| 291 | RISCV_REG_X31cxx . . $ RISCV_REG_X31., |
| 292 | |
| 293 | RISCV_REG_F0_32cxx . . $ RISCV_REG_F0_32., |
| 294 | RISCV_REG_F0_64cxx . . $ RISCV_REG_F0_64., |
| 295 | RISCV_REG_F1_32cxx . . $ RISCV_REG_F1_32., |
| 296 | RISCV_REG_F1_64cxx . . $ RISCV_REG_F1_64., |
| 297 | RISCV_REG_F2_32cxx . . $ RISCV_REG_F2_32., |
| 298 | RISCV_REG_F2_64cxx . . $ RISCV_REG_F2_64., |
| 299 | RISCV_REG_F3_32cxx . . $ RISCV_REG_F3_32., |
| 300 | RISCV_REG_F3_64cxx . . $ RISCV_REG_F3_64., |
| 301 | RISCV_REG_F4_32cxx . . $ RISCV_REG_F4_32., |
| 302 | RISCV_REG_F4_64cxx . . $ RISCV_REG_F4_64., |
| 303 | RISCV_REG_F5_32cxx . . $ RISCV_REG_F5_32., |
| 304 | RISCV_REG_F5_64cxx . . $ RISCV_REG_F5_64., |
| 305 | RISCV_REG_F6_32cxx . . $ RISCV_REG_F6_32., |
| 306 | RISCV_REG_F6_64cxx . . $ RISCV_REG_F6_64., |
| 307 | RISCV_REG_F7_32cxx . . $ RISCV_REG_F7_32., |
| 308 | RISCV_REG_F7_64cxx . . $ RISCV_REG_F7_64., |
| 309 | RISCV_REG_F8_32cxx . . $ RISCV_REG_F8_32., |
| 310 | RISCV_REG_F8_64cxx . . $ RISCV_REG_F8_64., |
| 311 | RISCV_REG_F9_32cxx . . $ RISCV_REG_F9_32., |
| 312 | RISCV_REG_F9_64cxx . . $ RISCV_REG_F9_64., |
| 313 | RISCV_REG_F10_32cxx . . $ RISCV_REG_F10_32., |
| 314 | RISCV_REG_F10_64cxx . . $ RISCV_REG_F10_64., |
| 315 | RISCV_REG_F11_32cxx . . $ RISCV_REG_F11_32., |
| 316 | RISCV_REG_F11_64cxx . . $ RISCV_REG_F11_64., |
| 317 | RISCV_REG_F12_32cxx . . $ RISCV_REG_F12_32., |
| 318 | RISCV_REG_F12_64cxx . . $ RISCV_REG_F12_64., |
| 319 | RISCV_REG_F13_32cxx . . $ RISCV_REG_F13_32., |
| 320 | RISCV_REG_F13_64cxx . . $ RISCV_REG_F13_64., |
| 321 | RISCV_REG_F14_32cxx . . $ RISCV_REG_F14_32., |
| 322 | RISCV_REG_F14_64cxx . . $ RISCV_REG_F14_64., |
| 323 | RISCV_REG_F15_32cxx . . $ RISCV_REG_F15_32., |
| 324 | RISCV_REG_F15_64cxx . . $ RISCV_REG_F15_64., |
| 325 | RISCV_REG_F16_32cxx . . $ RISCV_REG_F16_32., |
| 326 | RISCV_REG_F16_64cxx . . $ RISCV_REG_F16_64., |
| 327 | RISCV_REG_F17_32cxx . . $ RISCV_REG_F17_32., |
| 328 | RISCV_REG_F17_64cxx . . $ RISCV_REG_F17_64., |
| 329 | RISCV_REG_F18_32cxx . . $ RISCV_REG_F18_32., |
| 330 | RISCV_REG_F18_64cxx . . $ RISCV_REG_F18_64., |
| 331 | RISCV_REG_F19_32cxx . . $ RISCV_REG_F19_32., |
| 332 | RISCV_REG_F19_64cxx . . $ RISCV_REG_F19_64., |
| 333 | RISCV_REG_F20_32cxx . . $ RISCV_REG_F20_32., |
| 334 | RISCV_REG_F20_64cxx . . $ RISCV_REG_F20_64., |
| 335 | RISCV_REG_F21_32cxx . . $ RISCV_REG_F21_32., |
| 336 | RISCV_REG_F21_64cxx . . $ RISCV_REG_F21_64., |
| 337 | RISCV_REG_F22_32cxx . . $ RISCV_REG_F22_32., |
| 338 | RISCV_REG_F22_64cxx . . $ RISCV_REG_F22_64., |
| 339 | RISCV_REG_F23_32cxx . . $ RISCV_REG_F23_32., |
| 340 | RISCV_REG_F23_64cxx . . $ RISCV_REG_F23_64., |
| 341 | RISCV_REG_F24_32cxx . . $ RISCV_REG_F24_32., |
| 342 | RISCV_REG_F24_64cxx . . $ RISCV_REG_F24_64., |
| 343 | RISCV_REG_F25_32cxx . . $ RISCV_REG_F25_32., |
| 344 | RISCV_REG_F25_64cxx . . $ RISCV_REG_F25_64., |
| 345 | RISCV_REG_F26_32cxx . . $ RISCV_REG_F26_32., |
| 346 | RISCV_REG_F26_64cxx . . $ RISCV_REG_F26_64., |
| 347 | RISCV_REG_F27_32cxx . . $ RISCV_REG_F27_32., |
| 348 | RISCV_REG_F27_64cxx . . $ RISCV_REG_F27_64., |
| 349 | RISCV_REG_F28_32cxx . . $ RISCV_REG_F28_32., |
| 350 | RISCV_REG_F28_64cxx . . $ RISCV_REG_F28_64., |
| 351 | RISCV_REG_F29_32cxx . . $ RISCV_REG_F29_32., |
| 352 | RISCV_REG_F29_64cxx . . $ RISCV_REG_F29_64., |
| 353 | RISCV_REG_F30_32cxx . . $ RISCV_REG_F30_32., |
| 354 | RISCV_REG_F30_64cxx . . $ RISCV_REG_F30_64., |
| 355 | RISCV_REG_F31_32cxx . . $ RISCV_REG_F31_32., |
| 356 | RISCV_REG_F31_64cxx . . $ RISCV_REG_F31_64., |
| 357 | }; |
| 358 | |
| 359 | if (r < ARR_SIZEcxx . . $ `utils.h:24:9`!(map)) |
| 360 | return map[r]; |
| 361 | |
| 362 | // cannot find this register |
| 363 | return 0; |
| 364 | } |
| 365 | |
| 366 | #endif |