ptx4-i.h revision 90075
150397Sobrien/* Target definitions for GNU compiler for Intel 80386 running Dynix/ptx v4
250397Sobrien   Copyright (C) 1996 Free Software Foundation, Inc.
350397Sobrien
450397Sobrien   Modified from sysv4.h
550397Sobrien   Originally written by Ron Guilmette (rfg@netcom.com).
650397Sobrien   Modified by Tim Wright (timw@sequent.com).
750397Sobrien
850397SobrienThis file is part of GNU CC.
950397Sobrien
1050397SobrienGNU CC is free software; you can redistribute it and/or modify
1150397Sobrienit under the terms of the GNU General Public License as published by
1250397Sobrienthe Free Software Foundation; either version 2, or (at your option)
1350397Sobrienany later version.
1450397Sobrien
1550397SobrienGNU CC is distributed in the hope that it will be useful,
1650397Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1750397SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1850397SobrienGNU General Public License for more details.
1950397Sobrien
2050397SobrienYou should have received a copy of the GNU General Public License
2150397Sobrienalong with GNU CC; see the file COPYING.  If not, write to
2250397Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330,
2350397SobrienBoston, MA 02111-1307, USA.  */
2450397Sobrien
2550397Sobrien
2650397Sobrien#undef TARGET_VERSION
2750397Sobrien#define TARGET_VERSION fprintf (stderr, " (i386 Sequent Dynix/ptx Version 4)");
2850397Sobrien
2950397Sobrien/* The svr4 ABI for the i386 says that records and unions are returned
3050397Sobrien   in memory.  */
3150397Sobrien
3250397Sobrien#undef RETURN_IN_MEMORY
3350397Sobrien#define RETURN_IN_MEMORY(TYPE) \
3490075Sobrien  (TYPE_MODE (TYPE) == BLKmode \
3590075Sobrien   || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
3650397Sobrien
3750397Sobrien/* Define which macros to predefine.  _SEQUENT_ is our extension.  */
3850397Sobrien/* This used to define X86, but james@bigtex.cactus.org says that
3950397Sobrien   is supposed to be defined optionally by user programs--not by default.  */
4050397Sobrien#define CPP_PREDEFINES \
4190075Sobrien  "-Dunix -D_SEQUENT_ -Asystem=unix -Asystem=ptx4"
4250397Sobrien
4350397Sobrien#undef DBX_REGISTER_NUMBER
4490075Sobrien#define DBX_REGISTER_NUMBER(n)  svr4_dbx_register_map[n]
4550397Sobrien
4650397Sobrien/* The routine used to output sequences of byte values.  We use a special
4750397Sobrien   version of this for most svr4 targets because doing so makes the
4850397Sobrien   generated assembly code more compact (and thus faster to assemble)
4950397Sobrien   as well as more readable.  Note that if we find subparts of the
5050397Sobrien   character sequence which end with NUL (and which are shorter than
5150397Sobrien   STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING.  */
5250397Sobrien
5350397Sobrien#undef ASM_OUTPUT_ASCII
5450397Sobrien#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH)				\
5550397Sobrien  do									\
5650397Sobrien    {									\
5790075Sobrien      register const unsigned char *_ascii_bytes =			\
5890075Sobrien        (const unsigned char *) (STR);					\
5990075Sobrien      register const unsigned char *limit = _ascii_bytes + (LENGTH);	\
6050397Sobrien      register unsigned bytes_in_chunk = 0;				\
6150397Sobrien      for (; _ascii_bytes < limit; _ascii_bytes++)			\
6250397Sobrien        {								\
6390075Sobrien	  register const unsigned char *p;				\
6450397Sobrien	  if (bytes_in_chunk >= 64)					\
6550397Sobrien	    {								\
6650397Sobrien	      fputc ('\n', (FILE));					\
6750397Sobrien	      bytes_in_chunk = 0;					\
6850397Sobrien	    }								\
6950397Sobrien	  for (p = _ascii_bytes; p < limit && *p != '\0'; p++)		\
7050397Sobrien	    continue;							\
7190075Sobrien	  if (p < limit && (p - _ascii_bytes) <= (long) STRING_LIMIT)	\
7250397Sobrien	    {								\
7350397Sobrien	      if (bytes_in_chunk > 0)					\
7450397Sobrien		{							\
7550397Sobrien		  fputc ('\n', (FILE));					\
7650397Sobrien		  bytes_in_chunk = 0;					\
7750397Sobrien		}							\
7850397Sobrien	      ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes);		\
7950397Sobrien	      _ascii_bytes = p;						\
8050397Sobrien	    }								\
8150397Sobrien	  else								\
8250397Sobrien	    {								\
8350397Sobrien	      if (bytes_in_chunk == 0)					\
8450397Sobrien		fprintf ((FILE), "\t.byte\t");				\
8550397Sobrien	      else							\
8650397Sobrien		fputc (',', (FILE));					\
8750397Sobrien	      fprintf ((FILE), "0x%02x", *_ascii_bytes);		\
8850397Sobrien	      bytes_in_chunk += 5;					\
8950397Sobrien	    }								\
9050397Sobrien	}								\
9150397Sobrien      if (bytes_in_chunk > 0)						\
9250397Sobrien        fprintf ((FILE), "\n");						\
9350397Sobrien    }									\
9450397Sobrien  while (0)
95