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]

[MIPS] Fix handling of big .cprestore offsets (2/2)


This patch fixes the second of the problems exposed by t023:
we get an assembler warning if we try to use a multi-instruction:

        .cprestore      32768+

in a .set nomacro block.

Tested as before, applied to mainline.

Richard


	* config/mips/mips.md (cprestore): Provide two alternatives, one for
	an in-range offset and one for an out-of-range offset.  Wrap the latter
	in .set macro/.set nomacro if it's inside a .set nomacro block.

Index: config/mips/mips.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mips/mips.md,v
retrieving revision 1.262
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.262 mips.md
*** config/mips/mips.md	19 Jul 2004 17:28:48 -0000	1.262
--- config/mips/mips.md	1 Aug 2004 06:15:43 -0000
*************** (define_insn "loadgp_blockage"
*** 4787,4802 ****
     (set_attr "mode"	"none")
     (set_attr "length"	"0")])
  
! ;; Emit a .cprestore directive, which expands to a single store instruction.
! ;; Note that we continue to use .cprestore for explicit reloc code so that
! ;; jals inside inlines asms will work correctly.
  (define_insn "cprestore"
!   [(unspec_volatile [(match_operand 0 "const_int_operand" "")]
  		    UNSPEC_CPRESTORE)]
    ""
!   ".cprestore\t%0"
    [(set_attr "type" "store")
!    (set_attr "length" "4")])
  
  ;; Block moves, see mips.c for more details.
  ;; Argument 0 is the destination
--- 4787,4807 ----
     (set_attr "mode"	"none")
     (set_attr "length"	"0")])
  
! ;; Emit a .cprestore directive, which normally expands to a single store
! ;; instruction.  Note that we continue to use .cprestore for explicit reloc
! ;; code so that jals inside inline asms will work correctly.
  (define_insn "cprestore"
!   [(unspec_volatile [(match_operand 0 "const_int_operand" "I,i")]
  		    UNSPEC_CPRESTORE)]
    ""
! {
!   if (set_nomacro && which_alternative == 1)
!     return ".set\tmacro\;.cprestore\t%0\;.set\tnomacro";
!   else
!     return ".cprestore\t%0";
! }
    [(set_attr "type" "store")
!    (set_attr "length" "4,12")])
  
  ;; Block moves, see mips.c for more details.
  ;; Argument 0 is the destination


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