| 1 | //===-- RISCVBaseInfo.h - Top level definitions for RISCV MC ----*- C++ -*-===//cxx . . $ `<file>/arch/RISCV/RISCVBaseInfo.h`/ |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains small standalone enum definitions for the RISCV target |
| 11 | // useful for the compiler back-end and the MC libraries. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | #ifndef CS_RISCVBASEINFO_H |
| 15 | #define CS_RISCVBASEINFO_Hcxx . . $ `arch/RISCV/RISCVBaseInfo.h:15:9`! |
| 16 | #include "../../cs_priv.h"cxx . . $ `<file>/cs_priv.h`/ |
| 17 | |
| 18 | //#include "RISCVMCTargetDesc.h" |
| 19 | |
| 20 | // RISCVII - This namespace holds all of the target specific flags that |
| 21 | // instruction info tracks. All definitions must match RISCVInstrFormats.td. |
| 22 | enumcxx . . $ $anonymous_type_d63683bcfd401560_0# { |
| 23 | IRISCVII_InstFormatPseudocxx . . $ IRISCVII_InstFormatPseudo. = 0, |
| 24 | IRISCVII_InstFormatRcxx . . $ IRISCVII_InstFormatR. = 1, |
| 25 | IRISCVII_InstFormatR4cxx . . $ IRISCVII_InstFormatR4. = 2, |
| 26 | IRISCVII_InstFormatIcxx . . $ IRISCVII_InstFormatI. = 3, |
| 27 | IRISCVII_InstFormatScxx . . $ IRISCVII_InstFormatS. = 4, |
| 28 | IRISCVII_InstFormatBcxx . . $ IRISCVII_InstFormatB. = 5, |
| 29 | IRISCVII_InstFormatUcxx . . $ IRISCVII_InstFormatU. = 6, |
| 30 | IRISCVII_InstFormatJcxx . . $ IRISCVII_InstFormatJ. = 7, |
| 31 | IRISCVII_InstFormatCRcxx . . $ IRISCVII_InstFormatCR. = 8, |
| 32 | IRISCVII_InstFormatCIcxx . . $ IRISCVII_InstFormatCI. = 9, |
| 33 | IRISCVII_InstFormatCSScxx . . $ IRISCVII_InstFormatCSS. = 10, |
| 34 | IRISCVII_InstFormatCIWcxx . . $ IRISCVII_InstFormatCIW. = 11, |
| 35 | IRISCVII_InstFormatCLcxx . . $ IRISCVII_InstFormatCL. = 12, |
| 36 | IRISCVII_InstFormatCScxx . . $ IRISCVII_InstFormatCS. = 13, |
| 37 | IRISCVII_InstFormatCAcxx . . $ IRISCVII_InstFormatCA. = 14, |
| 38 | IRISCVII_InstFormatCBcxx . . $ IRISCVII_InstFormatCB. = 15, |
| 39 | IRISCVII_InstFormatCJcxx . . $ IRISCVII_InstFormatCJ. = 16, |
| 40 | IRISCVII_InstFormatOthercxx . . $ IRISCVII_InstFormatOther. = 17, |
| 41 | |
| 42 | IRISCVII_InstFormatMaskcxx . . $ IRISCVII_InstFormatMask. = 31 |
| 43 | }; |
| 44 | |
| 45 | enumcxx . . $ $anonymous_type_d63683bcfd401560_1# { |
| 46 | RISCVII_MO_Nonecxx . . $ RISCVII_MO_None., |
| 47 | RISCVII_MO_LOcxx . . $ RISCVII_MO_LO., |
| 48 | RISCVII_MO_HIcxx . . $ RISCVII_MO_HI., |
| 49 | RISCVII_MO_PCREL_HIcxx . . $ RISCVII_MO_PCREL_HI., |
| 50 | }; |
| 51 | |
| 52 | // Describes the predecessor/successor bits used in the FENCE instruction. |
| 53 | enum FenceFieldcxx . . $ FenceField# { |
| 54 | RISCVFenceField_Icxx . . $ RISCVFenceField_I. = 8, |
| 55 | RISCVFenceField_Ocxx . . $ RISCVFenceField_O. = 4, |
| 56 | RISCVFenceField_Rcxx . . $ RISCVFenceField_R. = 2, |
| 57 | RISCVFenceField_Wcxx . . $ RISCVFenceField_W. = 1 |
| 58 | }; |
| 59 | |
| 60 | // Describes the supported floating point rounding mode encodings. |
| 61 | enum RoundingModecxx . . $ RoundingMode# { |
| 62 | RISCVFPRndMode_RNEcxx . . $ RISCVFPRndMode_RNE. = 0, |
| 63 | RISCVFPRndMode_RTZcxx . . $ RISCVFPRndMode_RTZ. = 1, |
| 64 | RISCVFPRndMode_RDNcxx . . $ RISCVFPRndMode_RDN. = 2, |
| 65 | RISCVFPRndMode_RUPcxx . . $ RISCVFPRndMode_RUP. = 3, |
| 66 | RISCVFPRndMode_RMMcxx . . $ RISCVFPRndMode_RMM. = 4, |
| 67 | RISCVFPRndMode_DYNcxx . . $ RISCVFPRndMode_DYN. = 7, |
| 68 | RISCVFPRndMode_Invalidcxx . . $ RISCVFPRndMode_Invalid. |
| 69 | }; |
| 70 | |
| 71 | inline static const char *roundingModeToStringcxx . . $ roundingModeToString(ae5af424b5d2d5).(enum RoundingModecxx . . $ RoundingMode# RndMode) |
| 72 | { |
| 73 | switch (RndMode) { |
| 74 | default: |
| 75 | CS_ASSERTcxx . . $ `cs_priv.h:103:9`!(0 && "Unknown floating point rounding mode"); |
| 76 | case RISCVFPRndMode_RNEcxx . . $ RISCVFPRndMode_RNE.: |
| 77 | return "rne"; |
| 78 | case RISCVFPRndMode_RTZcxx . . $ RISCVFPRndMode_RTZ.: |
| 79 | return "rtz"; |
| 80 | case RISCVFPRndMode_RDNcxx . . $ RISCVFPRndMode_RDN.: |
| 81 | return "rdn"; |
| 82 | case RISCVFPRndMode_RUPcxx . . $ RISCVFPRndMode_RUP.: |
| 83 | return "rup"; |
| 84 | case RISCVFPRndMode_RMMcxx . . $ RISCVFPRndMode_RMM.: |
| 85 | return "rmm"; |
| 86 | case RISCVFPRndMode_DYNcxx . . $ RISCVFPRndMode_DYN.: |
| 87 | return "dyn"; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | inline static boolcxx . . $ `<external>/13015445228558014418/stdbool.h:36:9`! RISCVFPRndMode_isValidRoundingModecxx . . $ RISCVFPRndMode_isValidRoundingMode(dfa6e707f7696010).(unsigned Mode) |
| 92 | { |
| 93 | switch (Mode) { |
| 94 | default: |
| 95 | return falsecxx . . $ `<external>/13015445228558014418/stdbool.h:38:9`!; |
| 96 | case RISCVFPRndMode_RNEcxx . . $ RISCVFPRndMode_RNE.: |
| 97 | case RISCVFPRndMode_RTZcxx . . $ RISCVFPRndMode_RTZ.: |
| 98 | case RISCVFPRndMode_RDNcxx . . $ RISCVFPRndMode_RDN.: |
| 99 | case RISCVFPRndMode_RUPcxx . . $ RISCVFPRndMode_RUP.: |
| 100 | case RISCVFPRndMode_RMMcxx . . $ RISCVFPRndMode_RMM.: |
| 101 | case RISCVFPRndMode_DYNcxx . . $ RISCVFPRndMode_DYN.: |
| 102 | return truecxx . . $ `<external>/13015445228558014418/stdbool.h:37:9`!; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | #endif |