aboutsummaryrefslogtreecommitdiffstats
path: root/aarch64/OpWeightsAsm.ml
diff options
context:
space:
mode:
authorLéo Gourdin <leo.gourdin@univ-grenoble-alpes.fr>2020-11-05 17:00:53 +0100
committerLéo Gourdin <leo.gourdin@univ-grenoble-alpes.fr>2020-11-05 17:00:53 +0100
commit2f25b395ef13d9c89260c932120a983218d7807c (patch)
tree6ddc3a2caf37ddf7d13a7a81c68da7c10c148ebc /aarch64/OpWeightsAsm.ml
parent0bf4c8582574b9c7bea43547d75b87c85fdee1e1 (diff)
downloadcompcert-kvx-2f25b395ef13d9c89260c932120a983218d7807c.tar.gz
compcert-kvx-2f25b395ef13d9c89260c932120a983218d7807c.zip
A first (not well-tuned) working version of postpass scheduling for A64
Diffstat (limited to 'aarch64/OpWeightsAsm.ml')
-rw-r--r--aarch64/OpWeightsAsm.ml643
1 files changed, 353 insertions, 290 deletions
diff --git a/aarch64/OpWeightsAsm.ml b/aarch64/OpWeightsAsm.ml
index c59d4695..5ba5832b 100644
--- a/aarch64/OpWeightsAsm.ml
+++ b/aarch64/OpWeightsAsm.ml
@@ -11,303 +11,366 @@
(* *)
(* *************************************************************)
-open Asmblock;;
-
(*type called_function = (Registers.reg, AST.ident) Datatypes.sum*)
-
-type opweights =
- {
- pipelined_resource_bounds : int array;
- nr_non_pipelined_units : int;
- latency_of_op : instruction -> int -> int;
- resources_of_op : instruction -> int -> int array;
- (*non_pipelined_resources_of_op : Op.operation -> int -> int array;*)
- (*latency_of_load : AST.trapping_mode -> AST.memory_chunk -> Op.addressing -> int -> int;*)
- (*resources_of_load : AST.trapping_mode -> AST.memory_chunk -> Op.addressing -> int -> int array;*)
- (*resources_of_store : AST.memory_chunk -> Op.addressing -> int -> int array;*)
- (*resources_of_cond : Op.condition -> int -> int array;*)
- (*latency_of_call : AST.signature -> called_function -> int;*)
- (*resources_of_call : AST.signature -> called_function -> int array;*)
- (*resources_of_builtin : AST.external_function -> int array*)
- };;
-module Cortex_A53=
- struct
- let resource_bounds = [| 2; 2; 1; 1 |];; (* instr ; ALU ; MAC; LSU *)
- let nr_non_pipelined_units = 1;;
+type real_instruction =
+ | Add
+ | Adr
+ | Adrp
+ | And
+ | Asr
+ | B
+ | Bic
+ | Bl
+ | Blr
+ | Br
+ | Cbnz
+ | Cbz
+ | Cls
+ | Clz
+ | Cmn
+ | Cmp
+ | Csel
+ | Cset
+ | Eon
+ | Eor
+ | Fabs
+ | Fadd
+ | Fcmp
+ | Fcsel
+ | Fcvt
+ | Fcvtzs
+ | Fcvtzu
+ | Fdiv
+ | Fmadd
+ | Fmov
+ | Fmsub
+ | Fmul
+ | Fnmadd
+ | Fnmul
+ | Fnmsub
+ | Fneg
+ | Fsqrt
+ | Fsub
+ | Ldaxr
+ | Ldp
+ | Ldr
+ | Ldrb
+ | Ldrh
+ | Ldrsb
+ | Ldrsh
+ | Ldrsw
+ | Lr
+ | Lsl
+ | Lsr
+ | Madd
+ | Mov
+ | Movk
+ | Movn
+ | Movz
+ | Msub
+ | Nop
+ | Orn
+ | Orr
+ | Ret
+ | Rev
+ | Rev16
+ | Ror
+ | Sbfiz
+ | Sbfx
+ | Scvtf
+ | Sdiv
+ | Smulh
+ | Stlxr
+ | Stp
+ | Str
+ | Strb
+ | Strh
+ | Sub
+ | Sxtb
+ | Sxth
+ | Sxtw
+ | Tbnz
+ | Tbz
+ | Tst
+ | Ubfiz
+ | Ubfx
+ | Ucvtf
+ | Udiv
+ | Umulh
+ | Uxtb
+ | Uxth
+ | Uxtw
+ | Uxtx
+ (* Pseudo instr *)
+ | Btbl
+ | Allocframe
+ | Freeframe
+ | Builtin
+ | Cvtx2w
+
+type opweights = {
+ pipelined_resource_bounds : int array;
+ nr_non_pipelined_units : int;
+ latency_of_op : real_instruction -> int -> int;
+ resources_of_op : real_instruction -> int -> int array;
+ (*non_pipelined_resources_of_op : Op.operation -> int -> int array;*)
+ (*latency_of_load : AST.trapping_mode -> AST.memory_chunk -> Op.addressing -> int -> int;*)
+ (*resources_of_load : AST.trapping_mode -> AST.memory_chunk -> Op.addressing -> int -> int array;*)
+ (*resources_of_store : AST.memory_chunk -> Op.addressing -> int -> int array;*)
+ (*resources_of_cond : Op.condition -> int -> int array;*)
+ (*latency_of_call : AST.signature -> called_function -> int;*)
+ (*resources_of_call : AST.signature -> called_function -> int array;*)
+ (*resources_of_builtin : AST.external_function -> int array*)
+}
+
+module Cortex_A53 = struct
+ let resource_bounds = [| 2; 2; 1; 1 |]
+
+ (* instr ; ALU ; MAC; LSU *)
+ let nr_non_pipelined_units = 1
+
+ let latency_of_op (i : real_instruction) (nargs : int) =
+ match i with
+ | Add -> 1
+ | Adr -> 1
+ | Adrp -> 1 (* XXX *)
+ | And -> 1
+ | Asr -> 2
+ | B -> 1
+ | Bic -> 1
+ | Bl -> 1
+ | Blr -> 1
+ | Br -> 1
+ | Cbnz -> 1
+ | Cbz -> 1
+ | Cls -> 1
+ | Clz -> 1
+ | Cmn -> 6
+ | Cmp -> 6
+ | Csel -> 2
+ | Cset -> 2
+ | Eon -> 1
+ | Eor -> 1
+ | Fabs -> 6
+ | Fadd -> 1
+ | Fcmp -> 6
+ | Fcsel -> 1
+ | Fcvt -> 6
+ | Fcvtzs -> 6
+ | Fcvtzu -> 6
+ | Fdiv -> 50
+ | Fmadd -> 1
+ | Fmov -> 1
+ | Fmsub -> 1
+ | Fmul -> 6
+ | Fnmadd -> 1
+ | Fnmul -> 1
+ | Fnmsub -> 1
+ | Fneg -> 6
+ | Fsqrt -> 1
+ | Fsub -> 6
+ | Ldaxr -> 3
+ | Ldp -> 3
+ | Ldr -> 3
+ | Ldrb -> 3
+ | Ldrh -> 3
+ | Ldrsb -> 3
+ | Ldrsh -> 3
+ | Ldrsw -> 3
+ | Lr -> 3
+ | Lsl -> 2
+ | Lsr -> 2
+ | Madd -> 4
+ | Mov -> 1 (* XXX *)
+ | Movk -> 1
+ | Movn -> 1
+ | Movz -> 1
+ | Msub -> 4
+ | Nop -> 1
+ | Orn -> 1
+ | Orr -> 1
+ | Ret -> 1
+ | Rev -> 1
+ | Rev16 -> 1
+ | Ror -> 2
+ | Sbfiz -> 2 (* XXX *)
+ | Sbfx -> 2
+ | Scvtf -> 6
+ | Sdiv -> 50
+ | Smulh -> 4
+ | Stlxr -> 2
+ | Stp -> 2
+ | Str -> 2
+ | Strb -> 2
+ | Strh -> 2
+ | Sub -> 1
+ | Sxtb -> 1
+ | Sxth -> 1
+ | Sxtw -> 1
+ | Tbnz -> 1
+ | Tbz -> 1
+ | Tst -> 6
+ | Ubfiz -> 2 (* XXX *)
+ | Ubfx -> 2
+ | Ucvtf -> 6
+ | Udiv -> 50
+ | Umulh -> 4
+ | Uxtb -> 1
+ | Uxth -> 1
+ | Uxtw -> 1
+ | Uxtx -> 1
+ | Btbl -> 1
+ | Allocframe -> 1
+ | Freeframe -> 1
+ | Builtin -> 1
+ | Cvtx2w -> 1
+
+ let resources_of_op (i : real_instruction) (nargs : int) =
+ match i with
+ | Add -> [| 1; 1; 0; 0 |]
+ | Adr -> [| 1; 1; 0; 0 |]
+ | Adrp -> [| 1; 1; 0; 0 |]
+ | And -> [| 1; 1; 0; 0 |]
+ | Asr -> [| 1; 1; 0; 0 |]
+ | B -> [| 1; 1; 0; 0 |]
+ | Bic -> [| 1; 1; 0; 0 |]
+ | Bl -> [| 1; 1; 0; 0 |]
+ | Blr -> [| 1; 1; 0; 0 |]
+ | Br -> [| 1; 1; 0; 0 |]
+ | Cbnz -> [| 1; 1; 0; 0 |]
+ | Cbz -> [| 1; 1; 0; 0 |]
+ | Cls -> [| 1; 1; 0; 0 |]
+ | Clz -> [| 1; 1; 0; 0 |]
+ | Cmn -> [| 1; 1; 1; 0 |]
+ | Cmp -> [| 1; 1; 1; 0 |]
+ | Csel -> [| 1; 1; 1; 0 |]
+ | Cset -> [| 1; 1; 1; 0 |]
+ | Eon -> [| 1; 1; 0; 0 |]
+ | Eor -> [| 1; 1; 0; 0 |]
+ | Fabs -> [| 1; 1; 1; 0 |]
+ | Fadd -> [| 1; 1; 1; 0 |]
+ | Fcmp -> [| 1; 1; 1; 0 |]
+ | Fcsel -> [| 1; 1; 0; 0 |]
+ | Fcvt -> [| 1; 1; 1; 0 |]
+ | Fcvtzs -> [| 1; 1; 1; 0 |]
+ | Fcvtzu -> [| 1; 1; 1; 0 |]
+ | Fdiv -> [| 1; 1; 1; 0 |]
+ | Fmadd -> [| 1; 1; 0; 0 |]
+ | Fmov -> [| 1; 1; 0; 0 |]
+ | Fmsub -> [| 1; 1; 0; 0 |]
+ | Fmul -> [| 1; 1; 1; 0 |]
+ | Fnmadd -> [| 1; 1; 0; 0 |]
+ | Fnmul -> [| 1; 1; 0; 0 |]
+ | Fnmsub -> [| 1; 1; 0; 0 |]
+ | Fneg -> [| 1; 1; 1; 0 |]
+ | Fsqrt -> [| 1; 1; 0; 0 |]
+ | Fsub -> [| 1; 1; 1; 0 |]
+ | Ldaxr -> [| 1; 0; 0; 1 |]
+ | Ldp -> [| 1; 0; 0; 1 |]
+ | Ldr -> [| 1; 0; 0; 1 |]
+ | Ldrb -> [| 1; 0; 0; 1 |]
+ | Ldrh -> [| 1; 0; 0; 1 |]
+ | Ldrsb -> [| 1; 0; 0; 1 |]
+ | Ldrsh -> [| 1; 0; 0; 1 |]
+ | Ldrsw -> [| 1; 0; 0; 1 |]
+ | Lr -> [| 1; 0; 0; 1 |]
+ | Lsl -> [| 1; 1; 0; 0 |]
+ | Lsr -> [| 1; 1; 0; 0 |]
+ | Madd -> [| 1; 1; 1; 0 |]
+ | Mov -> [| 1; 1; 0; 0 |]
+ | Movk -> [| 1; 1; 0; 0 |]
+ | Movn -> [| 1; 1; 0; 0 |]
+ | Movz -> [| 1; 1; 0; 0 |]
+ | Msub -> [| 1; 1; 1; 0 |]
+ | Nop -> [| 1; 1; 0; 0 |]
+ | Orn -> [| 1; 1; 0; 0 |]
+ | Orr -> [| 1; 1; 0; 0 |]
+ | Ret -> [| 1; 1; 0; 0 |]
+ | Rev -> [| 1; 1; 0; 0 |]
+ | Rev16 -> [| 1; 1; 0; 0 |]
+ | Ror -> [| 1; 1; 0; 0 |]
+ | Sbfiz -> [| 1; 1; 0; 0 |]
+ | Sbfx -> [| 1; 1; 0; 0 |]
+ | Scvtf -> [| 1; 1; 1; 0 |]
+ | Sdiv -> [| 1; 0; 0; 0 |]
+ | Smulh -> [| 1; 1; 0; 0 |]
+ | Stlxr -> [| 1; 0; 0; 1 |]
+ | Stp -> [| 1; 0; 0; 1 |]
+ | Str -> [| 1; 0; 0; 1 |]
+ | Strb -> [| 1; 0; 0; 1 |]
+ | Strh -> [| 1; 0; 0; 1 |]
+ | Sub -> [| 1; 1; 0; 0 |]
+ | Sxtb -> [| 1; 1; 0; 0 |]
+ | Sxth -> [| 1; 1; 0; 0 |]
+ | Sxtw -> [| 1; 1; 0; 0 |]
+ | Tbnz -> [| 1; 1; 0; 0 |]
+ | Tbz -> [| 1; 1; 0; 0 |]
+ | Tst -> [| 1; 1; 1; 0 |]
+ | Ubfiz -> [| 1; 1; 0; 0 |]
+ | Ubfx -> [| 1; 1; 0; 0 |]
+ | Ucvtf -> [| 1; 1; 1; 0 |]
+ | Udiv -> [| 1; 0; 0; 0 |]
+ | Umulh -> [| 1; 1; 0; 0 |]
+ | Uxtb -> [| 1; 1; 0; 0 |]
+ | Uxth -> [| 1; 1; 0; 0 |]
+ | Uxtw -> [| 1; 1; 0; 0 |]
+ | Uxtx -> [| 1; 1; 0; 0 |]
+ | Btbl -> [| 1; 1; 0; 0 |]
+ | Allocframe -> [| 1; 0; 0; 0 |]
+ | Freeframe -> [| 1; 0; 0; 0 |]
+ | Builtin -> [| 1; 0; 0; 0 |]
+ | Cvtx2w -> [| 1; 0; 0; 0 |]
- let latency_of_op (i : instruction) (nargs : int) = 1;;
- (*match i with
- | PArith _
- | PArithP _ _ _
- | Padrp _ _ -> 1 (* XXX not sure *)
- | Pmovz _ _ _ -> 1
- | Pmovn _ _ _ -> 1
- | Pfmovimms _ -> 1
- | Pfmovimmd _ -> 1
- | PArithPP _ _ _
- | Pmov -> 1 (* XXX not sure *)
- | Pmovk _ _ _ -> 1
- | Paddadr _ _ -> 1
- | Psbfiz _ _ _ -> 2 (* XXX Maybe 1 *)
- | Psbfx _ _ _ -> 2
- | Pubfiz _ _ _ -> 2 (* XXX Maybe 1 *)
- | Pubfx _ _ _ -> 2
- | Pfmov -> 1
- | Pfcvtds -> 6
- | Pfcvtsd -> 6
- | Pfabs _ -> 6
- | Pfneg _ -> 6
- | Pscvtf _ _ -> 6
- | Pucvtf _ _ -> 6
- | Pfcvtzs _ _ -> 6
- | Pfcvtzu _ _ -> 6
- | Paddimm _ _ -> 1
- | Psubimm _ _ -> 1
- | PArithPPP _ _ _ _
- | Pasrv _ -> 2
- | Plslv _ -> 2
- | Plsrv _ -> 2
- | Prorv _ -> 2 (* XXX Does not exits in Asmblockgen?? *)
- | Psmulh -> 4
- | Pumulh -> 4
- | Psdiv _ -> 50
- | Pudiv _ -> 50
- | Paddext _ -> 2
- | Psubext _ -> 2
- | Pfadd _ -> 6
- | Pfdiv _ -> 50
- | Pfmul _ -> 6
- | Pfsub _ -> 6
- | PArithRR0R _ _ _ _
- | Padd _ _ -> 2 (* XXX Maybe 6 as used in shifts *)
- | Psub _ _ -> 2 (* XXX Maybe 6 as used in shifts *)
- | Pand _ _ -> 1 (* XXX Maybe 2 as used in shifts *)
- | Pbic _ _ -> 1 (* XXX Maybe 2 as used in shifts *)
- | Peon _ _ -> 1 (* XXX Maybe 2 as used in shifts *)
- | Peor _ _ -> 1 (* XXX Maybe 2 as used in shifts *)
- | Porr _ _ -> 1 (* XXX Maybe 2 as used in shifts *)
- | Porn _ _ -> 1 (* XXX Maybe 2 as used in shifts *)
- | PArithRR0 _ _ _
- | Pandimm _ _ -> 1
- | Peorimm _ _ -> 1
- | Porrimm _ _ -> 1
- | PArithARRRR0 _ _ _ _ _
- | Pmadd _ -> 4
- | Pmsub _ -> 4
- | PArithComparisonPP _ _ _ (* XXX not sure *)
- | Pcmpext _ -> 1
- | Pcmnext _ -> 1
- | Pfcmp _ -> 1
- | PArithComparisonR0R _ _ _ (* XXX not sure *)
- | Pcmp _ _ -> 1
- | Pcmn _ _ -> 1
- | Ptst _ _ -> 1
- | PArithComparisonP _ _ _ (* XXX not sure *)
- | Pfcmp0 _ -> 1
- | Pcmpimm _ _ -> 1
- | Pcmnimm _ _ -> 1
- | Ptstimm _ _ -> 1
- | Printf.eprintf "Error NYI OpWeightsAsm"*)
+ (*let non_pipelined_resources_of_op (op : operation) (nargs : int) =
+ match op with
+ | Odiv | Odivu -> [| 29 |]
+ | Odivfs -> [| 20 |]
+ | Odivl | Odivlu | Odivf -> [| 50 |]
+ | _ -> [| -1 |];;
+ let resources_of_cond (cmp : condition) (nargs : int) =
+ (match cmp with
+ | Ccompf _ (* r FP comparison *)
+ | Cnotcompf _ (* r negation of an FP comparison *)
+ | Ccompfzero _ (* r comparison with 0.0 *)
+ | Cnotcompfzero _ (* r negation of comparison with 0.0 *)
+ | Ccompfs _ (* r FP comparison *)
+ | Cnotcompfs _ (* r negation of an FP comparison *)
+ | Ccompfszero _ (* r equal to 0.0 *)
+ | Cnotcompfszero _ (* r not equal to 0.0 *) ->
+ [| 1; 1; 1; 0 |]
+ | _ -> [| 1; 1; 0; 0 |] )*)
+ let latency_of_load trap chunk _ _ = 3
-
- let resources_of_op (i : instruction) (nargs : int) = [| 0; 0; 0; 0 |];;
- (*match op with
- | Omove
- | Ointconst _
- | Olongconst _
- | Ofloatconst _
- | Osingleconst _
- | Oaddrsymbol _
- | Oaddrstack _
- (* 32-bit integer arithmetic *)
- | Oshift _
- | Oadd
- | Oaddshift _
- | Oaddimm _
- | Oneg
- | Onegshift _
- | Osub
- | Osubshift _ -> [| 1 ; 1; 0; 0 |]
- | Omul
- | Omuladd
- | Omulsub -> [| 1; 1; 1; 0 |]
- | Odiv
- | Odivu -> [| 1; 0; 0; 0 |]
- | Oand
- | Oandshift _
- | Oandimm _
- | Oor
- | Oorshift _
- | Oorimm _
- | Oxor
- | Oxorshift _
- | Oxorimm _
- | Onot
- | Onotshift _
- | Obic
- | Obicshift _
- | Oorn
- | Oornshift _
- | Oeqv
- | Oeqvshift _
- | Oshl
- | Oshr
- | Oshru
- | Oshrximm _
- | Ozext _
- | Osext _
- | Oshlzext _
- | Oshlsext _
- | Ozextshr _
- | Osextshr _
-
-(* 64-bit integer arithmetic *)
- | Oshiftl _
- | Oextend _
- | Omakelong
- | Olowlong
- | Ohighlong
- | Oaddl
- | Oaddlshift _
- | Oaddlext _
- | Oaddlimm _
- | Onegl
- | Oneglshift _
- | Osubl
- | Osublshift _
- | Osublext _ -> [| 1 ; 1 ; 0; 0 |]
- | Omull
- | Omulladd
- | Omullsub
- | Omullhs
- | Omullhu -> [| 1 ; 1 ; 1; 0 |]
- | Odivl
- | Odivlu -> [| 1; 0; 0; 0 |]
- | Oandl
- | Oandlshift _
- | Oandlimm _
- | Oorl
- | Oorlshift _
- | Oorlimm _
- | Oxorl
- | Oxorlshift _
- | Oxorlimm _
- | Onotl
- | Onotlshift _
- | Obicl
- | Obiclshift _
- | Oornl
- | Oornlshift _
- | Oeqvl
- | Oeqvlshift _
- | Oshll
- | Oshrl
- | Oshrlu
- | Oshrlximm _
- | Ozextl _
- | Osextl _
- | Oshllzext _
- | Oshllsext _
- | Ozextshrl _
- | Osextshrl _ -> [| 1; 1; 0; 0 |]
- (* 64-bit floating-point arithmetic *)
- | Onegf (* r [rd = - r1] *)
- | Oabsf (* r [rd = abs(r1)] *)
- | Oaddf (* r [rd = r1 + r2] *)
- | Osubf (* r [rd = r1 - r2] *)
- | Omulf (* r [rd = r1 * r2] *)
- | Odivf
- (* 32-bit floating-point arithmetic *)
- | Onegfs (* r [rd = - r1] *)
- | Oabsfs (* r [rd = abs(r1)] *)
- | Oaddfs (* r [rd = r1 + r2] *)
- | Osubfs (* r [rd = r1 - r2] *)
- | Omulfs (* r [rd = r1 * r2] *)
- | Odivfs (* r [rd = r1 / r2] *)
- | Osingleoffloat (* r [rd] is [r1] truncated to single-precision float *)
- | Ofloatofsingle (* r [rd] is [r1] extended to double-precision float *)
-(* Conversions between int and float *)
- | Ointoffloat (* r [rd = signed_int_of_float64(r1)] *)
- | Ointuoffloat (* r [rd = unsigned_int_of_float64(r1)] *)
- | Ofloatofint (* r [rd = float64_of_signed_int(r1)] *)
- | Ofloatofintu (* r [rd = float64_of_unsigned_int(r1)] *)
- | Ointofsingle (* r [rd = signed_int_of_float32(r1)] *)
- | Ointuofsingle (* r [rd = unsigned_int_of_float32(r1)] *)
- | Osingleofint (* r [rd = float32_of_signed_int(r1)] *)
- | Osingleofintu (* r [rd = float32_of_unsigned_int(r1)] *)
- | Olongoffloat (* r [rd = signed_long_of_float64(r1)] *)
- | Olonguoffloat (* r [rd = unsigned_long_of_float64(r1)] *)
- | Ofloatoflong (* r [rd = float64_of_signed_long(r1)] *)
- | Ofloatoflongu (* r [rd = float64_of_unsigned_long(r1)] *)
- | Olongofsingle (* r [rd = signed_long_of_float32(r1)] *)
- | Olonguofsingle (* r [rd = unsigned_long_of_float32(r1)] *)
- | Osingleoflong (* r [rd = float32_of_signed_long(r1)] *)
- | Osingleoflongu (* r [rd = float32_of_unsigned_int(r1)] *)
- -> [| 1 ; 1; 1; 0 |]
-
-(* Boolean tests *)
- | Ocmp cmp | Osel (cmp, _) ->
- (match cmp with
- | Ccompf _ (* r FP comparison *)
- | Cnotcompf _ (* r negation of an FP comparison *)
- | Ccompfzero _ (* r comparison with 0.0 *)
- | Cnotcompfzero _ (* r negation of comparison with 0.0 *)
- | Ccompfs _ (* r FP comparison *)
- | Cnotcompfs _ (* r negation of an FP comparison *)
- | Ccompfszero _ (* r equal to 0.0 *)
- | Cnotcompfszero _ (* r not equal to 0.0 *) ->
- [| 1; 1; 1; 0 |]
- | _ -> [| 1; 1; 0; 0 |] );;
-
- let non_pipelined_resources_of_op (op : operation) (nargs : int) =
- match op with
- | Odiv | Odivu -> [| 29 |]
- | Odivfs -> [| 20 |]
- | Odivl | Odivlu | Odivf -> [| 50 |]
- | _ -> [| -1 |];;
-
- let resources_of_cond (cmp : condition) (nargs : int) =
- (match cmp with
- | Ccompf _ (* r FP comparison *)
- | Cnotcompf _ (* r negation of an FP comparison *)
- | Ccompfzero _ (* r comparison with 0.0 *)
- | Cnotcompfzero _ (* r negation of comparison with 0.0 *)
- | Ccompfs _ (* r FP comparison *)
- | Cnotcompfs _ (* r negation of an FP comparison *)
- | Ccompfszero _ (* r equal to 0.0 *)
- | Cnotcompfszero _ (* r not equal to 0.0 *) ->
- [| 1; 1; 1; 0 |]
- | _ -> [| 1; 1; 0; 0 |] )*);;
-
- let latency_of_load trap chunk _ _ = 3;;
- let latency_of_call _ _ = 6;;
-
- let resources_of_load trap chunk addressing nargs = [| 1; 0; 0; 1 |];;
-
- let resources_of_store chunk addressing nargs = [| 1; 0; 0; 1 |];;
-
- let resources_of_call _ _ = resource_bounds;;
- let resources_of_builtin _ = resource_bounds;;
- end;;
+ let latency_of_call _ _ = 6
+
+ let resources_of_load trap chunk addressing nargs = [| 1; 0; 0; 1 |]
+
+ let resources_of_store chunk addressing nargs = [| 1; 0; 0; 1 |]
+
+ let resources_of_call _ _ = resource_bounds
+
+ let resources_of_builtin _ = resource_bounds
+end
let get_opweights () : opweights =
(*match !Clflags.option_mtune with*)
(*| "cortex-a53" | "cortex-a35" | "" ->*)
- {
- pipelined_resource_bounds = Cortex_A53.resource_bounds;
- nr_non_pipelined_units = Cortex_A53.nr_non_pipelined_units;
- latency_of_op = Cortex_A53.latency_of_op;
- resources_of_op = Cortex_A53.resources_of_op;
- (*non_pipelined_resources_of_op = Cortex_A53.non_pipelined_resources_of_op;*)
- (*latency_of_load = Cortex_A53.latency_of_load;*)
- (*resources_of_load = Cortex_A53.resources_of_load;*)
- (*resources_of_store = Cortex_A53.resources_of_store;*)
- (*resources_of_cond = Cortex_A53.resources_of_cond;*)
- (*latency_of_call = Cortex_A53.latency_of_call;*)
- (*resources_of_call = Cortex_A53.resources_of_call;*)
- (*resources_of_builtin = Cortex_A53.resources_of_builtin*)
- }
- (*| xxx -> failwith (Printf.sprintf "unknown -mtune: %s" xxx);;*)
+ {
+ pipelined_resource_bounds = Cortex_A53.resource_bounds;
+ nr_non_pipelined_units = Cortex_A53.nr_non_pipelined_units;
+ latency_of_op = Cortex_A53.latency_of_op;
+ resources_of_op = Cortex_A53.resources_of_op
+ (*non_pipelined_resources_of_op = Cortex_A53.non_pipelined_resources_of_op;*)
+ (*latency_of_load = Cortex_A53.latency_of_load;*)
+ (*resources_of_load = Cortex_A53.resources_of_load;*)
+ (*resources_of_store = Cortex_A53.resources_of_store;*)
+ (*resources_of_cond = Cortex_A53.resources_of_cond;*)
+ (*latency_of_call = Cortex_A53.latency_of_call;*)
+ (*resources_of_call = Cortex_A53.resources_of_call;*)
+ (*resources_of_builtin = Cortex_A53.resources_of_builtin*);
+ }
+
+(*| xxx -> failwith (Printf.sprintf "unknown -mtune: %s" xxx);;*)