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]

[PATCH] PowerPC eabi.asm 64-bit support


	64-bit PowerPC needs the FPR save and restore helper functions.
It seems most convenient to place them in eabi.asm along with the 32-bit
definitions given that t-ppccomm already has the infrastructure to insert
it properly in libgcc.a.

	Any objections to the following patch?

Thanks, David


Index: ginclude/ppc-asm.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ginclude/ppc-asm.h,v
retrieving revision 1.3
diff -c -p -r1.3 ppc-asm.h
*** ppc-asm.h	2000/02/06 03:14:46	1.3
--- ppc-asm.h	2001/08/10 03:17:23
*************** GLUE(..,name):
*** 156,161 ****
--- 156,179 ----
  GLUE(.L,name): \
  	.size GLUE(..,name),GLUE(.L,name)-GLUE(..,name)
  
+ #elif defined (__powerpc64__)
+ #define FUNC_NAME(name) GLUE(.,name)
+ #define FUNC_START(name) \
+ 	.section ".opd","aw"; \
+ name: \
+ 	.quad GLUE(.,name); \
+ 	.quad .TOC.@tocbase; \
+ 	.quad 0; \
+ 	.previous; \
+ 	.type GLUE(.,name),@function; \
+ 	.globl name; \
+ 	.globl GLUE(.,name); \
+ GLUE(.,name):
+ 
+ #define FUNC_END(name) \
+ GLUE(.L,name): \
+ 	.size GLUE(.,name),GLUE(.L,name)-GLUE(.,name)
+ 
  #else
  #define FUNC_NAME(name) GLUE(__USER_LABEL_PREFIX__,name)
  #define FUNC_START(name) \
Index: config/rs6000/eabi.asm
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/eabi.asm,v
retrieving revision 1.6
diff -c -p -r1.6 eabi.asm
*** eabi.asm	2000/04/14 23:16:25	1.6
--- eabi.asm	2001/08/10 03:17:23
***************
*** 1,8 ****
  /*
!  * special support for eabi
   *
!  *   Copyright (C) 1995, 1996, 1998, 2000 Free Software Foundation, Inc.
   *   Written By Michael Meissner
   * 
   * This file is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License as published by the
--- 1,9 ----
  /*
!  * Special support for eabi and SVR4
   *
!  *   Copyright (C) 1995, 1996, 1998, 2000, 2001 Free Software Foundation, Inc.
   *   Written By Michael Meissner
+  *   64-bit support written by David Edelsohn
   * 
   * This file is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License as published by the
***************
*** 40,45 ****
--- 41,48 ----
  	.section ".text"
  	#include "ppc-asm.h"
  
+ #ifndef __powerpc64__
+ 
  	 .section ".got2","aw"
  	.align	2
  .LCTOC1 = . /* +32768 */
*************** FUNC_END(_restgpr_17_x)
*** 554,556 ****
--- 557,664 ----
  FUNC_END(_restgpr_16_x)
  FUNC_END(_restgpr_15_x)
  FUNC_END(_restgpr_14_x)
+ 
+ #else /* __powerpc64__ */
+ 
+ 	.text
+ 	.align 2
+ 
+ /* Routines for saving floating point registers, called by the compiler. */
+ 
+ fsav:
+ FUNC_START(_savef14)	stfd	14,-144(1)	/* save fp registers */
+ FUNC_START(_savef15)	stfd	15,-136(1)
+ FUNC_START(_savef16)	stfd	16,-128(1)
+ FUNC_START(_savef17)	stfd	17,-120(1)
+ FUNC_START(_savef18)	stfd	18,-112(1)
+ FUNC_START(_savef19)	stfd	19,-104(1)
+ FUNC_START(_savef20)	stfd	20,-96(1)
+ FUNC_START(_savef21)	stfd	21,-88(1)
+ FUNC_START(_savef22)	stfd	22,-80(1)
+ FUNC_START(_savef23)	stfd	23,-72(1)
+ FUNC_START(_savef24)	stfd	24,-64(1)
+ FUNC_START(_savef25)	stfd	25,-56(1)
+ FUNC_START(_savef26)	stfd	26,-48(1)
+ FUNC_START(_savef27)	stfd	27,-40(1)
+ FUNC_START(_savef28)	stfd	28,-32(1)
+ FUNC_START(_savef29)	stfd	29,-24(1)
+ FUNC_START(_savef30)	stfd	30,-16(1)
+ FUNC_START(_savef31)	stfd	31,-8(1)
+ 			blr
+ .LTfsav:
+ 			.long 0
+ 			.byte 0,12,0,0,0,0,0,0
+ 			.long 0
+ 			.long .LTfsav-.fsav
+ 			.short 4
+ 			.ascii "fsav"
+ 			.byte 0
+ FUNC_END(_savef31)
+ FUNC_END(_savef30)
+ FUNC_END(_savef29)
+ FUNC_END(_savef28)
+ FUNC_END(_savef27)
+ FUNC_END(_savef26)
+ FUNC_END(_savef25)
+ FUNC_END(_savef24)
+ FUNC_END(_savef23)
+ FUNC_END(_savef22)
+ FUNC_END(_savef21)
+ FUNC_END(_savef20)
+ FUNC_END(_savef19)
+ FUNC_END(_savef18)
+ FUNC_END(_savef17)
+ FUNC_END(_savef16)
+ FUNC_END(_savef15)
+ FUNC_END(_savef14)
+ 
+ /* Routines for restoring floating point registers, called by the compiler. */
+ 
+ fres:
+ FUNC_START(_restf14)	lfd	14,-144(1)	/* restore fp registers */
+ FUNC_START(_restf15)	lfd	15,-136(1)
+ FUNC_START(_restf16)	lfd	16,-128(1)
+ FUNC_START(_restf17)	lfd	17,-120(1)
+ FUNC_START(_restf18)	lfd	18,-112(1)
+ FUNC_START(_restf19)	lfd	19,-104(1)
+ FUNC_START(_restf20)	lfd	20,-96(1)
+ FUNC_START(_restf21)	lfd	21,-88(1)
+ FUNC_START(_restf22)	lfd	22,-80(1)
+ FUNC_START(_restf23)	lfd	23,-72(1)
+ FUNC_START(_restf24)	lfd	24,-64(1)
+ FUNC_START(_restf25)	lfd	25,-56(1)
+ FUNC_START(_restf26)	lfd	26,-48(1)
+ FUNC_START(_restf27)	lfd	27,-40(1)
+ FUNC_START(_restf28)	lfd	28,-32(1)
+ FUNC_START(_restf29)	lfd	29,-24(1)
+ FUNC_START(_restf30)	lfd	30,-16(1)
+ FUNC_START(_restf31)	lfd	31,-8(1)
+ 			blr
+ .LTfres:
+ 			.long 0
+ 			.byte 0,12,0,0,0,0,0,0
+ 			.long 0
+ 			.long .LTfres-.fres
+ 			.short 4
+ 			.ascii "fres"
+ 			.byte 0
+ FUNC_END(_restf31)
+ FUNC_END(_restf30)
+ FUNC_END(_restf29)
+ FUNC_END(_restf28)
+ FUNC_END(_restf27)
+ FUNC_END(_restf26)
+ FUNC_END(_restf25)
+ FUNC_END(_restf24)
+ FUNC_END(_restf23)
+ FUNC_END(_restf22)
+ FUNC_END(_restf21)
+ FUNC_END(_restf20)
+ FUNC_END(_restf19)
+ FUNC_END(_restf18)
+ FUNC_END(_restf17)
+ FUNC_END(_restf16)
+ FUNC_END(_restf15)
+ FUNC_END(_restf14)
+ 
+ #endif


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