-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathoperation.mli
173 lines (143 loc) · 5.59 KB
/
operation.mli
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
(**********************************************************************************
* MIT License *
* *
* *
* Copyright (c) 2019-2021 Jane Street Group LLC *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy *
* of this software and associated documentation files (the "Software"), to deal *
* in the Software without restriction, including without limitation the rights *
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in all *
* copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *
* SOFTWARE. *
* *
**********************************************************************************)
(* Operations common to CFG and Linear. *)
[@@@ocaml.warning "+a-40-41-42"]
type trap_stack =
| Uncaught (** Exceptions escape the current function *)
| Specific_trap of Cmm.trywith_shared_label * trap_stack
(** Current handler is a delayed/shared Trywith *)
val equal_trap_stack : trap_stack -> trap_stack -> bool
type integer_comparison =
| Isigned of Cmm.integer_comparison
| Iunsigned of Cmm.integer_comparison
val string_of_integer_comparison : integer_comparison -> string
val equal_integer_comparison : integer_comparison -> integer_comparison -> bool
val invert_integer_comparison : integer_comparison -> integer_comparison
type integer_operation =
| Iadd
| Isub
| Imul
| Imulh of { signed : bool }
| Idiv
| Imod
| Iand
| Ior
| Ixor
| Ilsl
| Ilsr
| Iasr
| Iclz of { arg_is_non_zero : bool }
| Ictz of { arg_is_non_zero : bool }
| Ipopcnt
| Icomp of integer_comparison
val string_of_integer_operation : integer_operation -> string
val is_unary_integer_operation : integer_operation -> bool
val equal_integer_operation : integer_operation -> integer_operation -> bool
type float_comparison = Cmm.float_comparison
val equal_float_comparison : float_comparison -> float_comparison -> bool
type float_width = Cmm.float_width
val equal_float_width : float_width -> float_width -> bool
type float_operation =
| Inegf
| Iabsf
| Iaddf
| Isubf
| Imulf
| Idivf
| Icompf of float_comparison
val string_of_float_operation : float_operation -> string
val format_float_operation : Format.formatter -> float_operation -> unit
val equal_float_operation : float_operation -> float_operation -> bool
type mutable_flag =
| Immutable
| Mutable
val equal_mutable_flag : mutable_flag -> mutable_flag -> bool
val of_ast_mutable_flag : Asttypes.mutable_flag -> mutable_flag
val to_ast_mutable_flag : mutable_flag -> Asttypes.mutable_flag
type test =
| Itruetest
| Ifalsetest
| Iinttest of integer_comparison
| Iinttest_imm of integer_comparison * int
| Ifloattest of float_width * float_comparison
| Ioddtest
| Ieventest
val format_test :
print_reg:(Format.formatter -> Reg.t -> unit) ->
test ->
Format.formatter ->
Reg.t array ->
unit
val invert_test : test -> test
type t =
| Move
| Spill
| Reload
| Const_int of nativeint (* CR-someday xclerc: change to `Targetint.t` *)
| Const_float32 of int32
| Const_float of int64
| Const_symbol of Cmm.symbol
| Const_vec128 of Cmm.vec128_bits
| Stackoffset of int
| Load of
{ memory_chunk : Cmm.memory_chunk;
addressing_mode : Arch.addressing_mode;
mutability : mutable_flag;
is_atomic : bool
}
| Store of Cmm.memory_chunk * Arch.addressing_mode * bool
| Intop of integer_operation
| Intop_imm of integer_operation * int
| Intop_atomic of
{ op : Cmm.atomic_op;
size : Cmm.atomic_bitwidth;
addr : Arch.addressing_mode
}
| Floatop of float_width * float_operation
| Csel of test
| Reinterpret_cast of Cmm.reinterpret_cast
| Static_cast of Cmm.static_cast
| Probe_is_enabled of { name : string }
| Opaque
| Begin_region
| End_region
| Specific of Arch.specific_operation
| Name_for_debugger of
{ ident : Ident.t;
which_parameter : int option;
provenance : Backend_var.Provenance.t option;
is_assignment : bool;
regs : Reg.t array
}
| Dls_get
| Poll
| Alloc of
{ bytes : int;
dbginfo : Cmm.alloc_dbginfo;
mode : Cmm.Alloc_mode.t
}
val is_pure : t -> bool
val dump : Format.formatter -> t -> unit