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 /arm/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 'arm/Asmexpand.ml')
-rw-r--r-- | arm/Asmexpand.ml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arm/Asmexpand.ml b/arm/Asmexpand.ml index 8761e666..a32b0e8b 100644 --- a/arm/Asmexpand.ml +++ b/arm/Asmexpand.ml @@ -215,6 +215,13 @@ let expand_builtin_vload chunk args res = | [BA_addrglobal(id, ofs)] -> emit (Ploadsymbol (IR14,id,ofs)); expand_builtin_vload_common chunk IR14 _0 res + | [BA_addptr(BA(IR addr), BA_int ofs)] -> + if offset_in_range (Int.add ofs (Memdata.size_chunk chunk)) then + expand_builtin_vload_common chunk addr ofs res + else begin + expand_addimm IR14 addr ofs; + expand_builtin_vload_common chunk IR14 _0 res + end | _ -> assert false @@ -252,6 +259,13 @@ let expand_builtin_vstore chunk args = | [BA_addrglobal(id, ofs); src] -> emit (Ploadsymbol (IR14,id,ofs)); expand_builtin_vstore_common chunk IR14 _0 src + | [BA_addptr(BA(IR addr), BA_int ofs); src] -> + if offset_in_range (Int.add ofs (Memdata.size_chunk chunk)) then + expand_builtin_vstore_common chunk addr ofs src + else begin + expand_addimm IR14 addr ofs; + expand_builtin_vstore_common chunk IR14 _0 src + end | _ -> assert false |