From c3158661c6acd07df3deaa3ed2d0fc0fffb285b1 Mon Sep 17 00:00:00 2001 From: Sylvain Boulmé Date: Wed, 18 Nov 2020 10:04:52 +0100 Subject: fix the semantics ? --- aarch64/Asmblock.v | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'aarch64/Asmblock.v') 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) -- cgit