File tree Expand file tree Collapse file tree 10 files changed +110
-0
lines changed Expand file tree Collapse file tree 10 files changed +110
-0
lines changed Original file line number Diff line number Diff line change @@ -379,3 +379,15 @@ let init () =
379
379
num_available_registers.(0 ) < - 12
380
380
end else
381
381
num_available_registers.(0 ) < - 13
382
+
383
+ let operation_supported = function
384
+ | Capply _ | Cextcall _ | Cload _ | Calloc | Cstore _
385
+ | Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi
386
+ | Cand | Cor | Cxor | Clsl | Clsr | Casr
387
+ | Ccmpi _ | Caddv | Cadda | Ccmpa _
388
+ | Cnegf | Cabsf | Caddf | Csubf | Cmulf | Cdivf
389
+ | Cfloatofint | Cintoffloat | Ccmpf _
390
+ | Craise _
391
+ | Ccheckbound
392
+ | Cprobe _ | Cprobe_is_enabled _
393
+ -> true
Original file line number Diff line number Diff line change @@ -360,3 +360,15 @@ let assemble_file infile outfile =
360
360
361
361
362
362
let init () = ()
363
+
364
+ let operation_supported = function
365
+ | Capply _ | Cextcall _ | Cload _ | Calloc | Cstore _
366
+ | Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi
367
+ | Cand | Cor | Cxor | Clsl | Clsr | Casr
368
+ | Ccmpi _ | Caddv | Cadda | Ccmpa _
369
+ | Cnegf | Cabsf | Caddf | Csubf | Cmulf | Cdivf
370
+ | Cfloatofint | Cintoffloat | Ccmpf _
371
+ | Craise _
372
+ | Ccheckbound
373
+ | Cprobe _ | Cprobe_is_enabled _
374
+ -> true
Original file line number Diff line number Diff line change @@ -308,3 +308,15 @@ let assemble_file infile outfile =
308
308
309
309
310
310
let init () = ()
311
+
312
+ let operation_supported = function
313
+ | Capply _ | Cextcall _ | Cload _ | Calloc | Cstore _
314
+ | Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi
315
+ | Cand | Cor | Cxor | Clsl | Clsr | Casr
316
+ | Ccmpi _ | Caddv | Cadda | Ccmpa _
317
+ | Cnegf | Cabsf | Caddf | Csubf | Cmulf | Cdivf
318
+ | Cfloatofint | Cintoffloat | Ccmpf _
319
+ | Craise _
320
+ | Ccheckbound
321
+ | Cprobe _ | Cprobe_is_enabled _
322
+ -> true
Original file line number Diff line number Diff line change @@ -2543,6 +2543,20 @@ let bigstring_set size unsafe arg1 arg2 arg3 dbg =
2543
2543
check_bound unsafe size dbg (bigstring_length ba dbg)
2544
2544
idx (unaligned_set size ba_data idx newval dbg))))))
2545
2545
2546
+
2547
+ (* [cextcall] is called from [Cmmgen.transl_ccall] *)
2548
+ let cextcall (prim : Primitive.description ) args dbg ret ty_args =
2549
+ let name = Primitive. native_name prim in
2550
+ let default = Cop (Cextcall { name; ret;
2551
+ builtin = prim.prim_c_builtin;
2552
+ effects = Arbitrary_effects ;
2553
+ coeffects = Has_coeffects ;
2554
+ alloc = prim.prim_alloc;
2555
+ ty_args },
2556
+ args, dbg)
2557
+ in
2558
+ default
2559
+
2546
2560
(* Symbols *)
2547
2561
2548
2562
let cdefine_symbol (symb , (global : Cmmgen_state.is_global )) =
Original file line number Diff line number Diff line change @@ -575,6 +575,12 @@ val send :
575
575
Lambda .meth_kind -> expression -> expression -> expression list ->
576
576
Debuginfo .t -> expression
577
577
578
+ (* * [cextcall prim args dbg type_of_result] returns Cextcall operation
579
+ that corresponds to [prim]. If [prim] is a C builtin supported on the
580
+ target, returns [Cmm.operation] variant for [prim]'s intrinsics. *)
581
+ val cextcall : Primitive .description -> expression list -> Debuginfo .t ->
582
+ machtype -> exttype list -> expression
583
+
578
584
(* * Generic Cmm fragments *)
579
585
580
586
(* * Generate generic functions *)
Original file line number Diff line number Diff line change @@ -256,3 +256,15 @@ let assemble_file infile outfile =
256
256
X86_proc. assemble_file infile outfile
257
257
258
258
let init () = ()
259
+
260
+ let operation_supported = function
261
+ | Capply _ | Cextcall _ | Cload _ | Calloc | Cstore _
262
+ | Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi
263
+ | Cand | Cor | Cxor | Clsl | Clsr | Casr
264
+ | Ccmpi _ | Caddv | Cadda | Ccmpa _
265
+ | Cnegf | Cabsf | Caddf | Csubf | Cmulf | Cdivf
266
+ | Cfloatofint | Cintoffloat | Ccmpf _
267
+ | Craise _
268
+ | Ccheckbound
269
+ | Cprobe _ | Cprobe_is_enabled _
270
+ -> true
Original file line number Diff line number Diff line change @@ -361,3 +361,15 @@ let assemble_file infile outfile =
361
361
" -o " ^ Filename. quote outfile ^ " " ^ Filename. quote infile)
362
362
363
363
let init () = ()
364
+
365
+ let operation_supported = function
366
+ | Capply _ | Cextcall _ | Cload _ | Calloc | Cstore _
367
+ | Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi
368
+ | Cand | Cor | Cxor | Clsl | Clsr | Casr
369
+ | Ccmpi _ | Caddv | Cadda | Ccmpa _
370
+ | Cnegf | Cabsf | Caddf | Csubf | Cmulf | Cdivf
371
+ | Cfloatofint | Cintoffloat | Ccmpf _
372
+ | Craise _
373
+ | Ccheckbound
374
+ | Cprobe _ | Cprobe_is_enabled _
375
+ -> true
Original file line number Diff line number Diff line change @@ -81,3 +81,9 @@ val assemble_file: string -> string -> int
81
81
82
82
(* Called before translating a fundecl. *)
83
83
val init : unit -> unit
84
+
85
+ (* * [operation_supported op] returns true when [op]
86
+ can be implemented directly with a hardware instruction.
87
+ Used in Cmmgen when converting [@@builtin] external calls
88
+ to primitive operations. *)
89
+ val operation_supported : Cmm .operation -> bool
Original file line number Diff line number Diff line change @@ -320,3 +320,15 @@ let assemble_file infile outfile =
320
320
(Config. asm ^ " -o " ^ Filename. quote outfile ^ " " ^ Filename. quote infile)
321
321
322
322
let init () = ()
323
+
324
+ let operation_supported = function
325
+ | Capply _ | Cextcall _ | Cload _ | Calloc | Cstore _
326
+ | Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi
327
+ | Cand | Cor | Cxor | Clsl | Clsr | Casr
328
+ | Ccmpi _ | Caddv | Cadda | Ccmpa _
329
+ | Cnegf | Cabsf | Caddf | Csubf | Cmulf | Cdivf
330
+ | Cfloatofint | Cintoffloat | Ccmpf _
331
+ | Craise _
332
+ | Ccheckbound
333
+ | Cprobe _ | Cprobe_is_enabled _
334
+ -> true
Original file line number Diff line number Diff line change @@ -237,3 +237,15 @@ let assemble_file infile outfile =
237
237
" -o " ^ Filename. quote outfile ^ " " ^ Filename. quote infile)
238
238
239
239
let init () = ()
240
+
241
+ let operation_supported = function
242
+ | Capply _ | Cextcall _ | Cload _ | Calloc | Cstore _
243
+ | Caddi | Csubi | Cmuli | Cmulhi | Cdivi | Cmodi
244
+ | Cand | Cor | Cxor | Clsl | Clsr | Casr
245
+ | Ccmpi _ | Caddv | Cadda | Ccmpa _
246
+ | Cnegf | Cabsf | Caddf | Csubf | Cmulf | Cdivf
247
+ | Cfloatofint | Cintoffloat | Ccmpf _
248
+ | Craise _
249
+ | Ccheckbound
250
+ | Cprobe _ | Cprobe_is_enabled _
251
+ -> true
You can’t perform that action at this time.
0 commit comments