OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [libgloss/] [m68k/] [asm.h] - Diff between revs 207 and 345

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/* asm.h -- macros for m68k asm
/* asm.h -- macros for m68k asm
 *
 *
 * Copyright (c) 1995, 1996 Cygnus Support
 * Copyright (c) 1995, 1996 Cygnus Support
 *
 *
 * The authors hereby grant permission to use, copy, modify, distribute,
 * The authors hereby grant permission to use, copy, modify, distribute,
 * and license this software and its documentation for any purpose, provided
 * and license this software and its documentation for any purpose, provided
 * that existing copyright notices are retained in all copies and that this
 * that existing copyright notices are retained in all copies and that this
 * notice is included verbatim in any distributions. No written agreement,
 * notice is included verbatim in any distributions. No written agreement,
 * license, or royalty fee is required for any of the authorized uses.
 * license, or royalty fee is required for any of the authorized uses.
 * Modifications to this software may be copyrighted by their authors
 * Modifications to this software may be copyrighted by their authors
 * and need not follow the licensing terms described here, provided that
 * and need not follow the licensing terms described here, provided that
 * the new terms are clearly indicated on the first page of each file where
 * the new terms are clearly indicated on the first page of each file where
 * they apply.
 * they apply.
 */
 */
 
 
#if 0
#if 0
/*
/*
 * XXX __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ do not work on gcc 2.7.0-3
 * XXX __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ do not work on gcc 2.7.0-3
 * XXX The following ifdef magic fixes the problem but results in a warning
 * XXX The following ifdef magic fixes the problem but results in a warning
 * XXX when compiling assembly code.
 * XXX when compiling assembly code.
 */
 */
#ifndef __USER_LABEL_PREFIX__
#ifndef __USER_LABEL_PREFIX__
/* #define __USER_LABEL_PREFIX__ ""     /* no underscore for coff */
/* #define __USER_LABEL_PREFIX__ ""     /* no underscore for coff */
#define __USER_LABEL_PREFIX__ _         /* leading underscore for aout */
#define __USER_LABEL_PREFIX__ _         /* leading underscore for aout */
#endif
#endif
 
 
#ifndef __REGISTER_PREFIX__
#ifndef __REGISTER_PREFIX__
#define __REGISTER_PREFIX__             /* never has anything prefixed */
#define __REGISTER_PREFIX__             /* never has anything prefixed */
#endif
#endif
#endif
#endif
 
 
/*
/*
 * some assemblers choke on '#' as an immediate value. As gcc can also
 * some assemblers choke on '#' as an immediate value. As gcc can also
 * use '&', use that in those cases.
 * use '&', use that in those cases.
 */
 */
#ifndef __IMMEDIATE_PREFIX__
#ifndef __IMMEDIATE_PREFIX__
#define __IMMEDIATE_PREFIX__ #
#define __IMMEDIATE_PREFIX__ #
#endif
#endif
 
 
/* ANSI concatenation macros.  */
/* ANSI concatenation macros.  */
#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b
#define CONCAT2(a, b) a ## b
 
 
/* use the right prefix for global labels.  */
/* use the right prefix for global labels.  */
#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__,x)
#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__,x)
 
 
/* use the right prefix for registers.  */
/* use the right prefix for registers.  */
#define REG(x) CONCAT1 (__REGISTER_PREFIX__,x)
#define REG(x) CONCAT1 (__REGISTER_PREFIX__,x)
 
 
/* use the right prefix for immediate values.  */
/* use the right prefix for immediate values.  */
#define IMM(x) CONCAT1 (__IMMEDIATE_PREFIX__,x)
#define IMM(x) CONCAT1 (__IMMEDIATE_PREFIX__,x)
 
 
/* use the right prefix for register names */
/* use the right prefix for register names */
#define d0 REG (d0)
#define d0 REG (d0)
#define d1 REG (d1)
#define d1 REG (d1)
#define d2 REG (d2)
#define d2 REG (d2)
#define d3 REG (d3)
#define d3 REG (d3)
#define d4 REG (d4)
#define d4 REG (d4)
#define d5 REG (d5)
#define d5 REG (d5)
#define d6 REG (d6)
#define d6 REG (d6)
#define d7 REG (d7)
#define d7 REG (d7)
#define a0 REG (a0)
#define a0 REG (a0)
#define a1 REG (a1)
#define a1 REG (a1)
#define a2 REG (a2)
#define a2 REG (a2)
#define a3 REG (a3)
#define a3 REG (a3)
#define a4 REG (a4)
#define a4 REG (a4)
#define a5 REG (a5)
#define a5 REG (a5)
#define a6 REG (a6)
#define a6 REG (a6)
#define a7 REG (a7)
#define a7 REG (a7)
#define fp REG (fp)
#define fp REG (fp)
#define fp0 REG (fp0)
#define fp0 REG (fp0)
#define fp1 REG (fp1)
#define fp1 REG (fp1)
#define fp2 REG (fp2)
#define fp2 REG (fp2)
#define fp3 REG (fp3)
#define fp3 REG (fp3)
#define fp4 REG (fp4)
#define fp4 REG (fp4)
#define fp5 REG (fp5)
#define fp5 REG (fp5)
#define fp6 REG (fp6)
#define fp6 REG (fp6)
#define fp7 REG (fp7)
#define fp7 REG (fp7)
#define sp REG (sp)
#define sp REG (sp)
#define usp REG (usp)
#define usp REG (usp)
#define vbr REG (vbr)
#define vbr REG (vbr)
#define mbb REG (mbb)
#define mbb REG (mbb)
#define sr REG (sr)
#define sr REG (sr)
#define fpcr REG (fpcr)
#define fpcr REG (fpcr)
#define fpsr REG (fpsr)
#define fpsr REG (fpsr)
#define fpi REG (fpi)
#define fpi REG (fpi)
 
 
/* Provide a few macros to allow for PIC code support.
/* Provide a few macros to allow for PIC code support.
 * With PIC, data is stored A5 relative so we've got to take a bit of special
 * With PIC, data is stored A5 relative so we've got to take a bit of special
 * care to ensure that all loads of global data is via A5.  PIC also requires
 * care to ensure that all loads of global data is via A5.  PIC also requires
 * jumps and subroutine calls to be PC relative rather than absolute.  We cheat
 * jumps and subroutine calls to be PC relative rather than absolute.  We cheat
 * a little on this and in the PIC case, we use short offset branches and
 * a little on this and in the PIC case, we use short offset branches and
 * hope that the final object code is within range (which it should be).
 * hope that the final object code is within range (which it should be).
 */
 */
#ifndef __PIC__
#ifndef __PIC__
 
 
        /* Non PIC (absolute/relocatable) versions */
        /* Non PIC (absolute/relocatable) versions */
 
 
        .macro PICCALL addr
        .macro PICCALL addr
        jbsr    \addr
        jbsr    \addr
        .endm
        .endm
 
 
        .macro PICJUMP addr
        .macro PICJUMP addr
        jmp     \addr
        jmp     \addr
        .endm
        .endm
 
 
        .macro PICLEA sym, reg
        .macro PICLEA sym, reg
        lea     \sym, \reg
        lea     \sym, \reg
        .endm
        .endm
 
 
        .macro PICPEA sym, areg
        .macro PICPEA sym, areg
        pea     \sym
        pea     \sym
        .endm
        .endm
 
 
#else /* __PIC__ */
#else /* __PIC__ */
 
 
        /* Common for -mid-shared-libary and -msep-data */
        /* Common for -mid-shared-libary and -msep-data */
 
 
        .macro PICCALL addr
        .macro PICCALL addr
        bsr     \addr
        bsr     \addr
        .endm
        .endm
 
 
        .macro PICJUMP addr
        .macro PICJUMP addr
        bra     \addr
        bra     \addr
        .endm
        .endm
 
 
# if defined(__ID_SHARED_LIBRARY__)
# if defined(__ID_SHARED_LIBRARY__)
 
 
        /* -mid-shared-library versions  */
        /* -mid-shared-library versions  */
 
 
        .macro PICLEA sym, reg
        .macro PICLEA sym, reg
        movel   a5@(_current_shared_library_a5_offset_), \reg
        movel   a5@(_current_shared_library_a5_offset_), \reg
        movel   \sym@GOT(\reg), \reg
        movel   \sym@GOT(\reg), \reg
        .endm
        .endm
 
 
        .macro PICPEA sym, areg
        .macro PICPEA sym, areg
        movel   a5@(_current_shared_library_a5_offset_), \areg
        movel   a5@(_current_shared_library_a5_offset_), \areg
        movel   \sym@GOT(\areg), sp@-
        movel   \sym@GOT(\areg), sp@-
        .endm
        .endm
 
 
# else /* !__ID_SHARED_LIBRARY__ */
# else /* !__ID_SHARED_LIBRARY__ */
 
 
        /* Versions for -msep-data */
        /* Versions for -msep-data */
 
 
        .macro PICLEA sym, reg
        .macro PICLEA sym, reg
        movel   \sym@GOT(a5), \reg
        movel   \sym@GOT(a5), \reg
        .endm
        .endm
 
 
        .macro PICPEA sym, areg
        .macro PICPEA sym, areg
        movel   \sym@GOT(a5), sp@-
        movel   \sym@GOT(a5), sp@-
        .endm
        .endm
 
 
# endif /* !__ID_SHARED_LIBRARY__ */
# endif /* !__ID_SHARED_LIBRARY__ */
#endif /* __PIC__ */
#endif /* __PIC__ */
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.