aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/PostpassSchedulingOracle.ml
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2019-01-18 11:36:47 +0100
committerCyril SIX <cyril.six@kalray.eu>2019-01-18 11:37:23 +0100
commit2fd1d6bc76a49116251b7d7fed2e4db93b9570d4 (patch)
treede310e263c33a2cbd2e2dfb5d815a12fb211cfc1 /mppa_k1c/PostpassSchedulingOracle.ml
parent12c160bd4d10b008d0e53382c1f452bc3b05336e (diff)
downloadcompcert-kvx-2fd1d6bc76a49116251b7d7fed2e4db93b9570d4.tar.gz
compcert-kvx-2fd1d6bc76a49116251b7d7fed2e4db93b9570d4.zip
Minor bug in encode_imm
Diffstat (limited to 'mppa_k1c/PostpassSchedulingOracle.ml')
-rw-r--r--mppa_k1c/PostpassSchedulingOracle.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/mppa_k1c/PostpassSchedulingOracle.ml b/mppa_k1c/PostpassSchedulingOracle.ml
index 19d4d962..a3851373 100644
--- a/mppa_k1c/PostpassSchedulingOracle.ml
+++ b/mppa_k1c/PostpassSchedulingOracle.ml
@@ -219,9 +219,9 @@ let signed_length i =
let encode_imm imm =
let i = Int64.to_int imm
in let length = signed_length i
- in if length <= 6 then U6
+ in if length <= 7 then U6 (* Unsigned -> 1 bit less needed *)
else if length <= 10 then S10
- else if length <= 32 then U27L5
+ else if length <= 32 then U27L5 (* Upper 27 Lower 5 is signed *)
else if length <= 37 then U27L10
else if length <= 64 then E27U27L10
else failwith @@ sprintf "encode_imm: integer too big! (%d)" i