diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2017-06-16 11:53:28 +0200 |
---|---|---|
committer | Bernhard Schommer <bschommer@users.noreply.github.com> | 2017-07-06 15:41:51 +0200 |
commit | 2ff53c2361773f28027ccc8332e1830686d5bbc6 (patch) | |
tree | 2c0b1dc7201bd3618859cc5dc2257dbf07e996de /riscV/Asmexpand.ml | |
parent | dff22ef6d855973e0e0f05c7203a6bfa9a4cf01a (diff) | |
download | compcert-2ff53c2361773f28027ccc8332e1830686d5bbc6.tar.gz compcert-2ff53c2361773f28027ccc8332e1830686d5bbc6.zip |
Extend builtin arguments with a pointer addition operator, continued
- Add support for PowerPC, with all addressing modes.
- Add support for ARM, with "reg + ofs" addressing mode.
- Add support for RISC-V, with the one addressing mode.
- Constprop.v: forgot to recurse in BA_addptr
- volatile4 test: more tests
Diffstat (limited to 'riscV/Asmexpand.ml')
-rw-r--r-- | riscV/Asmexpand.ml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/riscV/Asmexpand.ml b/riscV/Asmexpand.ml index 02e573fc..d42f4d13 100644 --- a/riscV/Asmexpand.ml +++ b/riscV/Asmexpand.ml @@ -251,6 +251,13 @@ let expand_builtin_vload chunk args res = expand_addptrofs X31 X2 ofs; (* X31 <- sp + ofs *) expand_builtin_vload_common chunk X31 _0 res end + | [BA_addptr(BA(IR addr), (BA_int ofs | BA_long ofs))] -> + if offset_in_range (Z.add ofs (Memdata.size_chunk chunk)) then + expand_builtin_vload_common chunk addr ofs res + else begin + expand_addptrofs X31 addr ofs; (* X31 <- addr + ofs *) + expand_builtin_vload_common chunk X31 _0 res + end | _ -> assert false @@ -286,6 +293,13 @@ let expand_builtin_vstore chunk args = expand_addptrofs X31 X2 ofs; (* X31 <- sp + ofs *) expand_builtin_vstore_common chunk X31 _0 src end + | [BA_addptr(BA(IR addr), (BA_int ofs | BA_long ofs)); src] -> + if offset_in_range (Z.add ofs (Memdata.size_chunk chunk)) then + expand_builtin_vstore_common chunk addr ofs src + else begin + expand_addptrofs X31 addr ofs; (* X31 <- addr + ofs *) + expand_builtin_vstore_common chunk X31 _0 src + end | _ -> assert false |