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]

powerpc cleanup and TARGET_RELOCATABLE fix


2002-02-26  David Edelsohn  <edelsohn@gnu.org>

        * config/rs6000/aix43.h (THREAD_MODEL_SPEC): Delete.
        * config/rs6000/aix51.h (THREAD_MODEL_SPEC): Delete.
        * config/rs6000/rs6000.c (rs6000_return_addr): Use efficient
        method on AIX.
        * config/rs6000/rs6000.md (movsi_low): Use gpc_reg_operand.
        (movsi_low_st, movdf_low, movdf_low_st, movsf_low, movsf_low_st):
        * Same.
        (load_toc_v4_PIC_2): Same.

2002-02-26  Alan Modra  <amodra@bigpond.net.au>

        * config/rs6000/rs6000.md (load_toc_aix_di): Handle TARGET_RELOCATABLE.

Index: aix43.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix43.h,v
retrieving revision 1.21
diff -c -p -r1.21 aix43.h
*** aix43.h	2001/12/09 07:23:05	1.21
--- aix43.h	2002/02/27 05:37:28
*************** do {									\
*** 199,208 ****
         %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
         %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
  
- /* Since there are separate multilibs for pthreads, determine the
-    thread model based on the command-line arguments.  */
- #define THREAD_MODEL_SPEC "%{pthread:posix}%{!pthread:single}"
- 
  /* AIX 4.3 typedefs ptrdiff_t as "long" while earlier releases used "int".  */
  
  #undef PTRDIFF_TYPE
--- 199,204 ----
Index: aix51.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/aix51.h,v
retrieving revision 1.8
diff -c -p -r1.8 aix51.h
*** aix51.h	2001/12/09 07:23:05	1.8
--- aix51.h	2002/02/27 05:37:28
*************** do {									\
*** 202,211 ****
         %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
         %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
  
- /* Since there are separate multilibs for pthreads, determine the
-    thread model based on the command-line arguments.  */
- #define THREAD_MODEL_SPEC "%{pthread:posix}%{!pthread:single}"
- 
  /* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int".  */
  
  #undef PTRDIFF_TYPE
--- 202,207 ----
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.291
diff -c -p -r1.291 rs6000.c
*** rs6000.c	2002/02/25 02:30:32	1.291
--- rs6000.c	2002/02/27 05:37:28
*************** rs6000_return_addr (count, frame)
*** 8056,8065 ****
    /* Currently we don't optimize very well between prolog and body
       code and for PIC code the code can be actually quite bad, so
       don't try to be too clever here.  */
!   if (count != 0
!       || flag_pic != 0
!       || DEFAULT_ABI == ABI_AIX
!       || DEFAULT_ABI == ABI_AIX_NODESC)
      {
        cfun->machine->ra_needs_full_frame = 1;
  
--- 8056,8062 ----
    /* Currently we don't optimize very well between prolog and body
       code and for PIC code the code can be actually quite bad, so
       don't try to be too clever here.  */
!   if (count != 0 || flag_pic != 0)
      {
        cfun->machine->ra_needs_full_frame = 1;
  
Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.172
diff -c -p -r1.172 rs6000.md
*** rs6000.md	2002/02/26 06:50:25	1.172
--- rs6000.md	2002/02/27 05:37:29
***************
*** 7573,7579 ****
  
  (define_insn "movsi_low"
    [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
!         (mem:SI (lo_sum:SI (match_operand:SI 1 "register_operand" "b")
                             (match_operand 2 "" ""))))]
    "TARGET_MACHO && ! TARGET_64BIT"
    "{l|lwz} %0,lo16(%2)(%1)"
--- 7573,7579 ----
  
  (define_insn "movsi_low"
    [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
!         (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
                             (match_operand 2 "" ""))))]
    "TARGET_MACHO && ! TARGET_64BIT"
    "{l|lwz} %0,lo16(%2)(%1)"
***************
*** 7581,7587 ****
     (set_attr "length" "4")])
  
  (define_insn "movsi_low_st"
!   [(set (mem:SI (lo_sum:SI (match_operand:SI 1 "register_operand" "b")
                             (match_operand 2 "" "")))
  	(match_operand:SI 0 "gpc_reg_operand" "r"))]
    "TARGET_MACHO && ! TARGET_64BIT"
--- 7581,7587 ----
     (set_attr "length" "4")])
  
  (define_insn "movsi_low_st"
!   [(set (mem:SI (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
                             (match_operand 2 "" "")))
  	(match_operand:SI 0 "gpc_reg_operand" "r"))]
    "TARGET_MACHO && ! TARGET_64BIT"
***************
*** 7591,7597 ****
  
  (define_insn "movdf_low"
    [(set (match_operand:DF 0 "gpc_reg_operand" "=f,!r")
!         (mem:DF (lo_sum:SI (match_operand:SI 1 "register_operand" "b,b")
                             (match_operand 2 "" ""))))]
    "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
    "*
--- 7591,7597 ----
  
  (define_insn "movdf_low"
    [(set (match_operand:DF 0 "gpc_reg_operand" "=f,!r")
!         (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
                             (match_operand 2 "" ""))))]
    "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
    "*
***************
*** 7621,7627 ****
     (set_attr "length" "4,12")])
  
  (define_insn "movdf_low_st"
!   [(set (mem:DF (lo_sum:SI (match_operand:SI 1 "register_operand" "b")
                             (match_operand 2 "" "")))
  	(match_operand:DF 0 "gpc_reg_operand" "f"))]
    "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
--- 7621,7627 ----
     (set_attr "length" "4,12")])
  
  (define_insn "movdf_low_st"
!   [(set (mem:DF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
                             (match_operand 2 "" "")))
  	(match_operand:DF 0 "gpc_reg_operand" "f"))]
    "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
***************
*** 7631,7637 ****
  
  (define_insn "movsf_low"
    [(set (match_operand:SF 0 "gpc_reg_operand" "=f,!r")
!         (mem:SF (lo_sum:SI (match_operand:SI 1 "register_operand" "b,b")
                             (match_operand 2 "" ""))))]
    "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
    "@
--- 7631,7637 ----
  
  (define_insn "movsf_low"
    [(set (match_operand:SF 0 "gpc_reg_operand" "=f,!r")
!         (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
                             (match_operand 2 "" ""))))]
    "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
    "@
***************
*** 7641,7647 ****
     (set_attr "length" "4")])
  
  (define_insn "movsf_low_st"
!   [(set (mem:SF (lo_sum:SI (match_operand:SI 1 "register_operand" "b,b")
                             (match_operand 2 "" "")))
  	(match_operand:SF 0 "gpc_reg_operand" "f,!r"))]
    "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
--- 7641,7647 ----
     (set_attr "length" "4")])
  
  (define_insn "movsf_low_st"
!   [(set (mem:SF (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b,b")
                             (match_operand 2 "" "")))
  	(match_operand:SF 0 "gpc_reg_operand" "f,!r"))]
    "TARGET_MACHO && TARGET_HARD_FLOAT && ! TARGET_64BIT"
***************
*** 9566,9572 ****
--- 9566,9577 ----
    "*
  {
    char buf[30];
+ #ifdef TARGET_RELOCATABLE
+   ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\",
+ 			       !TARGET_MINIMAL_TOC || TARGET_RELOCATABLE);
+ #else
    ASM_GENERATE_INTERNAL_LABEL (buf, \"LCTOC\", 1);
+ #endif
    if (TARGET_ELF)
      strcat (buf, \"@toc\");
    operands[1] = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
***************
*** 9602,9609 ****
     (set_attr "length" "8")])
  
  (define_insn "load_toc_v4_PIC_2"
!   [(set (match_operand:SI 0 "register_operand" "=r")
! 	(mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r")
  		   (minus:SI (match_operand:SI 2 "immediate_operand" "s")
  			     (match_operand:SI 3 "immediate_operand" "s")))))]
    "TARGET_ELF && flag_pic == 2"
--- 9607,9614 ----
     (set_attr "length" "8")])
  
  (define_insn "load_toc_v4_PIC_2"
!   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
! 	(mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "r")
  		   (minus:SI (match_operand:SI 2 "immediate_operand" "s")
  			     (match_operand:SI 3 "immediate_operand" "s")))))]
    "TARGET_ELF && flag_pic == 2"


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