aboutsummaryrefslogtreecommitdiffstats
path: root/riscV/Asm.v
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2018-09-12 14:32:01 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2018-09-12 14:32:01 +0200
commit591073be98300e1c07527af45c7c4ce8dff5bc39 (patch)
tree1f5143b8405b4d33a6133a7210839dab1e6eaad6 /riscV/Asm.v
parent25ba7367a0d9391a4bea2d7685b8cfe8e304e2f8 (diff)
downloadcompcert-kvx-591073be98300e1c07527af45c7c4ce8dff5bc39.tar.gz
compcert-kvx-591073be98300e1c07527af45c7c4ce8dff5bc39.zip
Generate a nop instruction after some ais annotations (#137)
* Generate a nop instruction after ais annotations. In order to prevent the merging of ais annotations with following Labels a nop instruction is inserted, but only if the annotation is followed immediately by a label. The insertion of nop instructions is performed during the expansion of builtin and pseudo assembler instructions and is processor independent, by inserting a __builtin_nop built-in. * Add Pnop instruction to ARM, RISC-V, and x86 ARM as well as RISC-V don't have nop instructions that can be easily encoded by for example add with zero instructions. For x86 we used to use `mov X0, X0` for nop but this may not be as efficient as the true nop instruction. * Implement __builtin_nop on all supported target architectures. This builtin is not yet made available on the C side for all architectures. Bug 24067
Diffstat (limited to 'riscV/Asm.v')
-rw-r--r--riscV/Asm.v4
1 files changed, 3 insertions, 1 deletions
diff --git a/riscV/Asm.v b/riscV/Asm.v
index 6d223c1d..1d8fda11 100644
--- a/riscV/Asm.v
+++ b/riscV/Asm.v
@@ -344,7 +344,8 @@ Inductive instruction : Type :=
| Ploadsi (rd: freg) (f: float32) (**r load an immediate single *)
| Pbtbl (r: ireg) (tbl: list label) (**r N-way branch through a jump table *)
| Pbuiltin: external_function -> list (builtin_arg preg)
- -> builtin_res preg -> instruction. (**r built-in function (pseudo) *)
+ -> builtin_res preg -> instruction (**r built-in function (pseudo) *)
+ | Pnop : instruction. (**r nop instruction *)
(** The pseudo-instructions are the following:
@@ -985,6 +986,7 @@ Definition exec_instr (f: function) (i: instruction) (rs: regset) (m: mem) : out
| Pfmsubd _ _ _ _
| Pfnmaddd _ _ _ _
| Pfnmsubd _ _ _ _
+ | Pnop
=> Stuck
end.