forked from byungwoo733/riscv-ovpsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
riscvDisassembleFormats.h
99 lines (94 loc) · 4.11 KB
/
riscvDisassembleFormats.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Copyright (c) 2005-2020 Imperas Software Ltd., www.imperas.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied.
*
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#pragma once
//
// These are placeholders in disassembly decoder
//
#define EMIT_R1 '\001'
#define EMIT_R2 '\002'
#define EMIT_R3 '\003'
#define EMIT_R4 '\004'
#define EMIT_CS '\005'
#define EMIT_CX '\006'
#define EMIT_UI '\007'
#define EMIT_TGT '\010'
#define EMIT_CSR '\011'
#define EMIT_PRED '\012'
#define EMIT_SUCC '\013'
#define EMIT_VTYPE '\014'
#define EMIT_RM '\015'
#define EMIT_RMR '\016'
//
// These are placeholders in disassembly format strings
//
#define EMIT_R1_S "\001"
#define EMIT_R2_S "\002"
#define EMIT_R3_S "\003"
#define EMIT_R4_S "\004"
#define EMIT_CS_S "\005"
#define EMIT_CX_S "\006"
#define EMIT_UI_S "\007"
#define EMIT_TGT_S "\010"
#define EMIT_CSR_S "\011"
#define EMIT_PRED_S "\012"
#define EMIT_SUCC_S "\013"
#define EMIT_VTYPE_S "\014"
#define EMIT_RM_S "\015"
#define EMIT_RMR_S "\016"
//
// These are disassembly format strings
//
#define FMT_NONE ""
#define FMT_R1 EMIT_R1_S
#define FMT_R1_R2 EMIT_R1_S "," EMIT_R2_S
#define FMT_R1NZ_R2 "*" EMIT_R1_S "," EMIT_R2_S
#define FMT_R1_SIMM EMIT_R1_S "," EMIT_CS_S
#define FMT_R1_R3 EMIT_R1_S "," EMIT_R3_S
#define FMT_R1_R2_R3 EMIT_R1_S "," EMIT_R2_S "," EMIT_R3_S
#define FMT_R1_R2_RMR EMIT_R1_S "," EMIT_R2_S "," EMIT_RMR_S
#define FMT_R1_R2_R3_R4 EMIT_R1_S "," EMIT_R2_S "," EMIT_R3_S "," EMIT_R4_S
#define FMT_R1_R2_R3_RMR EMIT_R1_S "," EMIT_R2_S "," EMIT_R3_S "," EMIT_RMR_S
#define FMT_R1_R2_SIMM EMIT_R1_S "," EMIT_R2_S "," EMIT_CS_S
#define FMT_R1_R2_XIMM EMIT_R1_S "," EMIT_R2_S "," EMIT_CX_S
#define FMT_R1_R2_TGT EMIT_R1_S "," EMIT_R2_S "," EMIT_TGT_S
#define FMT_R1_R2_VTYPE EMIT_R1_S "," EMIT_R2_S "," EMIT_VTYPE_S
#define FMT_R1_MEM2 EMIT_R1_S ",(" EMIT_R2_S ")"
#define FMT_R1_MEM2_RM EMIT_R1_S ",(" EMIT_R2_S ")," EMIT_RM_S
#define FMT_R1_MEM2_R3_RM EMIT_R1_S ",(" EMIT_R2_S ")," EMIT_R3_S "," EMIT_RM_S
#define FMT_R1_R3_MEM2_R4_RM EMIT_R1_S "," EMIT_R3_S ",(" EMIT_R2_S ")," EMIT_R4_S "," EMIT_RM_S
#define FMT_R1_RM EMIT_R1_S "," EMIT_RM_S
#define FMT_R1_R2_RM EMIT_R1_S "," EMIT_R2_S "," EMIT_RM_S
#define FMT_R1_R2_R3_RM EMIT_R1_S "," EMIT_R2_S "," EMIT_R3_S "," EMIT_RM_S
#define FMT_R1_R2_SIMM_RM EMIT_R1_S "," EMIT_R2_S "," EMIT_CS_S "," EMIT_RM_S
#define FMT_R1_R2_SIMM_RMR EMIT_R1_S "," EMIT_R2_S "," EMIT_CS_S "," EMIT_RMR_S
#define FMT_R1_R2_XIMM_RM EMIT_R1_S "," EMIT_R2_S "," EMIT_CX_S "," EMIT_RM_S
#define FMT_R1_R2_MEM3 EMIT_R1_S "," EMIT_R2_S ",(" EMIT_R3_S ")"
#define FMT_R1_OFF_R2 EMIT_R1_S "," EMIT_CS_S "(" EMIT_R2_S ")"
#define FMT_OFF_R2 EMIT_CS_S "(" EMIT_R2_S ")"
#define FMT_R2 EMIT_R2_S
#define FMT_R1_UI EMIT_R1_S "," EMIT_UI_S
#define FMT_R1_CSR EMIT_R1_S "," EMIT_CSR_S
#define FMT_R1_CSR_R2 EMIT_R1_S "," EMIT_CSR_S "," EMIT_R2_S
#define FMT_R1_CSR_SIMM EMIT_R1_S "," EMIT_CSR_S "," EMIT_CS_S
#define FMT_CSR_R2 EMIT_CSR_S "," EMIT_R2_S
#define FMT_CSR_SIMM EMIT_CSR_S "," EMIT_CS_S
#define FMT_R1_TGT EMIT_R1_S "," EMIT_TGT_S
#define FMT_R2_TGT EMIT_R2_S "," EMIT_TGT_S
#define FMT_TGT EMIT_TGT_S
#define FMT_PRED_SUCC EMIT_PRED_S "," EMIT_SUCC_S