@@ -6802,16 +6802,24 @@ get_probe_interval (void)
6802
6802
6803
6803
#define SPLIT_STACK_AVAILABLE 256
6804
6804
6805
- /* Helper function to determine whether push2/pop2 can be used in prologue or
6806
- epilogue for register save/restore. */
6805
+ /* Return true if push2/pop2 can be generated. */
6806
+
6807
6807
static bool
6808
- ix86_pro_and_epilogue_can_use_push2pop2 (int nregs )
6808
+ ix86_can_use_push2pop2 (void )
6809
6809
{
6810
6810
/* Use push2/pop2 only if the incoming stack is 16-byte aligned. */
6811
6811
unsigned int incoming_stack_boundary
6812
6812
= (crtl->parm_stack_boundary > ix86_incoming_stack_boundary
6813
6813
? crtl->parm_stack_boundary : ix86_incoming_stack_boundary);
6814
- if (incoming_stack_boundary % 128 != 0)
6814
+ return incoming_stack_boundary % 128 == 0;
6815
+ }
6816
+
6817
+ /* Helper function to determine whether push2/pop2 can be used in prologue or
6818
+ epilogue for register save/restore. */
6819
+ static bool
6820
+ ix86_pro_and_epilogue_can_use_push2pop2 (int nregs)
6821
+ {
6822
+ if (!ix86_can_use_push2pop2 ())
6815
6823
return false;
6816
6824
int aligned = cfun->machine->fs.sp_offset % 16 == 0;
6817
6825
return TARGET_APX_PUSH2POP2
@@ -7401,7 +7409,9 @@ ix86_emit_save_regs (void)
7401
7409
int regno;
7402
7410
rtx_insn *insn;
7403
7411
7404
- if (!TARGET_APX_PUSH2POP2 || cfun->machine->func_type != TYPE_NORMAL)
7412
+ if (!TARGET_APX_PUSH2POP2
7413
+ || !ix86_can_use_push2pop2 ()
7414
+ || cfun->machine->func_type != TYPE_NORMAL)
7405
7415
{
7406
7416
for (regno = FIRST_PSEUDO_REGISTER - 1; regno >= 0; regno--)
7407
7417
if (GENERAL_REGNO_P (regno) && ix86_save_reg (regno, true, true))
@@ -10039,7 +10049,9 @@ ix86_expand_epilogue (int style)
10039
10049
m->fs.cfa_reg == stack_pointer_rtx);
10040
10050
}
10041
10051
10042
- if (TARGET_APX_PUSH2POP2 && m->func_type == TYPE_NORMAL)
10052
+ if (TARGET_APX_PUSH2POP2
10053
+ && ix86_can_use_push2pop2 ()
10054
+ && m->func_type == TYPE_NORMAL)
10043
10055
ix86_emit_restore_regs_using_pop2 ();
10044
10056
else
10045
10057
ix86_emit_restore_regs_using_pop (TARGET_APX_PPX);
0 commit comments