Commit d95016e0 by Nathan Froyd Committed by Nathan Froyd

rs6000.opt (mblock-move-inline-limit): New option.

gcc/
	* config/rs6000/rs6000.opt (mblock-move-inline-limit): New option.
	* config/rs6000/rs6000.c (rs6000_override_options): Set
	rs6000_block_move_inline_limit appropriately.
	(expand_block_move): Use rs6000_block_move_inline_limit.
	* doc/invoke.texi (mblock-move-inline-limit): Document.

gcc/testsuite/
	* gcc.target/powerpc/block-move-1.c: New test.
	* gcc.target/powerpc/block-move-2.c: New test.

From-SVN: r162344
parent a397bb72
2010-07-20 Nathan Froyd <froydnj@codesourcery.com>
* config/rs6000/rs6000.opt (mblock-move-inline-limit): New option.
* config/rs6000/rs6000.c (rs6000_override_options): Set
rs6000_block_move_inline_limit appropriately.
(expand_block_move): Use rs6000_block_move_inline_limit.
* doc/invoke.texi (mblock-move-inline-limit): Document.
2010-07-20 Bernd Schmidt <bernds@codesourcery.com>
* postreload.c (fixup_debug_insns): Remove arg REGNO. New args
......
......@@ -2696,6 +2696,18 @@ rs6000_override_options (const char *default_cpu)
else if (TARGET_ALTIVEC)
target_flags |= (MASK_PPC_GFXOPT & ~target_flags_explicit);
/* E500mc does "better" if we inline more aggressively. Respect the
user's opinion, though. */
if (rs6000_block_move_inline_limit == 0
&& (rs6000_cpu == PROCESSOR_PPCE500MC
|| rs6000_cpu == PROCESSOR_PPCE500MC64))
rs6000_block_move_inline_limit = 128;
/* store_one_arg depends on expand_block_move to handle at least the
size of reg_parm_stack_space. */
if (rs6000_block_move_inline_limit < (TARGET_POWERPC64 ? 64 : 32))
rs6000_block_move_inline_limit = (TARGET_POWERPC64 ? 64 : 32);
/* Set debug flags */
if (rs6000_debug_name)
{
......@@ -13208,9 +13220,7 @@ expand_block_move (rtx operands[])
if (bytes <= 0)
return 1;
/* store_one_arg depends on expand_block_move to handle at least the size of
reg_parm_stack_space. */
if (bytes > (TARGET_POWERPC64 ? 64 : 32))
if (bytes > rs6000_block_move_inline_limit)
return 0;
for (offset = 0; bytes > 0; offset += move_bytes, bytes -= move_bytes)
......
......@@ -245,6 +245,10 @@ mvrsave=
Target RejectNegative Joined
-mvrsave=yes/no Deprecated option. Use -mvrsave/-mno-vrsave instead
mblock-move-inline-limit=
Target Report Var(rs6000_block_move_inline_limit) Init(0) RejectNegative Joined UInteger
Specify how many bytes should be moved inline before calling out to memcpy/memmove
misel
Target Report Mask(ISEL)
Generate isel instructions
......
......@@ -772,6 +772,7 @@ See RS/6000 and PowerPC Options.
-mcall-sysv -mcall-netbsd @gol
-maix-struct-return -msvr4-struct-return @gol
-mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
-mblock-move-inline-limit=@var{num} @gol
-misel -mno-isel @gol
-misel=yes -misel=no @gol
-mspe -mno-spe @gol
......@@ -15626,6 +15627,13 @@ On embedded PowerPC systems, put all initialized global and static data
in the @samp{.data} section, and all uninitialized data in the
@samp{.bss} section.
@item -mblock-move-inline-limit=@var{num}
@opindex mblock-move-inline-limit
Inline all block moves (such as calls to @code{memcpy} or structure
copies) less than or equal to @var{num} bytes. The minimum value for
@var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
targets. The default value is target-specific.
@item -G @var{num}
@opindex G
@cindex smaller data references (PowerPC)
......
2010-07-20 Nathan Froyd <froydnj@codesourcery.com>
* gcc.target/powerpc/block-move-1.c: New test.
* gcc.target/powerpc/block-move-2.c: New test.
2010-07-20 Jason Merrill <jason@redhat.com>
PR c++/44967
......
/* Test that we bump up low values of -mblock-move-inline-limit */
/* { dg-do compile } */
/* { dg-options "-O2 -mblock-move-inline-limit=8" } */
typedef __SIZE_TYPE__ size_t;
extern void *memcpy (void *, const void *, size_t);
void
cpy16 (void *x, void *y)
{
memcpy (x, y, 16);
}
/* { dg-final { scan-assembler-not "memcpy" } } */
/* Test that we honor -mblock-move-inline-limit. */
/* { dg-do compile } */
/* { dg-options "-O2 -mblock-move-inline-limit=128" } */
typedef __SIZE_TYPE__ size_t;
extern void *memcpy (void *, const void *, size_t);
void
cpy128 (void *x, void *y)
{
memcpy (x, y, 128);
}
/* { dg-final { scan-assembler-not "memcpy" } } */
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