aboutsummaryrefslogtreecommitdiffstats
path: root/aarch64/Asmblock.v
diff options
context:
space:
mode:
Diffstat (limited to 'aarch64/Asmblock.v')
-rw-r--r--aarch64/Asmblock.v10
1 files changed, 9 insertions, 1 deletions
diff --git a/aarch64/Asmblock.v b/aarch64/Asmblock.v
index 5da7e20a..3973abc0 100644
--- a/aarch64/Asmblock.v
+++ b/aarch64/Asmblock.v
@@ -754,6 +754,12 @@ Definition arith_eval_p (i : arith_p) : val :=
| Pfmovimmd f => Vfloat f
end.
+Definition destroy_X16 (i : arith_p) : bool :=
+ match i with
+ | Pfmovimms _ | Pfmovimmd _ => true (* TODO: we may refine this condition, according to the value of the immediate like in TargetPrinter *)
+ | _ => false
+ end.
+
Definition if_opt_bool_val (c: option bool) v1 v2: val :=
match c with
| Some true => v1
@@ -948,7 +954,9 @@ Definition arith_comparison_p_compare i :=
Definition exec_arith_instr (ai: ar_instruction) (rs: regset): regset :=
match ai with
- | PArithP i d => rs#d <- (arith_eval_p i)
+ | PArithP i d =>
+ let rs' := rs#d <- (arith_eval_p i) in
+ if destroy_X16 i then rs'#X16 <- Vundef else rs'
| PArithPP i d s => rs#d <- (arith_eval_pp i rs#s)
| PArithPPP i d s1 s2 => rs#d <- (arith_eval_ppp i rs#s1 rs#s2)