From d0319112f1fc01b648542e66eb1597ac7b14e49c Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 21 Aug 2015 11:55:28 +0200 Subject: Fix bugs in Asmexpand.ml for ARM. --- arm/Asmexpand.ml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'arm/Asmexpand.ml') diff --git a/arm/Asmexpand.ml b/arm/Asmexpand.ml index b4508ace..907d3199 100644 --- a/arm/Asmexpand.ml +++ b/arm/Asmexpand.ml @@ -168,7 +168,7 @@ let expand_builtin_vload chunk args res = let expand_builtin_vload_global chunk id ofs args res = emit (Ploadsymbol (IR14,id,ofs)); - expand_builtin_vload_common chunk args res + expand_builtin_vload_common chunk (IR IR14 :: args) res let expand_builtin_vstore_common chunk args = match chunk, args with @@ -180,11 +180,11 @@ let expand_builtin_vstore_common chunk args = emit (Pstr (src,addr, SOimm _0)) | Mint64, [IR addr; IR src1; IR src2] -> emit (Pstr (src2,addr,SOimm _0)); - emit (Pstr (src1,addr,SOimm _0)) + emit (Pstr (src1,addr,SOimm _4)) | Mfloat32, [IR addr; FR src] -> - emit (Pfstd (src,addr,_0)) + emit (Pfsts (src,addr,_0)) | Mfloat64, [IR addr; FR src] -> - emit (Pfsts (src,addr,_0)); + emit (Pfstd (src,addr,_0)); | _ -> assert false @@ -193,7 +193,7 @@ let expand_builtin_vstore chunk args = let expand_builtin_vstore_global chunk id ofs args = emit (Ploadsymbol (IR14,id,ofs)); - expand_builtin_vstore_common chunk args + expand_builtin_vstore_common chunk (IR IR14 :: args) (* Handling of varargs *) @@ -269,10 +269,10 @@ let expand_builtin_inline name args res = | "__builtin_read32_reversed", [IR a1], [IR res] -> emit (Pldr (res,a1,SOimm _0)); emit (Prev (IR res,IR res)); - | "__builtin_write16_reverse", [IR a1; IR a2], _ -> + | "__builtin_write16_reversed", [IR a1; IR a2], _ -> emit (Prev16 (IR IR14, IR a2)); emit (Pstrh (IR14, a1, SOimm _0)) - | "__builtin_write32_reverse", [IR a1; IR a2], _ -> + | "__builtin_write32_reversed", [IR a1; IR a2], _ -> emit (Prev (IR IR14, IR a2)); emit (Pstr (IR14, a1, SOimm _0)) (* Synchronization *) @@ -301,7 +301,8 @@ let expand_instruction instr = end; expand_subimm IR13 IR13 sz; emit (Pcfi_adjust sz); - emit (Pstr (IR12,IR13,SOimm ofs)) + emit (Pstr (IR12,IR13,SOimm ofs)); + PrintAsmaux.current_function_stacksize := camlint_of_coqint sz | Pfreeframe (sz, ofs) -> let sz = if (!current_function).fn_sig.sig_cc.cc_vararg -- cgit