aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-05-23 01:44:05 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-05-22 21:44:05 -0400
commit941cc05afd83b2a1af44a98d7c6598c947ea6a3d (patch)
tree77a4dc76d082a4cc5b7802cec5c706d80b7e7a20 /gcc
parent421844e7209277ce775c5b635a5cc76906df94e9 (diff)
downloadgcc-941cc05afd83b2a1af44a98d7c6598c947ea6a3d.zip
gcc-941cc05afd83b2a1af44a98d7c6598c947ea6a3d.tar.gz
gcc-941cc05afd83b2a1af44a98d7c6598c947ea6a3d.tar.bz2
alpha.c (alpha_fnname): New static variable.
* config/alpha/alpha.c (alpha_fnname): New static variable. (print_operand, case '~'): New case. (alpha_expand_prologue): Emit prologue_ldgp insn if needed. (alpha_start_function): Set alpha_fnname. Write "ng" label if no ldgp; don't write ldgp insn. * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): New case '~'. * config/alpha/alpha.md (prologue_ldgp): New define_insn. From-SVN: r34097
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/alpha/alpha.c41
-rw-r--r--gcc/config/alpha/alpha.h9
-rw-r--r--gcc/config/alpha/alpha.md11
4 files changed, 52 insertions, 19 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b9b10ca..ab84d24 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+Mon May 22 21:49:00 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/alpha/alpha.c (alpha_fnname): New static variable.
+ (print_operand, case '~'): New case.
+ (alpha_expand_prologue): Emit prologue_ldgp insn if needed.
+ (alpha_start_function): Set alpha_fnname.
+ Write "ng" label if no ldgp; don't write ldgp insn.
+ * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): New case '~'.
+ * config/alpha/alpha.md (prologue_ldgp): New define_insn.
+
Mon May 22 11:30:48 2000 Clinton Popetz <cpopetz@cygnus.com>
* jump.c (jump_optimize_1): Don't increment LABEL_NUSES
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index f7030d1..483ae69 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -97,6 +97,10 @@ static int alpha_function_needs_gp;
static int alpha_sr_alias_set;
+/* The assembler name of the current function. */
+
+static const char *alpha_fnname;
+
/* Declarations of static functions. */
static void alpha_set_memflags_1
PARAMS ((rtx, int, int, int));
@@ -3243,6 +3247,11 @@ print_operand (file, x, code)
switch (code)
{
+ case '~':
+ /* Print the assembler name of the current function. */
+ assemble_name (file, alpha_fnname);
+ break;
+
case '&':
/* Generates fp-rounding mode suffix: nothing for normal, 'c' for
chopped, 'm' for minus-infinity, and 'd' for dynamic rounding
@@ -4144,6 +4153,14 @@ alpha_expand_prologue ()
alpha_sa_mask (&imask, &fmask);
+ /* Emit an insn to reload GP, if needed. */
+ if (!TARGET_OPEN_VMS && !TARGET_WINDOWS_NT)
+ {
+ alpha_function_needs_gp = alpha_does_function_need_gp ();
+ if (alpha_function_needs_gp)
+ emit_insn (gen_prologue_ldgp ());
+ }
+
/* Adjust the stack by the frame size. If the frame size is > 4096
bytes, we need to be sure we probe somewhere in the first and last
4096 bytes (we can probably get away without the latter test) and
@@ -4369,6 +4386,7 @@ alpha_start_function (file, fnname, decl)
char *entry_label = (char *) alloca (strlen (fnname) + 6);
int i;
+ alpha_fnname = fnname;
sa_size = alpha_sa_size ();
frame_size = get_frame_size ();
@@ -4413,6 +4431,15 @@ alpha_start_function (file, fnname, decl)
fputs ("\t.ent ", file);
assemble_name (file, fnname);
putc ('\n', file);
+
+ /* If the function needs GP, we'll write the "..ng" label there.
+ Otherwise, do it here. */
+ if (! alpha_function_needs_gp)
+ {
+ putc ('$', file);
+ assemble_name (file, fnname);
+ fputs ("..ng:\n", file);
+ }
}
strcpy (entry_label, fnname);
@@ -4494,20 +4521,6 @@ alpha_start_function (file, fnname, decl)
}
}
- /* Emit GP related things. It is rather unfortunate about the alignment
- issues surrounding a CODE_LABEL that forces us to do the label in
- plain text. */
- if (!TARGET_OPEN_VMS && !TARGET_WINDOWS_NT)
- {
- alpha_function_needs_gp = alpha_does_function_need_gp ();
- if (alpha_function_needs_gp)
- fputs ("\tldgp $29,0($27)\n", file);
-
- putc ('$', file);
- assemble_name (file, fnname);
- fputs ("..ng:\n", file);
- }
-
#ifdef OPEN_VMS
/* Ifdef'ed cause readonly_section and link_section are only
available then. */
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index 31ad3bb..2d9be06 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -2270,9 +2270,9 @@ do { \
#define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE)
/* Determine which codes are valid without a following integer. These must
- not be alphabetic (the characters are chosen so that
- PRINT_OPERAND_PUNCT_VALID_P translates into a simple range change when
- using ASCII).
+ not be alphabetic.
+
+ ~ Generates the name of the current function.
& Generates fp-rounding mode suffix: nothing for normal, 'c' for
chopped, 'm' for minus-infinity, and 'd' for dynamic rounding
@@ -2304,7 +2304,8 @@ do { \
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
((CODE) == '&' || (CODE) == '`' || (CODE) == '\'' || (CODE) == '(' \
- || (CODE) == ')' || (CODE) == '+' || (CODE) == ',' || (CODE) == '-')
+ || (CODE) == ')' || (CODE) == '+' || (CODE) == ',' || (CODE) == '-' \
+ || (CODE) == '~')
/* Print a memory address as an operand to reference that memory location. */
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 5b9dd8e..835ffee 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -5487,7 +5487,16 @@
(define_expand "prologue"
[(clobber (const_int 0))]
""
- "alpha_expand_prologue (); DONE;")
+ "
+{
+ alpha_expand_prologue ();
+ DONE;
+}")
+
+(define_insn "prologue_ldgp"
+ [(unspec_volatile [(const_int 0)] 9)]
+ ""
+ "ldgp $29,0($27)\\n$%~..ng:")
(define_insn "init_fp"
[(set (match_operand:DI 0 "register_operand" "=r")