diff options
author | wehle <wehle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-15 16:29:10 +0000 |
---|---|---|
committer | wehle <wehle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-15 16:29:10 +0000 |
commit | 4f7a0ef9ba7500b0d742ce7dc4b5f2776efd4779 (patch) | |
tree | 713e561a36bcdd053f94987456ff3df498f0a3de /gcc/config | |
parent | 66fa2987d7a911136becef9006da422797d81e46 (diff) | |
download | ppe42-gcc-4f7a0ef9ba7500b0d742ce7dc4b5f2776efd4779.tar.gz ppe42-gcc-4f7a0ef9ba7500b0d742ce7dc4b5f2776efd4779.zip |
* i960.h (i960_maxbitalignment,
i960_last_maxbitalignment): Declare.
* i960.c (i960_maxbitalignment,
i960_last_maxbitalignment): Make global.
(process_pragma): Delete.
(i960_pr_align, i960_pr_noalign): Move from here ...
* i960-c.c: ... to this new file.
* t-960bare (i960-c.o): New rule.
* t-vxworks960 (i960-c.o): Likewise.
* config.gcc (i960-*-*): Define c_target_objs and
cxx_target_objs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40502 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/i960/i960-c.c | 116 | ||||
-rw-r--r-- | gcc/config/i960/i960.c | 133 | ||||
-rw-r--r-- | gcc/config/i960/i960.h | 4 | ||||
-rw-r--r-- | gcc/config/i960/t-960bare | 3 | ||||
-rw-r--r-- | gcc/config/i960/t-vxworks960 | 3 |
5 files changed, 128 insertions, 131 deletions
diff --git a/gcc/config/i960/i960-c.c b/gcc/config/i960/i960-c.c new file mode 100644 index 00000000000..66ff29cfcaf --- /dev/null +++ b/gcc/config/i960/i960-c.c @@ -0,0 +1,116 @@ +/* Intel 80960 specific, C compiler specific functions. + Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. + Contributed by Steven McGeady, Intel Corp. + Additional Work by Glenn Colon-Bonet, Jonathan Shapiro, Andy Wilson + Converted to GCC 2.0 by Jim Wilson and Michael Tiemann, Cygnus Support. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include "config.h" +#include "system.h" +#include "cpplib.h" +#include "tree.h" +#include "c-pragma.h" +#include "c-lex.h" +#include "toplev.h" +#include "ggc.h" +#include "tm_p.h" + +/* Handle pragmas for compatibility with Intel's compilers. */ + +/* NOTE: ic960 R3.0 pragma align definition: + + #pragma align [(size)] | (identifier=size[,...]) + #pragma noalign [(identifier)[,...]] + + (all parens are optional) + + - size is [1,2,4,8,16] + - noalign means size==1 + - applies only to component elements of a struct (and union?) + - identifier applies to structure tag (only) + - missing identifier means next struct + + - alignment rules for bitfields need more investigation. + + This implementation only handles the case of no identifiers. */ + +void +i960_pr_align (pfile) + cpp_reader *pfile ATTRIBUTE_UNUSED; +{ + tree number; + enum cpp_ttype type; + int align; + + type = c_lex (&number); + if (type == CPP_OPEN_PAREN) + type = c_lex (&number); + if (type == CPP_NAME) + { + warning ("sorry, not implemented: #pragma align NAME=SIZE"); + return; + } + if (type != CPP_NUMBER) + { + warning ("malformed #pragma align - ignored"); + return; + } + + align = TREE_INT_CST_LOW (number); + switch (align) + { + case 0: + /* Return to last alignment. */ + align = i960_last_maxbitalignment / 8; + /* Fall through. */ + case 16: + case 8: + case 4: + case 2: + case 1: + i960_last_maxbitalignment = i960_maxbitalignment; + i960_maxbitalignment = align * 8; + break; + + default: + /* Silently ignore bad values. */ + break; + } +} + +void +i960_pr_noalign (pfile) + cpp_reader *pfile ATTRIBUTE_UNUSED; +{ + enum cpp_ttype type; + tree number; + + type = c_lex (&number); + if (type == CPP_OPEN_PAREN) + type = c_lex (&number); + if (type == CPP_NAME) + { + warning ("sorry, not implemented: #pragma noalign NAME"); + return; + } + + i960_last_maxbitalignment = i960_maxbitalignment; + i960_maxbitalignment = 8; +} diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c index 1f885fe68b1..c56f2f7bb54 100644 --- a/gcc/config/i960/i960.c +++ b/gcc/config/i960/i960.c @@ -55,8 +55,8 @@ rtx i960_compare_op0, i960_compare_op1; /* Used to implement #pragma align/noalign. Initialized by OVERRIDE_OPTIONS macro in i960.h. */ -static int i960_maxbitalignment; -static int i960_last_maxbitalignment; +int i960_maxbitalignment; +int i960_last_maxbitalignment; /* Used to implement switching between MEM and ALU insn types, for better C series performance. */ @@ -89,135 +89,6 @@ static int ret_label = 0; && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (FNDECL)))) != void_type_node)) \ || current_function_varargs) -/* Handle pragmas for compatibility with Intel's compilers. */ - -/* NOTE: ic960 R3.0 pragma align definition: - - #pragma align [(size)] | (identifier=size[,...]) - #pragma noalign [(identifier)[,...]] - - (all parens are optional) - - - size is [1,2,4,8,16] - - noalign means size==1 - - applies only to component elements of a struct (and union?) - - identifier applies to structure tag (only) - - missing identifier means next struct - - - alignment rules for bitfields need more investigation. - - This implementation only handles the case of no identifiers. */ - -void -i960_pr_align (pfile) - cpp_reader *pfile ATTRIBUTE_UNUSED; -{ - tree number; - enum cpp_ttype type; - int align; - - type = c_lex (&number); - if (type == CPP_OPEN_PAREN) - type = c_lex (&number); - if (type == CPP_NAME) - { - warning ("sorry, not implemented: #pragma align NAME=SIZE"); - return; - } - if (type != CPP_NUMBER) - { - warning ("malformed #pragma align - ignored"); - return; - } - - align = TREE_INT_CST_LOW (number); - switch (align) - { - case 0: - /* Return to last alignment. */ - align = i960_last_maxbitalignment / 8; - /* Fall through. */ - case 16: - case 8: - case 4: - case 2: - case 1: - i960_last_maxbitalignment = i960_maxbitalignment; - i960_maxbitalignment = align * 8; - break; - - default: - /* Silently ignore bad values. */ - break; - } -} - -void -i960_pr_noalign (pfile) - cpp_reader *pfile ATTRIBUTE_UNUSED; -{ - enum cpp_ttype type; - tree number; - - type = c_lex (&number); - if (type == CPP_OPEN_PAREN) - type = c_lex (&number); - if (type == CPP_NAME) - { - warning ("sorry, not implemented: #pragma noalign NAME"); - return; - } - - i960_last_maxbitalignment = i960_maxbitalignment; - i960_maxbitalignment = 8; -} - -int -process_pragma (p_getc, p_ungetc, pname) - int (* p_getc) PARAMS ((void)); - void (* p_ungetc) PARAMS ((int)); - const char *pname; -{ - register int c; - char buf[20]; - char *s = buf; - int align; - - /* Should be pragma 'far' or equivalent for callx/balx here. */ - if (strcmp (pname, "align") != 0) - return 0; - - do - { - c = p_getc (); - } - while (c == ' ' || c == '\t'); - - if (c == '(') - c = p_getc (); - - while (c >= '0' && c <= '9') - { - if (s < buf + sizeof buf - 1) - *s++ = c; - c = p_getc (); - } - - *s = '\0'; - - /* We had to read a non-numerical character to get out of the - while loop---often a newline. So, we have to put it back to - make sure we continue to parse everything properly. */ - - p_ungetc (c); - - align = atoi (buf); - - - - return 1; -} - /* Initialize variables before compiling any files. */ void diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h index 4c85e95d8e8..40480bf178c 100644 --- a/gcc/config/i960/i960.h +++ b/gcc/config/i960/i960.h @@ -131,6 +131,10 @@ Boston, MA 02111-1307, USA. */ fprintf (asm_out_file, "\t.type\t0x%x;", A) /* Handle pragmas for compatibility with Intel's compilers. */ + +extern int i960_maxbitalignment; +extern int i960_last_maxbitalignment; + #define REGISTER_TARGET_PRAGMAS(PFILE) do { \ cpp_register_pragma (PFILE, 0, "align", i960_pr_align); \ cpp_register_pragma (PFILE, 0, "noalign", i960_pr_noalign); \ diff --git a/gcc/config/i960/t-960bare b/gcc/config/i960/t-960bare index 5c6b8274bb6..17c99a1cef2 100644 --- a/gcc/config/i960/t-960bare +++ b/gcc/config/i960/t-960bare @@ -21,6 +21,9 @@ xp-bit.c: $(srcdir)/config/fp-bit.c echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c cat $(srcdir)/config/fp-bit.c >> xp-bit.c +i960-c.o: $(srcdir)/config/i960/i960-c.c + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< + MULTILIB_OPTIONS=mnumerics/msoft-float mlong-double-64 MULTILIB_DIRNAMES=float soft-float ld64 MULTILIB_MATCHES=mnumerics=msb mnumerics=msc mnumerics=mkb mnumerics=mkc mnumerics=mmc mnumerics=mcb mnumerics=mcc mnumerics=mjf msoft-float=msa msoft-float=mka msoft-float=mca msoft-float=mcf diff --git a/gcc/config/i960/t-vxworks960 b/gcc/config/i960/t-vxworks960 index 43949fa4f84..7878591764b 100644 --- a/gcc/config/i960/t-vxworks960 +++ b/gcc/config/i960/t-vxworks960 @@ -24,6 +24,9 @@ xp-bit.c: $(srcdir)/config/fp-bit.c echo '#define EXTENDED_FLOAT_STUBS' > xp-bit.c cat $(srcdir)/config/fp-bit.c >> xp-bit.c +i960-c.o: $(srcdir)/config/i960/i960-c.c + $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< + MULTILIB_OPTIONS=mnumerics/msoft-float mlong-double-64 MULTILIB_DIRNAMES=float soft-float ld64 MULTILIB_MATCHES=mnumerics=msb mnumerics=msc mnumerics=mkb mnumerics=mkc mnumerics=mmc mnumerics=mcb mnumerics=mcc msoft-float=msa msoft-float=mka msoft-float=mca msoft-float=mcf |