diff options
author | Léo Gourdin <leo.gourdin@univ-grenoble-alpes.fr> | 2021-04-09 15:15:57 +0200 |
---|---|---|
committer | Léo Gourdin <leo.gourdin@univ-grenoble-alpes.fr> | 2021-04-09 15:15:57 +0200 |
commit | 18312f0470cfb96e44ae1a26a24710cc1df3440d (patch) | |
tree | c1357af49873b291903741b59a2c39dc0ef47722 /riscV/Asmexpand.ml | |
parent | b7720bc5973e9890e7c320bb34b784e2e2b2da69 (diff) | |
download | compcert-kvx-18312f0470cfb96e44ae1a26a24710cc1df3440d.tar.gz compcert-kvx-18312f0470cfb96e44ae1a26a24710cc1df3440d.zip |
Removing expansions from Asmgen
Diffstat (limited to 'riscV/Asmexpand.ml')
-rw-r--r-- | riscV/Asmexpand.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/riscV/Asmexpand.ml b/riscV/Asmexpand.ml index c5cd6817..3f9d3359 100644 --- a/riscV/Asmexpand.ml +++ b/riscV/Asmexpand.ml @@ -23,6 +23,7 @@ open Asm open Asmexpandaux open AST open Camlcoq +open Asmgen open! Integers exception Error of string @@ -44,11 +45,13 @@ let align n a = (n + a - 1) land (-a) (* Emit instruction sequences that set or offset a register by a constant. *) let expand_loadimm32 dst n = - List.iter emit (Asmgen.loadimm32 dst n []) + match make_immed32 n with + | Imm32_single imm -> emit (Paddiw (dst, X0, imm)) + | Imm32_pair (hi, lo) -> List.iter emit (load_hilo32 dst hi lo []) let expand_addptrofs dst src n = - List.iter emit (Asmgen.addptrofs dst src n []) + List.iter emit (addptrofs dst src n []) let expand_storeind_ptr src base ofs = - List.iter emit (Asmgen.storeind_ptr src base ofs []) + List.iter emit (storeind_ptr src base ofs []) (* Built-ins. They come in two flavors: - annotation statements: take their arguments in registers or stack |