diff --git a/compiler/src/compile.ml b/compiler/src/compile.ml index 264d7062b..2bd3fa965 100644 --- a/compiler/src/compile.ml +++ b/compiler/src/compile.ml @@ -191,11 +191,14 @@ let compile (type reg regx xreg rflag cond asm_op extra_op) then Some (UseLea, "LEA instruction is used") else None | Split_memory_access -> - let msg = - "This memory immediate does not fit in one instruction, several \ - instructions were issued." - in - Some (SplitMemoryAccess, msg) + if not !Glob_options.split_memory_access + then + let msg = + "This memory immediate does not fit in one instruction, several \ + instructions were issued." + in + Some (SplitMemoryAccess, msg) + else None in let loc, _ = ii in Option.may (fun (w, msg) -> warning w loc "%s" msg) o; diff --git a/compiler/src/glob_options.ml b/compiler/src/glob_options.ml index 19698ea11..1d045b4c9 100644 --- a/compiler/src/glob_options.ml +++ b/compiler/src/glob_options.ml @@ -25,6 +25,7 @@ type color = | Auto | Always | Never let color = ref Auto let lea = ref false +let split_memory_access = ref false let set0 = ref false let model = ref Normal let print_stack_alloc = ref false @@ -175,6 +176,9 @@ let options = [ "-I" , Arg.String set_idirs , "[ident:path] Bind ident to path for from ident require ..."; "-lea" , Arg.Set lea , " Use lea as much as possible (default is nolea)"; "-nolea" , Arg.Clear lea , " Try to use add and mul instead of lea"; + "-split-memory-access" + , Arg.Set split_memory_access + , " Split large memory accesses in several instructions"; "-set0" , Arg.Set set0 , " Use [xor x x] to set x to 0 (default is not)"; "-noset0" , Arg.Clear set0 , " Do not use set0 option"; "-ec" , Arg.String set_ec , "[f] Extract function [f] and its dependencies to an easycrypt file (deprecated)";