aboutsummaryrefslogtreecommitdiffstats
path: root/arm/AsmToJSON.ml
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 /arm/AsmToJSON.ml
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 'arm/AsmToJSON.ml')
-rw-r--r--arm/AsmToJSON.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/arm/AsmToJSON.ml b/arm/AsmToJSON.ml
index 276ceecc..3874e141 100644
--- a/arm/AsmToJSON.ml
+++ b/arm/AsmToJSON.ml
@@ -30,7 +30,7 @@ let mnemonic_names = [ "Padc"; "Padd"; "Padds"; "Pand";"Pannot"; "Pasr"; "Pb"; "
"Pftouizs"; "Pfuitod"; "Pfuitos"; "Pinlineasm"; "Pisb"; "Plabel"; "Pldr";
"Ploadsymbol_lbl"; "Pldr_p"; "Pldrb"; "Pldrb_p"; "Pldrh"; "Pldrh_p"; "Pldrsb";
"Pldrsh"; "Plsl"; "Plsr"; "Pmla"; "Pmov"; "Pmovite";
- "Pmovt"; "Pmovw"; "Pmul"; "Pmvn"; "Ploadsymbol_imm"; "Porr";
+ "Pmovt"; "Pmovw"; "Pmul"; "Pmvn"; "Ploadsymbol_imm"; "Pnop"; "Porr";
"Ppush"; "Prev"; "Prev16"; "Prsb"; "Prsbs"; "Prsc"; "Psbc"; "Psbfx"; "Psdiv"; "Psmull";
"Pstr"; "Pstr_p"; "Pstrb"; "Pstrb_p"; "Pstrh"; "Pstrh_p"; "Psub"; "Psubs"; "Pudiv";
"Pumull" ]
@@ -263,6 +263,7 @@ let pp_instructions pp ic =
| Pmovw(r1, n) -> instruction pp "Pmovw" [Ireg r1; Long n]
| Pmul(r1, r2, r3) -> instruction pp "Pmul" [Ireg r1; Ireg r2; Ireg r3]
| Pmvn(r1, so) -> instruction pp "Pmvn" [Ireg r1; Shift so]
+ | Pnop -> instruction pp "Pnop" []
| Porr(r1, r2, so) -> instruction pp "Porr" [Ireg r1; Ireg r2; Shift so]
| Ppush(rl) -> instruction pp "Ppush" (List.map (fun r -> Ireg r) rl)
| Prev(r1, r2) -> instruction pp "Prev" [Ireg r1; Ireg r2]