Commit d018b46e by Richard Henderson

arm: Convert thumb1 prologue to rtl.

	* config/arm/arm.c (arm_output_function_prologue): Don't call
	thumb1_output_function_prologue.
	(arm_expand_prologue): Avoid dead store.
	(number_of_first_bit_set): Use ctz_hwi.
	(thumb1_emit_multi_reg_push): New.
	(thumb1_expand_prologue): Merge thumb1_output_function_prologue
	to emit the entire prologue as rtl.
	(thumb1_output_interwork): Split out from
	thumb1_output_function_prologue.
	(thumb1_output_function_prologue): Remove.
	(arm_attr_length_push_multi): Handle thumb1.
	* config/arm/arm.md (VUNSPEC_THUMB1_INTERWORK): New.
	(prologue_thumb1_interwork): New.
	(*push_multi): Allow thumb1; use push_mult_memory_operand.
	* config/arm/predicates.md (push_mult_memory_operand): New.

From-SVN: r175605
parent 97269a23
2011-06-28 Richard Henderson <rth@redhat.com>
* config/arm/arm.c (arm_output_function_prologue): Don't call
thumb1_output_function_prologue.
(arm_expand_prologue): Avoid dead store.
(number_of_first_bit_set): Use ctz_hwi.
(thumb1_emit_multi_reg_push): New.
(thumb1_expand_prologue): Merge thumb1_output_function_prologue
to emit the entire prologue as rtl.
(thumb1_output_interwork): Split out from
thumb1_output_function_prologue.
(thumb1_output_function_prologue): Remove.
(arm_attr_length_push_multi): Handle thumb1.
* config/arm/arm.md (VUNSPEC_THUMB1_INTERWORK): New.
(prologue_thumb1_interwork): New.
(*push_multi): Allow thumb1; use push_mult_memory_operand.
* config/arm/predicates.md (push_mult_memory_operand): New.
2011-06-28 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sync.md (*stbar): Delete.
......@@ -863,7 +881,7 @@
2011-06-20 Changpeng Fang <changpeng.fang@amd.com>
PR i386/49089
PR i386/49089
* config/i386/i386.c (avx256_split_unaligned_load): New definition.
(avx256_split_unaligned_store): New definition.
(ix86_option_override_internal): Enable avx256 unaligned load/store
......
......@@ -176,6 +176,7 @@ extern void arm_init_expanders (void);
extern const char *thumb_unexpanded_epilogue (void);
extern void thumb1_expand_prologue (void);
extern void thumb1_expand_epilogue (void);
extern const char *thumb1_output_interwork (void);
#ifdef TREE_CODE
extern int is_called_in_ARM_mode (tree);
#endif
......
......@@ -116,6 +116,8 @@
; instruction epilogue sequence that isn't expanded
; into normal RTL. Used for both normal and sibcall
; epilogues.
VUNSPEC_THUMB1_INTERWORK ; `prologue_thumb1_interwork' insn, used to swap
; modes from arm to thumb.
VUNSPEC_ALIGN ; `align' insn. Used at the head of a minipool table
; for inlined constants.
VUNSPEC_POOL_END ; `end-of-table'. Used to mark the end of a minipool
......@@ -10121,6 +10123,13 @@
"
)
(define_insn "prologue_thumb1_interwork"
[(unspec_volatile [(const_int 0)] VUNSPEC_THUMB1_INTERWORK)]
"TARGET_THUMB1"
"* return thumb1_output_interwork ();"
[(set_attr "length" "8")]
)
;; Note - although unspec_volatile's USE all hard registers,
;; USEs are ignored after relaod has completed. Thus we need
;; to add an unspec of the link register to ensure that flow
......@@ -10365,10 +10374,10 @@
;; in a C function arm_attr_length_push_multi.
(define_insn "*push_multi"
[(match_parallel 2 "multi_register_push"
[(set (match_operand:BLK 0 "memory_operand" "=m")
[(set (match_operand:BLK 0 "push_mult_memory_operand" "")
(unspec:BLK [(match_operand:SI 1 "s_register_operand" "")]
UNSPEC_PUSH_MULT))])]
"TARGET_32BIT"
""
"*
{
int num_saves = XVECLEN (operands[2], 0);
......
......@@ -508,6 +508,34 @@
return true;
})
(define_predicate "push_mult_memory_operand"
(match_code "mem")
{
/* ??? Given how PUSH_MULT is generated in the prologues, is there
any point in testing for thumb1 specially? All of the variants
use the same form. */
if (TARGET_THUMB1)
{
/* ??? No attempt is made to represent STMIA, or validate that
the stack adjustment matches the register count. This is
true of the ARM/Thumb2 path as well. */
rtx x = XEXP (op, 0);
if (GET_CODE (x) != PRE_MODIFY)
return false;
if (XEXP (x, 0) != stack_pointer_rtx)
return false;
x = XEXP (x, 1);
if (GET_CODE (x) != PLUS)
return false;
if (XEXP (x, 0) != stack_pointer_rtx)
return false;
return CONST_INT_P (XEXP (x, 1));
}
/* ARM and Thumb2 handle pre-modify in their legitimate_address. */
return memory_operand (op, mode);
})
;;-------------------------------------------------------------------------
;;
;; Thumb predicates
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment