@@ -358,6 +358,7 @@ module Hints = struct
358
358
; layout : Lambda .bigarray_layout
359
359
}
360
360
| Hint_primitive of Primitive .description
361
+ | Hint_phys_equal
361
362
362
363
module Int_table = Hashtbl. Make (Int )
363
364
@@ -2222,23 +2223,33 @@ and compile infos pc state (instrs : instr list) =
2222
2223
2223
2224
if debug_parser ()
2224
2225
then Format. printf " %a = mk_bool(%a == %a)@." Var. print x Var. print y Var. print z;
2226
+ let hints = Hints. find infos.hints pc in
2227
+ let prim =
2228
+ if List. mem Hints. Hint_phys_equal ~set: hints then Extern " %phys_equal" else Eq
2229
+ in
2225
2230
compile
2226
2231
infos
2227
2232
(pc + 1 )
2228
2233
(State. pop 1 state)
2229
- (Let (x, Prim (Eq , [ Pv y; Pv z ])) :: instrs)
2234
+ (Let (x, Prim (prim , [ Pv y; Pv z ])) :: instrs)
2230
2235
| NEQ ->
2231
2236
let y = State. accu state in
2232
2237
let z = State. peek 0 state in
2233
2238
let x, state = State. fresh_var state in
2234
2239
2235
2240
if debug_parser ()
2236
2241
then Format. printf " %a = mk_bool(%a != %a)@." Var. print x Var. print y Var. print z;
2242
+ let hints = Hints. find infos.hints pc in
2243
+ let prim =
2244
+ if List. mem Hints. Hint_phys_equal ~set: hints
2245
+ then Extern " %not_phys_equal"
2246
+ else Neq
2247
+ in
2237
2248
compile
2238
2249
infos
2239
2250
(pc + 1 )
2240
2251
(State. pop 1 state)
2241
- (Let (x, Prim (Neq , [ Pv y; Pv z ])) :: instrs)
2252
+ (Let (x, Prim (prim , [ Pv y; Pv z ])) :: instrs)
2242
2253
| LTINT ->
2243
2254
let y = State. accu state in
2244
2255
let z = State. peek 0 state in
0 commit comments