-
Notifications
You must be signed in to change notification settings - Fork 86
/
Copy pathcmm.ml
701 lines (634 loc) · 22.7 KB
/
cmm.ml
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
(* *)
(* Copyright 1996 Institut National de Recherche en Informatique et *)
(* en Automatique. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
type machtype_component = Cmx_format.machtype_component =
| Val
| Addr
| Int
| Float
| Vec128
| Float32
type machtype = machtype_component array
let typ_void = ([||] : machtype_component array)
let typ_val = [|Val|]
let typ_addr = [|Addr|]
let typ_int = [|Int|]
let typ_float = [|Float|]
let typ_float32 = [|Float32|]
let typ_vec128 = [|Vec128|]
(** [machtype_component]s are partially ordered as follows:
Addr Float32 Float Vec128
^
|
Val
^
|
Int
In particular, [Addr] must be above [Val], to ensure that if there is
a join point between a code path yielding [Addr] and one yielding [Val]
then the result is treated as a derived pointer into the heap (i.e. [Addr]).
(Such a result may not be live across any call site or a fatal compiler
error will result.)
*)
let lub_component comp1 comp2 =
match comp1, comp2 with
| Int, Int -> Int
| Int, Val -> Val
| Int, Addr -> Addr
| Val, Int -> Val
| Val, Val -> Val
| Val, Addr -> Addr
| Addr, Int -> Addr
| Addr, Addr -> Addr
| Addr, Val -> Addr
| Float, Float -> Float
| Float32, Float32 -> Float32
| Vec128, Vec128 -> Vec128
| (Int | Addr | Val), (Float | Float32 | Vec128)
| (Float | Float32 | Vec128), (Int | Addr | Val)
| (Float | Float32), Vec128
| Vec128, (Float | Float32)
| Float32, Float
| Float, Float32 ->
Printf.eprintf "%d %d\n%!" (Obj.magic comp1) (Obj.magic comp2);
(* Float unboxing code must be sure to avoid this case. *)
assert false
let ge_component comp1 comp2 =
match comp1, comp2 with
| Int, Int -> true
| Int, Addr -> false
| Int, Val -> false
| Val, Int -> true
| Val, Val -> true
| Val, Addr -> false
| Addr, Int -> true
| Addr, Addr -> true
| Addr, Val -> true
| Float, Float -> true
| Float32, Float32 -> true
| Vec128, Vec128 -> true
| (Int | Addr | Val), (Float | Float32 | Vec128)
| (Float | Float32 | Vec128), (Int | Addr | Val)
| (Float | Float32), Vec128
| Vec128, (Float | Float32)
| Float32, Float
| Float, Float32 ->
Printf.eprintf "GE: %d %d\n%!" (Obj.magic comp1) (Obj.magic comp2);
assert false
type exttype =
| XInt
| XInt32
| XInt64
| XFloat32
| XFloat
| XVec128
let machtype_of_exttype = function
| XInt -> typ_int
| XInt32 -> typ_int
| XInt64 -> typ_int
| XFloat -> typ_float
| XFloat32 -> typ_float32
| XVec128 -> typ_vec128
let machtype_of_exttype_list xtl =
Array.concat (List.map machtype_of_exttype xtl)
type integer_comparison = Lambda.integer_comparison =
| Ceq | Cne | Clt | Cgt | Cle | Cge
let negate_integer_comparison = Lambda.negate_integer_comparison
let swap_integer_comparison = Lambda.swap_integer_comparison
(* With floats [not (x < y)] is not the same as [x >= y] due to NaNs,
so we provide additional comparisons to represent the negations.*)
type float_comparison = Lambda.float_comparison =
| CFeq | CFneq | CFlt | CFnlt | CFgt | CFngt | CFle | CFnle | CFge | CFnge
let negate_float_comparison = Lambda.negate_float_comparison
let swap_float_comparison = Lambda.swap_float_comparison
type label = int
let init_label = 99
let label_counter = ref init_label
let set_label l =
if (l < !label_counter) then begin
Misc.fatal_errorf "Cannot set label counter to %d, it must be >= %d"
l !label_counter ()
end;
label_counter := l
let cur_label () = !label_counter
let new_label() = incr label_counter; !label_counter
type static_label = Lambda.static_label
type exit_label =
| Return_lbl
| Lbl of static_label
type rec_flag = Nonrecursive | Recursive
type prefetch_temporal_locality_hint = Nonlocal | Low | Moderate | High
type atomic_op = Fetch_and_add | Compare_and_swap
type atomic_bitwidth = Thirtytwo | Sixtyfour | Word
type effects = No_effects | Arbitrary_effects
type coeffects = No_coeffects | Has_coeffects
type phantom_defining_expr =
| Cphantom_const_int of Targetint.t
| Cphantom_const_symbol of string
| Cphantom_var of Backend_var.t
| Cphantom_offset_var of { var : Backend_var.t; offset_in_words : int; }
| Cphantom_read_field of { var : Backend_var.t; field : int; }
| Cphantom_read_symbol_field of { sym : string; field : int; }
| Cphantom_block of { tag : int; fields : Backend_var.t list; }
type trywith_shared_label = int
type trap_action =
| Push of trywith_shared_label
| Pop of trywith_shared_label
type bswap_bitwidth = Sixteen | Thirtytwo | Sixtyfour
type initialization_or_assignment =
| Initialization
| Assignment
type float_width =
| Float64
| Float32
type memory_chunk =
Byte_unsigned
| Byte_signed
| Sixteen_unsigned
| Sixteen_signed
| Thirtytwo_unsigned
| Thirtytwo_signed
| Word_int
| Word_val
| Single of { reg : float_width }
| Double
| Onetwentyeight_unaligned
| Onetwentyeight_aligned
type reinterpret_cast =
| Int_of_value
| Value_of_int
| Float_of_float32
| Float32_of_float
| Float_of_int64
| Int64_of_float
| Float32_of_int32
| Int32_of_float32
| V128_of_v128
type static_cast =
| Float_of_int of float_width
| Int_of_float of float_width
| Float_of_float32
| Float32_of_float
| V128_of_scalar of Primitive.vec128_type
| Scalar_of_v128 of Primitive.vec128_type
type operation =
Capply of machtype * Lambda.region_close
| Cextcall of
{ func: string;
ty: machtype;
ty_args : exttype list;
alloc: bool;
builtin: bool;
returns: bool;
effects: effects;
coeffects: coeffects;
}
| Cload of
{ memory_chunk: memory_chunk;
mutability: Asttypes.mutable_flag;
is_atomic: bool;
}
| Calloc of Lambda.alloc_mode
| Cstore of memory_chunk * initialization_or_assignment
| Caddi | Csubi | Cmuli | Cmulhi of { signed: bool } | Cdivi | Cmodi
| Cand | Cor | Cxor | Clsl | Clsr | Casr
| Cbswap of { bitwidth: bswap_bitwidth; }
| Ccsel of machtype
| Cclz of { arg_is_non_zero: bool; }
| Cctz of { arg_is_non_zero: bool; }
| Cpopcnt
| Cprefetch of { is_write: bool; locality: prefetch_temporal_locality_hint; }
| Catomic of { op: atomic_op; size : atomic_bitwidth }
| Ccmpi of integer_comparison
| Caddv | Cadda
| Ccmpa of integer_comparison
| Cnegf of float_width | Cabsf of float_width
| Caddf of float_width | Csubf of float_width
| Cmulf of float_width | Cdivf of float_width
| Cpackf32
| Creinterpret_cast of reinterpret_cast
| Cstatic_cast of static_cast
| Ccmpf of float_width * float_comparison
| Craise of Lambda.raise_kind
| Cprobe of { name: string; handler_code_sym: string; enabled_at_init: bool }
| Cprobe_is_enabled of { name: string }
| Copaque
| Cbeginregion | Cendregion
| Ctuple_field of int * machtype array
| Cdls_get
type kind_for_unboxing =
| Any
| Boxed_integer of Lambda.boxed_integer
| Boxed_vector of Lambda.boxed_vector
| Boxed_float of Lambda.boxed_float
type is_global = Global | Local
let equal_is_global g g' =
match g, g' with
| Local, Local | Global, Global -> true
| Local, Global | Global, Local -> false
type symbol =
{ sym_name : string;
sym_global : is_global }
type vec128_bits = { low : int64; high: int64 }
let global_symbol sym_name = { sym_name; sym_global = Global }
type expression =
Cconst_int of int * Debuginfo.t
| Cconst_natint of nativeint * Debuginfo.t
| Cconst_float32 of float * Debuginfo.t
| Cconst_float of float * Debuginfo.t
| Cconst_vec128 of vec128_bits * Debuginfo.t
| Cconst_symbol of symbol * Debuginfo.t
| Cvar of Backend_var.t
| Clet of Backend_var.With_provenance.t * expression * expression
| Clet_mut of Backend_var.With_provenance.t * machtype
* expression * expression
| Cphantom_let of Backend_var.With_provenance.t
* phantom_defining_expr option * expression
| Cassign of Backend_var.t * expression
| Ctuple of expression list
| Cop of operation * expression list * Debuginfo.t
| Csequence of expression * expression
| Cifthenelse of expression * Debuginfo.t * expression
* Debuginfo.t * expression * Debuginfo.t * kind_for_unboxing
| Cswitch of expression * int array * (expression * Debuginfo.t) array
* Debuginfo.t * kind_for_unboxing
| Ccatch of
rec_flag
* (static_label * (Backend_var.With_provenance.t * machtype) list
* expression * Debuginfo.t * bool (* is_cold *)) list
* expression * kind_for_unboxing
| Cexit of exit_label * expression list * trap_action list
| Ctrywith of expression * trywith_shared_label
* Backend_var.With_provenance.t * expression * Debuginfo.t
* kind_for_unboxing
type codegen_option =
| Reduce_code_size
| No_CSE
| Use_linscan_regalloc
| Assume_zero_alloc of { strict: bool; never_returns_normally: bool;
never_raises: bool;
loc: Location.t }
| Check_zero_alloc of { strict: bool; loc : Location.t; }
type fundecl =
{ fun_name: symbol;
fun_args: (Backend_var.With_provenance.t * machtype) list;
fun_body: expression;
fun_codegen_options : codegen_option list;
fun_poll: Lambda.poll_attribute;
fun_dbg : Debuginfo.t;
}
type data_item =
Cdefine_symbol of symbol
| Cint8 of int
| Cint16 of int
| Cint32 of nativeint
| Cint of nativeint
| Csingle of float
| Cdouble of float
| Cvec128 of vec128_bits
| Csymbol_address of symbol
| Csymbol_offset of symbol * int
| Cstring of string
| Cskip of int
| Calign of int
type phrase =
Cfunction of fundecl
| Cdata of data_item list
let ccatch (i, ids, e1, e2, dbg, kind, is_cold) =
Ccatch(Nonrecursive, [i, ids, e2, dbg, is_cold], e1, kind)
let reset () =
label_counter := init_label
let iter_shallow_tail f = function
| Clet(_, _, body) | Cphantom_let (_, _, body) | Clet_mut(_, _, _, body) ->
f body;
true
| Cifthenelse(_cond, _ifso_dbg, ifso, _ifnot_dbg, ifnot, _dbg, _value_kind) ->
f ifso;
f ifnot;
true
| Csequence(_e1, e2) ->
f e2;
true
| Cswitch(_e, _tbl, el, _dbg', _value_kind) ->
Array.iter (fun (e, _dbg) -> f e) el;
true
| Ccatch(_rec_flag, handlers, body, _value_kind) ->
List.iter (fun (_, _, h, _dbg, _) -> f h) handlers;
f body;
true
| Ctrywith(e1, _kind, _id, e2, _dbg, _value_kind) ->
f e1;
f e2;
true
| Cexit _ | Cop (Craise _, _, _) ->
true
| Cconst_int _
| Cconst_natint _
| Cconst_float32 _
| Cconst_float _
| Cconst_vec128 _
| Cconst_symbol _
| Cvar _
| Cassign _
| Ctuple _
| Cop _ ->
false
let map_shallow_tail ?kind f = function
| Clet(id, exp, body) ->
Clet(id, exp, f body)
| Clet_mut(id, kind, exp, body) ->
Clet_mut(id, kind, exp, f body)
| Cphantom_let(id, exp, body) ->
Cphantom_let (id, exp, f body)
| Cifthenelse(cond, ifso_dbg, ifso, ifnot_dbg, ifnot, dbg, kind_before) ->
Cifthenelse
(
cond,
ifso_dbg, f ifso,
ifnot_dbg, f ifnot,
dbg,
Option.value kind ~default:kind_before
)
| Csequence(e1, e2) ->
Csequence(e1, f e2)
| Cswitch(e, tbl, el, dbg', kind_before) ->
Cswitch(e, tbl, Array.map (fun (e, dbg) -> f e, dbg) el, dbg',
Option.value kind ~default:kind_before)
| Ccatch(rec_flag, handlers, body, kind_before) ->
let map_h (n, ids, handler, dbg, is_cold) =
(n, ids, f handler, dbg, is_cold)
in
Ccatch(rec_flag, List.map map_h handlers, f body,
Option.value kind ~default:kind_before)
| Ctrywith(e1, kind', id, e2, dbg, kind_before) ->
Ctrywith(f e1, kind', id, f e2, dbg,
Option.value kind ~default:kind_before)
| Cexit _ | Cop (Craise _, _, _) as cmm ->
cmm
| Cconst_int _
| Cconst_natint _
| Cconst_float32 _
| Cconst_float _
| Cconst_vec128 _
| Cconst_symbol _
| Cvar _
| Cassign _
| Ctuple _
| Cop _ as cmm -> cmm
let map_tail ?kind f =
let rec loop = function
| Cconst_int _
| Cconst_natint _
| Cconst_float32 _
| Cconst_float _
| Cconst_symbol _
| Cvar _
| Cassign _
| Ctuple _
| Cop _ as c ->
f c
| cmm -> map_shallow_tail ?kind loop cmm
in
loop
let iter_shallow f = function
| Clet (_id, e1, e2) ->
f e1; f e2
| Clet_mut (_id, _kind, e1, e2) ->
f e1; f e2
| Cphantom_let (_id, _de, e) ->
f e
| Cassign (_id, e) ->
f e
| Ctuple el ->
List.iter f el
| Cop (_op, el, _dbg) ->
List.iter f el
| Csequence (e1, e2) ->
f e1; f e2
| Cifthenelse(cond, _ifso_dbg, ifso, _ifnot_dbg, ifnot, _dbg, _value_kind) ->
f cond; f ifso; f ifnot
| Cswitch (_e, _ia, ea, _dbg, _value_kind) ->
Array.iter (fun (e, _) -> f e) ea
| Ccatch (_rf, hl, body, _value_kind) ->
let iter_h (_n, _ids, handler, _dbg, _is_cold) = f handler in
List.iter iter_h hl; f body
| Cexit (_n, el, _traps) ->
List.iter f el
| Ctrywith (e1, _kind, _id, e2, _dbg, _value_kind) ->
f e1; f e2
| Cconst_int _
| Cconst_natint _
| Cconst_float32 _
| Cconst_float _
| Cconst_vec128 _
| Cconst_symbol _
| Cvar _ ->
()
let map_shallow f = function
| Clet (id, e1, e2) ->
Clet (id, f e1, f e2)
| Clet_mut (id, kind, e1, e2) ->
Clet_mut (id, kind, f e1, f e2)
| Cphantom_let (id, de, e) ->
Cphantom_let (id, de, f e)
| Cassign (id, e) ->
Cassign (id, f e)
| Ctuple el ->
Ctuple (List.map f el)
| Cop (op, el, dbg) ->
Cop (op, List.map f el, dbg)
| Csequence (e1, e2) ->
Csequence (f e1, f e2)
| Cifthenelse(cond, ifso_dbg, ifso, ifnot_dbg, ifnot, dbg, kind) ->
Cifthenelse(f cond, ifso_dbg, f ifso, ifnot_dbg, f ifnot, dbg, kind)
| Cswitch (e, ia, ea, dbg, kind) ->
Cswitch (e, ia, Array.map (fun (e, dbg) -> f e, dbg) ea, dbg, kind)
| Ccatch (rf, hl, body, kind) ->
let map_h (n, ids, handler, dbg, is_cold) =
(n, ids, f handler, dbg, is_cold)
in
Ccatch (rf, List.map map_h hl, f body, kind)
| Cexit (n, el, traps) ->
Cexit (n, List.map f el, traps)
| Ctrywith (e1, kind, id, e2, dbg, value_kind) ->
Ctrywith (f e1, kind, id, f e2, dbg, value_kind)
| Cconst_int _
| Cconst_natint _
| Cconst_float32 _
| Cconst_float _
| Cconst_vec128 _
| Cconst_symbol _
| Cvar _
as c ->
c
let equal_machtype_component (left : machtype_component) (right : machtype_component) =
match left, right with
| Val, Val -> true
| Addr, Addr -> true
| Int, Int -> true
| Float, Float -> true
| Vec128, Vec128 -> true
| Float32, Float32 -> true
| Val, (Addr | Int | Float | Vec128 | Float32)
| Addr, (Val | Int | Float | Vec128 | Float32)
| Int, (Val | Addr | Float | Vec128 | Float32)
| Float, (Val | Addr | Int | Vec128 | Float32)
| Vec128, (Val | Addr | Int | Float | Float32)
| Float32, (Val | Addr | Int | Float | Vec128) ->
false
let equal_exttype left right =
match left, right with
| XInt, XInt -> true
| XInt32, XInt32 -> true
| XInt64, XInt64 -> true
| XFloat32, XFloat32 -> true
| XFloat, XFloat -> true
| XVec128, XVec128 -> true
| XInt, (XInt32 | XInt64 | XFloat | XFloat32 | XVec128)
| XInt32, (XInt | XInt64 | XFloat | XFloat32 | XVec128)
| XInt64, (XInt | XInt32 | XFloat | XFloat32 | XVec128)
| XFloat, (XInt | XInt32 | XFloat32 | XInt64 | XVec128)
| XVec128, (XInt | XInt32 | XInt64 | XFloat | XFloat32)
| XFloat32, (XInt | XInt32 | XInt64 | XFloat | XVec128) ->
false
let equal_float_width left right =
match left, right with
| Float64, Float64 -> true
| Float32, Float32 -> true
| (Float32 | Float64), _ -> false
let equal_reinterpret_cast (left : reinterpret_cast) (right : reinterpret_cast) =
match left, right with
| Int_of_value, Int_of_value -> true
| Value_of_int, Value_of_int -> true
| Float_of_float32, Float_of_float32 -> true
| Float32_of_float, Float32_of_float -> true
| Float_of_int64, Float_of_int64 -> true
| Int64_of_float, Int64_of_float -> true
| Float32_of_int32, Float32_of_int32 -> true
| Int32_of_float32, Int32_of_float32 -> true
| V128_of_v128, V128_of_v128 -> true
| (Int_of_value | Value_of_int |
Float_of_float32 | Float32_of_float |
Float_of_int64 | Int64_of_float |
Float32_of_int32 | Int32_of_float32 |
V128_of_v128), _ -> false
let equal_static_cast (left : static_cast) (right : static_cast) =
match left, right with
| Float32_of_float, Float32_of_float -> true
| Float_of_float32, Float_of_float32 -> true
| Float_of_int f1, Float_of_int f2 -> equal_float_width f1 f2
| Int_of_float f1, Int_of_float f2 -> equal_float_width f1 f2
| Scalar_of_v128 v1, Scalar_of_v128 v2 -> Primitive.equal_vec128_type v1 v2
| V128_of_scalar v1, V128_of_scalar v2 -> Primitive.equal_vec128_type v1 v2
| (Float32_of_float | Float_of_float32 |
Float_of_int _ | Int_of_float _ |
Scalar_of_v128 _ | V128_of_scalar _), _ -> false
let equal_float_comparison left right =
match left, right with
| CFeq, CFeq -> true
| CFneq, CFneq -> true
| CFlt, CFlt -> true
| CFnlt, CFnlt -> true
| CFgt, CFgt -> true
| CFngt, CFngt -> true
| CFle, CFle -> true
| CFnle, CFnle -> true
| CFge, CFge -> true
| CFnge, CFnge -> true
| CFeq, (CFneq | CFlt | CFnlt | CFgt | CFngt | CFle | CFnle | CFge | CFnge)
| CFneq, (CFeq | CFlt | CFnlt | CFgt | CFngt | CFle | CFnle | CFge | CFnge)
| CFlt, (CFeq | CFneq | CFnlt | CFgt | CFngt | CFle | CFnle | CFge | CFnge)
| CFnlt, (CFeq | CFneq | CFlt | CFgt | CFngt | CFle | CFnle | CFge | CFnge)
| CFgt, (CFeq | CFneq | CFlt | CFnlt | CFngt | CFle | CFnle | CFge | CFnge)
| CFngt, (CFeq | CFneq | CFlt | CFnlt | CFgt | CFle | CFnle | CFge | CFnge)
| CFle, (CFeq | CFneq | CFlt | CFnlt | CFgt | CFngt | CFnle | CFge | CFnge)
| CFnle, (CFeq | CFneq | CFlt | CFnlt | CFgt | CFngt | CFle | CFge | CFnge)
| CFge, (CFeq | CFneq | CFlt | CFnlt | CFgt | CFngt | CFle | CFnle | CFnge)
| CFnge, (CFeq | CFneq | CFlt | CFnlt | CFgt | CFngt | CFle | CFnle | CFge) ->
false
let equal_memory_chunk left right =
match left, right with
| Byte_unsigned, Byte_unsigned -> true
| Byte_signed, Byte_signed -> true
| Sixteen_unsigned, Sixteen_unsigned -> true
| Sixteen_signed, Sixteen_signed -> true
| Thirtytwo_unsigned, Thirtytwo_unsigned -> true
| Thirtytwo_signed, Thirtytwo_signed -> true
| Word_int, Word_int -> true
| Word_val, Word_val -> true
| Single { reg = regl }, Single { reg = regr } -> equal_float_width regl regr
| Double, Double -> true
| Onetwentyeight_unaligned, Onetwentyeight_unaligned
| Onetwentyeight_aligned, Onetwentyeight_aligned -> true
| Byte_unsigned, (Byte_signed | Sixteen_unsigned | Sixteen_signed | Thirtytwo_unsigned
| Thirtytwo_signed | Word_int | Word_val
| Single _ | Double
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Byte_signed, (Byte_unsigned | Sixteen_unsigned | Sixteen_signed | Thirtytwo_unsigned
| Thirtytwo_signed | Word_int | Word_val
| Single _ | Double
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Sixteen_unsigned, (Byte_unsigned | Byte_signed | Sixteen_signed | Thirtytwo_unsigned
| Thirtytwo_signed | Word_int | Word_val
| Single _ | Double
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Sixteen_signed, (Byte_unsigned | Byte_signed | Sixteen_unsigned | Thirtytwo_unsigned
| Thirtytwo_signed | Word_int | Word_val
| Single _ | Double
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Thirtytwo_unsigned, (Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
| Thirtytwo_signed | Word_int | Word_val
| Single _ | Double
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Thirtytwo_signed, (Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
| Thirtytwo_unsigned | Word_int | Word_val
| Single _ | Double
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Word_int, (Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
| Thirtytwo_unsigned | Thirtytwo_signed | Word_val
| Single _ | Double
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Word_val, (Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
| Thirtytwo_unsigned | Thirtytwo_signed | Word_int
| Single _ | Double
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Double, (Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
| Thirtytwo_unsigned | Thirtytwo_signed | Word_int | Word_val | Single _
| Onetwentyeight_unaligned | Onetwentyeight_aligned)
| Onetwentyeight_unaligned, (Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
| Thirtytwo_unsigned | Thirtytwo_signed | Word_int | Word_val | Single _
| Double | Onetwentyeight_aligned)
| Onetwentyeight_aligned, (Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
| Thirtytwo_unsigned | Thirtytwo_signed | Word_int | Word_val | Single _
| Double | Onetwentyeight_unaligned)
| Single _, (Onetwentyeight_aligned | Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
| Thirtytwo_unsigned | Thirtytwo_signed | Word_int | Word_val
| Double | Onetwentyeight_unaligned) ->
false
let equal_integer_comparison left right =
match left, right with
| Ceq, Ceq -> true
| Cne, Cne -> true
| Clt, Clt -> true
| Cgt, Cgt -> true
| Cle, Cle -> true
| Cge, Cge -> true
| Ceq, (Cne | Clt | Cgt | Cle | Cge)
| Cne, (Ceq | Clt | Cgt | Cle | Cge)
| Clt, (Ceq | Cne | Cgt | Cle | Cge)
| Cgt, (Ceq | Cne | Clt | Cle | Cge)
| Cle, (Ceq | Cne | Clt | Cgt | Cge)
| Cge, (Ceq | Cne | Clt | Cgt | Cle) ->
false
let caml_flambda2_invalid = "caml_flambda2_invalid"