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]

Patch for PR 20819 (IA64 enhancement request for -mlong-calls)


PR 20819 is an enhancement request to implement the -mlong-calls option
that many other platforms have and to have it generate brl.call
instructions instead of br.call instructions on IA64.  This patch does
that, it was tested on IA64 HP-UX and Linux with no regressions and I
did some additional testing to make sure that it actually generated brl
instructions when the option is used.

OK for checkin?

Steve Ellcey
sje@cup.hp.com



2005-06-03  Steve Ellcey  <sje@cup.hp.com>

	doc/invoke.texi: Document -mlong-calls flag for IA64
	config/ia64/ia64.opt (-mlong-calls): Add
	config/ia64/ia64.h (PRINT_OPERAND_PUNCT_VALID_P): Add '*'
	config/ia64/ia64.c (ia64_print_operand): Ditto.
	config/ia64/ia64.md (call_nogp): Use %*
	(call_value_nogp): Ditto.

*** gcc.orig/gcc/doc/invoke.texi	Fri Jun  3 09:56:29 2005
--- gcc/gcc/doc/invoke.texi	Fri Jun  3 09:55:49 2005
*************** Objective-C and Objective-C++ Dialects}.
*** 526,532 ****
  -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
  -mno-dwarf2-asm -mearly-stop-bits @gol
  -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
! -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64}
  
  @emph{M32R/D Options}
  @gccoptlist{-m32r2 -m32rx -m32r @gol
--- 526,532 ----
  -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
  -mno-dwarf2-asm -mearly-stop-bits @gol
  -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
! -mtune=@var{cpu-type} -mt -pthread -milp32 -mlp64 -mlong-calls}
  
  @emph{M32R/D Options}
  @gccoptlist{-m32r2 -m32rx -m32r @gol
*************** Generate code for a 32-bit or 64-bit env
*** 9268,9273 ****
--- 9268,9281 ----
  The 32-bit environment sets int, long and pointer to 32 bits.
  The 64-bit environment sets int to 32 bits and long and pointer
  to 64 bits.  These are HP-UX specific flags.
+ 
+ @item -mlong-calls
+ @itemx -mno-long-calls
+ @opindex mlong-calls
+ @opindex mno-long-calls
+ Generate (or don't) brl.call instead of br.call. This is needed if
+ the target function is outside the br.call addressing range. The default is
+ @option{-mno-long-calls}.
  
  @end table
  
*** gcc.orig/gcc/config/ia64/ia64.opt	Fri Jun  3 09:41:05 2005
--- gcc/gcc/config/ia64/ia64.opt	Fri Jun  3 09:40:35 2005
*************** mtune=
*** 96,98 ****
--- 96,102 ----
  Target RejectNegative Joined
  Schedule code for given CPU
  
+ mlong-calls
+ Target Report Mask(LONG_CALLS)
+ Generate brl.call instead of br.call
+ 
*** gcc.orig/gcc/config/ia64/ia64.h	Fri Jun  3 09:40:57 2005
--- gcc/gcc/config/ia64/ia64.h	Fri Jun  3 09:40:30 2005
*************** do {									\
*** 1754,1760 ****
  /* ??? Keep this around for now, as we might need it later.  */
  
  #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
!   ((CODE) == '+' || (CODE) == ',')
  
  /* A C compound statement to output to stdio stream STREAM the assembler syntax
     for an instruction operand that is a memory reference whose address is X.  X
--- 1754,1760 ----
  /* ??? Keep this around for now, as we might need it later.  */
  
  #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
!   ((CODE) == '+' || (CODE) == ',' || (CODE) == '*')
  
  /* A C compound statement to output to stdio stream STREAM the assembler syntax
     for an instruction operand that is a memory reference whose address is X.  X
*** gcc.orig/gcc/config/ia64/ia64.c	Fri Jun  3 09:40:52 2005
--- gcc/gcc/config/ia64/ia64.c	Fri Jun  3 09:40:29 2005
*************** ia64_print_operand (FILE * file, rtx x, 
*** 4399,4404 ****
--- 4399,4409 ----
  	}
        return;
  
+     case '*':
+       if (TARGET_LONG_CALLS)
+ 	fputs("l", file);
+       return;
+ 
      default:
        output_operand_lossage ("ia64_print_operand: unknown code");
        return;
*** gcc.orig/gcc/config/ia64/ia64.md	Fri Jun  3 09:41:00 2005
--- gcc/gcc/config/ia64/ia64.md	Fri Jun  3 09:40:32 2005
***************
*** 5455,5461 ****
  	 (const_int 0))
     (clobber (match_operand:DI 1 "register_operand" "=b,b"))]
    ""
!   "br.call%+.many %1 = %0"
    [(set_attr "itanium_class" "br,scall")])
  
  (define_insn "call_value_nogp"
--- 5455,5461 ----
  	 (const_int 0))
     (clobber (match_operand:DI 1 "register_operand" "=b,b"))]
    ""
!   "br%*.call%+.many %1 = %0"
    [(set_attr "itanium_class" "br,scall")])
  
  (define_insn "call_value_nogp"
***************
*** 5464,5470 ****
  	      (const_int 0)))
     (clobber (match_operand:DI 2 "register_operand" "=b,b"))]
    ""
!   "br.call%+.many %2 = %1"
    [(set_attr "itanium_class" "br,scall")])
  
  (define_insn "sibcall_nogp"
--- 5464,5470 ----
  	      (const_int 0)))
     (clobber (match_operand:DI 2 "register_operand" "=b,b"))]
    ""
!   "br%*.call%+.many %2 = %1"
    [(set_attr "itanium_class" "br,scall")])
  
  (define_insn "sibcall_nogp"


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