@@ -461,16 +461,6 @@ module Lift = struct
461
461
462
462
let bool b = if b then true_ else false_
463
463
464
- (* ATTENTION: [float, nativeint] constant propogaton is not done
465
- yet , due to cross platform problem
466
- *)
467
- (* let float b : t =
468
- Lconst ((Const_float b)) *)
469
-
470
- (* let nativeint b : t =
471
- Lconst ((Const_nativeint b)) *)
472
-
473
- let int64 b : t = Lconst (Const_int64 b)
474
464
let string s : t = Lconst (Const_string { s; unicode = false })
475
465
let char b : t = Lconst (Const_char b)
476
466
end
@@ -492,14 +482,11 @@ let prim ~primitive:(prim : Lam_primitive.t) ~args loc : t =
492
482
(* | Pnegbint Pnativeint, ( (Const_nativeint i)) *)
493
483
(* -> *)
494
484
(* Lift.nativeint (Nativeint.neg i) *)
495
- | Pnegint64 , Const_int64 a -> Lift. int64 (Int64. neg a)
496
485
| Pnot , Const_js_true -> false_
497
486
| Pnot , Const_js_false -> true_
498
487
| _ -> default () )
499
488
| [ Lconst a; Lconst b ] -> (
500
489
match (prim, a, b) with
501
- | Pint64comp cmp , Const_int64 a , Const_int64 b ->
502
- Lift. bool (Lam_compat. cmp_int64 cmp a b)
503
490
| Pintcomp cmp , Const_int a , Const_int b ->
504
491
Lift. bool (Lam_compat. cmp_int32 cmp a.i b.i)
505
492
| Pfloatcomp cmp , Const_float a , Const_float b ->
@@ -532,28 +519,6 @@ let prim ~primitive:(prim : Lam_primitive.t) ~args loc : t =
532
519
| Plsrint -> int_ (Int32. shift_right_logical aa (Int32. to_int bb))
533
520
| Pasrint -> int_ (Int32. shift_right aa (Int32. to_int bb))
534
521
| _ -> default () )
535
- | ( ( Paddint64 | Psubint64 | Pmulint64 | Pdivint64 | Pmodint64
536
- | Pandint64 | Porint64 | Pxorint64 ),
537
- Const_int64 aa,
538
- Const_int64 bb ) -> (
539
- match prim with
540
- | Paddint64 -> Lift. int64 (Int64. add aa bb)
541
- | Psubint64 -> Lift. int64 (Int64. sub aa bb)
542
- | Pmulint64 -> Lift. int64 (Int64. mul aa bb)
543
- | Pdivint64 -> (
544
- try Lift. int64 (Int64. div aa bb) with _ -> default () )
545
- | Pmodint64 -> (
546
- try Lift. int64 (Int64. rem aa bb) with _ -> default () )
547
- | Pandint64 -> Lift. int64 (Int64. logand aa bb)
548
- | Porint64 -> Lift. int64 (Int64. logor aa bb)
549
- | Pxorint64 -> Lift. int64 (Int64. logxor aa bb)
550
- | _ -> default () )
551
- | Plslint64 , Const_int64 aa , Const_int { i = b } ->
552
- Lift. int64 (Int64. shift_left aa (Int32. to_int b))
553
- | Plsrint64 , Const_int64 aa , Const_int { i = b } ->
554
- Lift. int64 (Int64. shift_right_logical aa (Int32. to_int b))
555
- | Pasrint64 , Const_int64 aa , Const_int { i = b } ->
556
- Lift. int64 (Int64. shift_right aa (Int32. to_int b))
557
522
| Psequand , Const_js_false , (Const_js_true | Const_js_false ) -> false_
558
523
| Psequand , Const_js_true , Const_js_true -> true_
559
524
| Psequand , Const_js_true , Const_js_false -> false_
@@ -639,7 +604,6 @@ let rec eval_const_as_bool (v : Lam_constant.t) : bool =
639
604
match v with
640
605
| Const_int { i = x } -> x <> 0l
641
606
| Const_char x -> x <> 0
642
- | Const_int64 x -> x <> 0L
643
607
| Const_js_false | Const_js_null | Const_module_alias | Const_js_undefined _ ->
644
608
false
645
609
| Const_js_true | Const_string _ | Const_pointer _ | Const_float _ | Const_bigint _
0 commit comments