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]

[Xtensa] remove -m[no-]serialize-volatile options


The Xtensa ISA requires that MEMW instructions separate all volatile
memory references.  In some particular Xtensa systems, these MEMW
instructions could safely be omitted and GCC provided a switch to
disable them.  Over time, the conditions under which MEMW is not needed
are becoming more limited and hard to explain.  The performance overhead
of MEMW is low, so it is better to just emit them all the time (i.e.,
before every volatile memory reference).  This patch thus removes the
"-mserialize-volatile" and "-mno-serialize-volatile" options.  Tested
with the xtensa-elf target.  Committed on mainline.

2003-05-21  Bob Wilson  <bob.wilson@acm.org>

        * config/xtensa/xtensa.h (MASK_SERIALIZE_VOLATILE,
        TARGET_SERIALIZE_VOLATILE): Delete.
        (MASK_CONST16, MASK_ABS, MASK_ADDX): Renumber flag bits.
        (TARGET_DEFAULT): Remove MASK_SERIALIZE_VOLATILE.
        (TARGET_SWITCHES): Remove "-mserialize-volatile" and
        "-mno-serialize-volatile".
        * config/xtensa/xtensa.c (print_operand): Remove checks of
        TARGET_SERIALIZE_VOLATILE.
        * config/xtensa/xtensa.md (*lsiu, *ssiu): Likewise.
        * doc/invoke.texi (Option Summary, Xtensa Options): Remove
        "-mserialize-volatile" and "-mno-serialize-volatile" options.
Index: config/xtensa/xtensa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/xtensa.c,v
retrieving revision 1.33
diff -c -3 -r1.33 xtensa.c
*** config/xtensa/xtensa.c	14 May 2003 18:37:19 -0000	1.33
--- config/xtensa/xtensa.c	21 May 2003 18:06:46 -0000
***************
*** 1938,1944 ****
  	{
  	  /* For a volatile memory reference, emit a MEMW before the
  	     load or store.  */
! 	  if (MEM_VOLATILE_P (x) && TARGET_SERIALIZE_VOLATILE)
  	    fprintf (file, "memw\n\t");
  	}
        else
--- 1938,1944 ----
  	{
  	  /* For a volatile memory reference, emit a MEMW before the
  	     load or store.  */
! 	  if (MEM_VOLATILE_P (x))
  	    fprintf (file, "memw\n\t");
  	}
        else
Index: config/xtensa/xtensa.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/xtensa.h,v
retrieving revision 1.33
diff -c -3 -r1.33 xtensa.h
*** config/xtensa/xtensa.h	20 May 2003 23:39:09 -0000	1.33
--- config/xtensa/xtensa.h	21 May 2003 18:06:46 -0000
***************
*** 60,69 ****
  #define MASK_HARD_FLOAT_SQRT	0x00002000	/* floating-point sqrt */
  #define MASK_HARD_FLOAT_RSQRT	0x00004000	/* floating-point recip sqrt */
  #define MASK_NO_FUSED_MADD	0x00008000	/* avoid f-p mul/add */
! #define MASK_SERIALIZE_VOLATILE 0x00010000	/* serialize volatile refs */
! #define MASK_CONST16		0x00020000	/* use CONST16 instruction */
! #define MASK_ABS		0x00040000	/* use ABS instruction */
! #define MASK_ADDX		0x00080000	/* use ADDX* and SUBX* */
  
  /* Macros used in the machine description to test the flags.  */
  
--- 60,68 ----
  #define MASK_HARD_FLOAT_SQRT	0x00002000	/* floating-point sqrt */
  #define MASK_HARD_FLOAT_RSQRT	0x00004000	/* floating-point recip sqrt */
  #define MASK_NO_FUSED_MADD	0x00008000	/* avoid f-p mul/add */
! #define MASK_CONST16		0x00010000	/* use CONST16 instruction */
! #define MASK_ABS		0x00020000	/* use ABS instruction */
! #define MASK_ADDX		0x00040000	/* use ADDX* and SUBX* */
  
  /* Macros used in the machine description to test the flags.  */
  
***************
*** 83,89 ****
  #define TARGET_HARD_FLOAT_SQRT	(target_flags & MASK_HARD_FLOAT_SQRT)
  #define TARGET_HARD_FLOAT_RSQRT	(target_flags & MASK_HARD_FLOAT_RSQRT)
  #define TARGET_NO_FUSED_MADD	(target_flags & MASK_NO_FUSED_MADD)
- #define TARGET_SERIALIZE_VOLATILE (target_flags & MASK_SERIALIZE_VOLATILE)
  #define TARGET_CONST16		(target_flags & MASK_CONST16)
  #define TARGET_ABS		(target_flags & MASK_ABS)
  #define TARGET_ADDX		(target_flags & MASK_ADDX)
--- 82,87 ----
***************
*** 108,115 ****
    (XCHAL_HAVE_FP_DIV	? MASK_HARD_FLOAT_DIV : 0) |			\
    (XCHAL_HAVE_FP_RECIP	? MASK_HARD_FLOAT_RECIP : 0) |			\
    (XCHAL_HAVE_FP_SQRT	? MASK_HARD_FLOAT_SQRT : 0) |			\
!   (XCHAL_HAVE_FP_RSQRT	? MASK_HARD_FLOAT_RSQRT : 0) |			\
!   MASK_SERIALIZE_VOLATILE)
  
  /* Macro to define tables used to set the flags.  */
  
--- 106,112 ----
    (XCHAL_HAVE_FP_DIV	? MASK_HARD_FLOAT_DIV : 0) |			\
    (XCHAL_HAVE_FP_RECIP	? MASK_HARD_FLOAT_RECIP : 0) |			\
    (XCHAL_HAVE_FP_SQRT	? MASK_HARD_FLOAT_SQRT : 0) |			\
!   (XCHAL_HAVE_FP_RSQRT	? MASK_HARD_FLOAT_RSQRT : 0))
  
  /* Macro to define tables used to set the flags.  */
  
***************
*** 191,200 ****
      N_("Disable fused multiply/add and multiply/subtract FP instructions")}, \
    {"fused-madd",		-MASK_NO_FUSED_MADD,			\
      N_("Enable fused multiply/add and multiply/subtract FP instructions")}, \
-   {"serialize-volatile",	MASK_SERIALIZE_VOLATILE,		\
-     N_("Serialize volatile memory references with MEMW instructions")},	\
-   {"no-serialize-volatile",	-MASK_SERIALIZE_VOLATILE,		\
-     N_("Do not serialize volatile memory references with MEMW instructions")},\
    {"text-section-literals",	0,					\
      N_("Intersperse literal pools with code in the text section")},	\
    {"no-text-section-literals",	0,					\
--- 188,193 ----
Index: config/xtensa/xtensa.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/xtensa/xtensa.md,v
retrieving revision 1.12
diff -c -3 -r1.12 xtensa.md
*** config/xtensa/xtensa.md	20 May 2003 23:39:09 -0000	1.12
--- config/xtensa/xtensa.md	21 May 2003 18:06:46 -0000
***************
*** 1154,1160 ****
    "TARGET_HARD_FLOAT"
    "*
  {
!   if (TARGET_SERIALIZE_VOLATILE && volatile_refs_p (PATTERN (insn)))
      output_asm_insn (\"memw\", operands);
    return \"lsiu\\t%0, %1, %2\";
  }"
--- 1154,1160 ----
    "TARGET_HARD_FLOAT"
    "*
  {
!   if (volatile_refs_p (PATTERN (insn)))
      output_asm_insn (\"memw\", operands);
    return \"lsiu\\t%0, %1, %2\";
  }"
***************
*** 1171,1177 ****
    "TARGET_HARD_FLOAT"
    "*
  {
!   if (TARGET_SERIALIZE_VOLATILE && volatile_refs_p (PATTERN (insn)))
      output_asm_insn (\"memw\", operands);
    return \"ssiu\\t%2, %0, %1\";
  }"
--- 1171,1177 ----
    "TARGET_HARD_FLOAT"
    "*
  {
!   if (volatile_refs_p (PATTERN (insn)))
      output_asm_insn (\"memw\", operands);
    return \"ssiu\\t%2, %0, %1\";
  }"
Index: doc/invoke.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v
retrieving revision 1.282
diff -c -3 -r1.282 invoke.texi
*** doc/invoke.texi	21 May 2003 03:59:21 -0000	1.282
--- doc/invoke.texi	21 May 2003 18:06:47 -0000
***************
*** 646,652 ****
  -mbooleans  -mno-booleans @gol
  -mhard-float  -msoft-float @gol
  -mfused-madd  -mno-fused-madd @gol
- -mserialize-volatile  -mno-serialize-volatile @gol
  -mtext-section-literals  -mno-text-section-literals @gol
  -mtarget-align  -mno-target-align @gol
  -mlongcalls  -mno-longcalls}
--- 646,651 ----
***************
*** 10774,10788 ****
  add/subtract instructions also ensures that the program output is not
  sensitive to the compiler's ability to combine multiply and add/subtract
  operations.
- 
- @item -mserialize-volatile
- @itemx -mno-serialize-volatile
- @opindex mserialize-volatile
- @opindex mno-serialize-volatile
- When this option is enabled, GCC inserts @code{MEMW} instructions before
- @code{volatile} memory references to guarantee sequential consistency.
- The default is @option{-mserialize-volatile}.  Use
- @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
  
  @item -mtext-section-literals
  @itemx -mno-text-section-literals
--- 10773,10778 ----

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