@@ -591,14 +591,33 @@ let translate_arm_instruction
591591 rvar :: rsvar :: acc
592592 | _ -> acc) [] ops in
593593
594- let get_use_high_vars (xprs : xpr_t list ): variable_t list =
594+ let get_use_high_vars ?( is_pop = false ) (xprs : xpr_t list ): variable_t list =
595595 let inv = floc#inv in
596596 List. fold_left (fun acc x ->
597597 let xw = inv#rewrite_expr x in
598598 let xs = simplify_xpr xw in
599+ let disvars = inv#get_init_disequalities in
600+ let is_disvar v = List. exists (fun vv -> v#equal vv) disvars in
601+ let xprvars = floc#env#variables_in_expr xs in
599602 let vars =
600- List. filter (fun v -> not (floc#f#env#is_function_initial_value v))
601- (floc#env#variables_in_expr xs) in
603+ if List. exists is_disvar xprvars && not is_pop then
604+ let _ =
605+ chlog#add
606+ " get_use_high_vars:basic"
607+ (LBLOCK [
608+ floc#l#toPretty;
609+ STR " " ;
610+ x2p xs;
611+ STR " ==> " ;
612+ x2p x;
613+ pretty_print_list
614+ (floc#env#variables_in_expr x)
615+ (fun v -> v#toPretty)
616+ " [" " ; " " ]" ]) in
617+ floc#env#variables_in_expr x
618+ else
619+ List. filter (fun v -> not (floc#f#env#is_function_initial_value v))
620+ xprvars in
602621 vars @ acc) [] xprs in
603622
604623 let get_addr_use_high_vars (xprs : xpr_t list ): variable_t list =
@@ -1618,7 +1637,9 @@ let translate_arm_instruction
16181637 let usevars = get_register_vars [rn; rm] in
16191638 let memvar = mem#to_variable floc in
16201639 let (usevars, usehigh) =
1621- if memvar#isTmp || floc#f#env#is_unknown_memory_variable memvar then
1640+ if memvar#isTmp
1641+ || floc#f#env#is_unknown_memory_variable memvar
1642+ || floc#f#env#has_variable_index_offset memvar then
16221643 (* elevate address variables to high-use *)
16231644 let xrn = rn#to_expr floc in
16241645 let xrm = rm#to_expr floc in
@@ -2144,7 +2165,7 @@ let translate_arm_instruction
21442165 let stackvar = stackop#to_variable floc in
21452166 let stackrhs = stackop#to_expr floc in
21462167 let (regvar, cmds1) = floc#get_ssa_assign_commands reg stackrhs in
2147- let usehigh = get_use_high_vars [stackrhs] in
2168+ let usehigh = get_use_high_vars ~is_pop: true [stackrhs] in
21482169 let defcmds1 =
21492170 floc#get_vardef_commands
21502171 ~defs: [regvar; splhs]
@@ -2589,6 +2610,44 @@ let translate_arm_instruction
25892610 | ACCAlways -> default cmds
25902611 | _ -> make_conditional_commands c cmds)
25912612
2613+ | SignedMultiplyWordB (c , rd , rn , rm ) ->
2614+ let floc = get_floc loc in
2615+ let rdreg = rd#to_register in
2616+ let (vrd, cmds) = floc#get_ssa_abstract_commands rdreg () in
2617+ let xrn = rn#to_expr floc in
2618+ let xrm = rm#to_expr floc in
2619+ let usevars = get_register_vars [rn; rm] in
2620+ let usehigh = get_use_high_vars [xrn; xrm] in
2621+ let defcmds =
2622+ floc#get_vardef_commands
2623+ ~defs: [vrd]
2624+ ~use: usevars
2625+ ~usehigh: usehigh
2626+ ctxtiaddr in
2627+ let cmds = defcmds @ cmds in
2628+ (match c with
2629+ | ACCAlways -> default cmds
2630+ | _ -> make_conditional_commands c cmds)
2631+
2632+ | SignedMultiplyWordT (c , rd , rn , rm ) ->
2633+ let floc = get_floc loc in
2634+ let rdreg = rd#to_register in
2635+ let (vrd, cmds) = floc#get_ssa_abstract_commands rdreg () in
2636+ let xrn = rn#to_expr floc in
2637+ let xrm = rm#to_expr floc in
2638+ let usevars = get_register_vars [rn; rm] in
2639+ let usehigh = get_use_high_vars [xrn; xrm] in
2640+ let defcmds =
2641+ floc#get_vardef_commands
2642+ ~defs: [vrd]
2643+ ~use: usevars
2644+ ~usehigh: usehigh
2645+ ctxtiaddr in
2646+ let cmds = defcmds @ cmds in
2647+ (match c with
2648+ | ACCAlways -> default cmds
2649+ | _ -> make_conditional_commands c cmds)
2650+
25922651 (* ---------------------------------------- StoreMultipleIncrementAfter --
25932652 * Stores multiple registers to consecutive memoy locations using an address
25942653 * from a base register. The consecutive memory locations start at this
0 commit comments