aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/PostpassSchedulingOracle.ml
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-19 22:13:53 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-19 22:13:53 +0100
commit4cc5324db73dd014bcd2c118f5769f88e52f8643 (patch)
tree6f3df7b011f34f2cdaa8381342756708f7b02e49 /mppa_k1c/PostpassSchedulingOracle.ml
parentf321f75979d18ab99f226b2c5d6bbb59bffb5cac (diff)
parent2af07d6a328f73a32bc2c768e3108dd3db393ed1 (diff)
downloadcompcert-kvx-4cc5324db73dd014bcd2c118f5769f88e52f8643.tar.gz
compcert-kvx-4cc5324db73dd014bcd2c118f5769f88e52f8643.zip
Merge branch 'mppa-madd' into mppa_postpass
Diffstat (limited to 'mppa_k1c/PostpassSchedulingOracle.ml')
-rw-r--r--mppa_k1c/PostpassSchedulingOracle.ml35
1 files changed, 28 insertions, 7 deletions
diff --git a/mppa_k1c/PostpassSchedulingOracle.ml b/mppa_k1c/PostpassSchedulingOracle.ml
index ac257af3..2c39e342 100644
--- a/mppa_k1c/PostpassSchedulingOracle.ml
+++ b/mppa_k1c/PostpassSchedulingOracle.ml
@@ -95,6 +95,7 @@ let arith_rrr_str = function
let arith_rri32_str = function
| Pcompiw it -> "Pcompiw"
| Paddiw -> "Paddiw"
+ | Pmuliw -> "Pmuliw"
| Pandiw -> "Pandiw"
| Pnandiw -> "Pnandiw"
| Poriw -> "Poriw"
@@ -114,6 +115,7 @@ let arith_rri32_str = function
let arith_rri64_str = function
| Pcompil it -> "Pcompil"
| Paddil -> "Paddil"
+ | Pmulil -> "Pmulil"
| Pandil -> "Pandil"
| Pnandil -> "Pnandil"
| Poril -> "Poril"
@@ -123,6 +125,10 @@ let arith_rri64_str = function
| Pandnil -> "Pandnil"
| Pornil -> "Pornil"
+let arith_arrr_str = function
+ | Pmaddw -> "Pmaddw"
+ | Pmaddl -> "Pmaddl"
+
let arith_ri32_str = "Pmake"
let arith_ri64_str = "Pmakel"
@@ -162,6 +168,12 @@ let arith_rri64_rec i rd rs imm64 = { inst = arith_rri64_str i; write_locs = [Re
let arith_rrr_rec i rd rs1 rs2 = { inst = arith_rrr_str i; write_locs = [Reg rd]; read_locs = [Reg rs1; Reg rs2]; imm = None; is_control = false}
+let arith_arri32_rec i rd rs imm32 = { inst = "Pmaddiw"; write_locs = [Reg rd]; read_locs = [Reg rd; Reg rs]; imm = imm32; is_control = false }
+
+let arith_arri64_rec i rd rs imm64 = { inst = "Pmaddil"; write_locs = [Reg rd]; read_locs = [Reg rd; Reg rs]; imm = imm64; is_control = false }
+
+let arith_arrr_rec i rd rs1 rs2 = { inst = arith_arrr_str i; write_locs = [Reg rd]; read_locs = [Reg rd; Reg rs1; Reg rs2]; imm = None; is_control = false}
+
let arith_rr_rec i rd rs = { inst = arith_rr_str i; write_locs = [Reg rd]; read_locs = [Reg rs]; imm = None; is_control = false}
let arith_r_rec i rd = match i with
@@ -173,6 +185,10 @@ let arith_rec i =
| PArithRRI32 (i, rd, rs, imm32) -> arith_rri32_rec i (IR rd) (IR rs) (Some (I32 imm32))
| PArithRRI64 (i, rd, rs, imm64) -> arith_rri64_rec i (IR rd) (IR rs) (Some (I64 imm64))
| PArithRRR (i, rd, rs1, rs2) -> arith_rrr_rec i (IR rd) (IR rs1) (IR rs2)
+ (* Seems like single constant constructor types are elided *)
+ | PArithARRI32 ((* i,*) rd, rs, imm32) -> arith_arri32_rec () (IR rd) (IR rs) (Some (I32 imm32))
+ | PArithARRI64 ((* i,*) rd, rs, imm64) -> arith_arri64_rec () (IR rd) (IR rs) (Some (I64 imm64))
+ | PArithARRR (i, rd, rs1, rs2) -> arith_arrr_rec i (IR rd) (IR rs1) (IR rs2)
| PArithRI32 (rd, imm32) -> { inst = arith_ri32_str; write_locs = [Reg (IR rd)]; read_locs = []; imm = (Some (I32 imm32)) ; is_control = false}
| PArithRI64 (rd, imm64) -> { inst = arith_ri64_str; write_locs = [Reg (IR rd)]; read_locs = []; imm = (Some (I64 imm64)) ; is_control = false}
| PArithRF32 (rd, f) -> { inst = arith_rf32_str; write_locs = [Reg (IR rd)]; read_locs = [];
@@ -400,6 +416,7 @@ type real_instruction =
| Addw | Andw | Compw | Mulw | Orw | Sbfw | Sraw | Srlw | Sllw | Rorw | Xorw
| Addd | Andd | Compd | Muld | Ord | Sbfd | Srad | Srld | Slld | Xord
| Nandw | Norw | Nxorw | Nandd | Nord | Nxord | Andnw | Ornw | Andnd | Ornd
+ | Maddw | Maddd
| Make | Nop | Sxwd | Zxwd
(* LSU *)
| Lbs | Lbz | Lhs | Lhz | Lws | Ld
@@ -423,8 +440,8 @@ let ab_inst_to_real = function
| "Pcompl" | "Pcompil" -> Compd
| "Pfcompw" -> Fcompw
| "Pfcompl" -> Fcompd
- | "Pmulw" -> Mulw
- | "Pmull" -> Muld
+ | "Pmulw" | "Pmuliw" -> Mulw
+ | "Pmull" | "Pmulil" -> Muld
| "Porw" | "Poriw" -> Orw
| "Pnorw" | "Pnoriw" -> Norw
| "Porl" | "Poril" -> Ord
@@ -437,6 +454,7 @@ let ab_inst_to_real = function
| "Psrll" | "Psrlil" -> Srld
| "Psllw" | "Pslliw" -> Sllw
| "Proriw" -> Rorw
+ | "Pmaddw" | "Pmaddiw" -> Maddw
| "Pslll" | "Psllil" -> Slld
| "Pxorw" | "Pxoriw" -> Xorw
| "Pnxorw" | "Pnxoriw" -> Nxorw
@@ -446,6 +464,7 @@ let ab_inst_to_real = function
| "Pnxorl" | "Pnxoril" -> Nxord
| "Pandnl" | "Pandnil" -> Andnd
| "Pornl" | "Pornil" -> Ornd
+ | "Pmaddl" -> Maddd
| "Pmake" | "Pmakel" | "Pmakefs" | "Pmakef" | "Ploadsymbol" -> Make
| "Pnop" | "Pcvtw2l" -> Nop
| "Psxwd" -> Sxwd
@@ -507,11 +526,13 @@ let rec_to_usage r =
(* I do not know yet in which context Ofslow can be used by CompCert *)
and real_inst = ab_inst_to_real r.inst
in match real_inst with
- | Addw | Andw | Nandw | Orw | Norw | Sbfw | Xorw | Nxorw | Andnw | Ornw ->
+ | Addw | Andw | Nandw | Orw | Norw | Sbfw | Xorw
+ | Nxorw | Andnw | Ornw ->
(match encoding with None | Some U6 | Some S10 -> alu_tiny
| Some U27L5 | Some U27L10 -> alu_tiny_x
| _ -> raise InvalidEncoding)
- | Addd | Andd | Nandd | Ord | Nord | Sbfd | Xord | Nxord | Andnd | Ornd ->
+ | Addd | Andd | Nandd | Ord | Nord | Sbfd | Xord
+ | Nxord | Andnd | Ornd ->
(match encoding with None | Some U6 | Some S10 -> alu_tiny
| Some U27L5 | Some U27L10 -> alu_tiny_x
| Some E27U27L10 -> alu_tiny_y)
@@ -531,10 +552,10 @@ let rec_to_usage r =
| Some U27L5 | Some U27L10 -> alu_tiny_x
| Some E27U27L10 -> alu_tiny_y
| _ -> raise InvalidEncoding)
- | Mulw -> (match encoding with None -> mau
+ | Mulw| Maddw -> (match encoding with None -> mau
| Some U6 | Some S10 | Some U27L5 -> mau_x
| _ -> raise InvalidEncoding)
- | Muld -> (match encoding with None | Some U6 | Some S10 -> mau
+ | Muld | Maddd -> (match encoding with None | Some U6 | Some S10 -> mau
| Some U27L5 | Some U27L10 -> mau_x
| Some E27U27L10 -> mau_y)
| Nop -> alu_nop
@@ -567,7 +588,7 @@ let real_inst_to_latency = function
| Sxwd | Zxwd | Fcompw | Fcompd
-> 1
| Floatwz | Floatuwz | Fixeduwz | Fixedwz | Floatdz | Floatudz | Fixeddz | Fixedudz -> 4
- | Mulw | Muld -> 2 (* FIXME - WORST CASE. If it's S10 then it's only 1 *)
+ | Mulw | Muld | Maddw | Maddd -> 2 (* FIXME - WORST CASE. If it's S10 then it's only 1 *)
| Lbs | Lbz | Lhs | Lhz | Lws | Ld -> 3
| Sb | Sh | Sw | Sd -> 1 (* See k1c-Optimization.pdf page 19 *)
| Get -> 1