This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Avoid memory missmatches on i386


Hi,
the code promoting 8bit/16bit reads to 32bit can cause memory missmatch
faults on modern i386 chips.  This actually happens for SPEC version of
Mesa benchmark, so I think it is better to disable the optimization that
is only saving byte of prefix anyway.
I can measure 0x58% SPECfp speedup and no changes on SPECint side on K8.

Bootstrapping/regtesting in progress on i686-linux OK assuming it passes?
Honza
2005-12-04  Jan Hubicka  <jh@suse.cz>
	* config/i386/predicates.md (aligned_operand): Return 0 when memory
	missmatches are prohibited.
Index: config/i386/predicates.md
===================================================================
*** config/i386/predicates.md	(revision 107998)
--- config/i386/predicates.md	(working copy)
***************
*** 698,703 ****
--- 698,708 ----
    if (GET_CODE (op) != MEM)
      return 1;
  
+   /* All patterns using algined_operand on memory operands ends up
+      in promoting memory operand to 64bit and thus causing memory missmatch.  */
+   if (TARGET_MEMORY_MISMATCH_STALL && !optimize_size)
+     return 0;
+ 
    /* Don't even try to do any aligned optimizations with volatiles.  */
    if (MEM_VOLATILE_P (op))
      return 0;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]