+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
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)
{
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)
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
-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
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
--- /dev/null
+/* 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" } } */
--- /dev/null
+/* 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" } } */