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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [cpu/] [simplify.inc] - Diff between revs 156 and 816

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

Rev 156 Rev 816
; Collection of macros, for GNU Binutils .cpu files. -*- Scheme -*-
; Collection of macros, for GNU Binutils .cpu files. -*- Scheme -*-
;
;
; Copyright 2000, 2007 Free Software Foundation, Inc.
; Copyright 2000, 2007 Free Software Foundation, Inc.
;
;
; Contributed by Red Hat Inc.
; Contributed by Red Hat Inc.
;
;
; This file is part of the GNU Binutils.
; This file is part of the GNU Binutils.
;
;
; This program is free software; you can redistribute it and/or modify
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 3 of the License, or
; the Free Software Foundation; either version 3 of the License, or
; (at your option) any later version.
; (at your option) any later version.
;
;
; This program is distributed in the hope that it will be useful,
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
; GNU General Public License for more details.
;
;
; You should have received a copy of the GNU General Public License
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; along with this program; if not, write to the Free Software
; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
; MA 02110-1301, USA.
; MA 02110-1301, USA.


; Enums.
; Enums.
; Define a normal enum without using name/value pairs.
; Define a normal enum without using name/value pairs.
; This is currently the same as define-full-enum but it needn't remain
; This is currently the same as define-full-enum but it needn't remain
; that way (it's define-full-enum that would change).
; that way (it's define-full-enum that would change).
(define-pmacro (define-normal-enum name comment attrs prefix vals)
(define-pmacro (define-normal-enum name comment attrs prefix vals)
  "\
  "\
Define a normal enum, fixed number of arguments.
Define a normal enum, fixed number of arguments.
"
"
  (define-full-enum name comment attrs prefix vals)
  (define-full-enum name comment attrs prefix vals)
)
)
; Define a normal insn enum.
; Define a normal insn enum.
(define-pmacro (define-normal-insn-enum name comment attrs prefix fld vals)
(define-pmacro (define-normal-insn-enum name comment attrs prefix fld vals)
  "\
  "\
Define a normal instruction opcode enum.
Define a normal instruction opcode enum.
"
"
  (define-full-insn-enum name comment attrs prefix fld vals)
  (define-full-insn-enum name comment attrs prefix fld vals)
)
)


; Instruction fields.
; Instruction fields.
; Normally, fields are unsigned have no encode/decode needs.
; Normally, fields are unsigned have no encode/decode needs.
(define-pmacro (define-normal-ifield name comment attrs start length)
(define-pmacro (define-normal-ifield name comment attrs start length)
  "Define a normal instruction field.\n"
  "Define a normal instruction field.\n"
  (define-full-ifield name comment attrs start length UINT #f #f)
  (define-full-ifield name comment attrs start length UINT #f #f)
)
)
; For those who don't like typing.
; For those who don't like typing.
(define-pmacro df
(define-pmacro df
  "Shorthand form of define-full-ifield.\n"
  "Shorthand form of define-full-ifield.\n"
  define-full-ifield
  define-full-ifield
)
)
(define-pmacro dnf
(define-pmacro dnf
  "Shorthand form of define-normal-ifield.\n"
  "Shorthand form of define-normal-ifield.\n"
  define-normal-ifield
  define-normal-ifield
)
)
; Define a normal multi-ifield.
; Define a normal multi-ifield.
; FIXME: The define-normal version for ifields doesn't include the mode.
; FIXME: The define-normal version for ifields doesn't include the mode.
(define-pmacro (define-normal-multi-ifield name comment attrs
(define-pmacro (define-normal-multi-ifield name comment attrs
                 mode subflds insert extract)
                 mode subflds insert extract)
  "Define a normal multi-part instruction field.\n"
  "Define a normal multi-part instruction field.\n"
  (define-full-multi-ifield name comment attrs mode subflds insert extract)
  (define-full-multi-ifield name comment attrs mode subflds insert extract)
)
)
; For those who don't like typing.
; For those who don't like typing.
(define-pmacro dnmf
(define-pmacro dnmf
  "Shorthand form of define-normal-multi-ifield.\n"
  "Shorthand form of define-normal-multi-ifield.\n"
  define-normal-multi-ifield
  define-normal-multi-ifield
)
)
; Simple multi-ifields: mode is UINT, default insert/extract support.
; Simple multi-ifields: mode is UINT, default insert/extract support.
(define-pmacro (dsmf name comment attrs subflds)
(define-pmacro (dsmf name comment attrs subflds)
  "Define a simple multi-part instruction field.\n"
  "Define a simple multi-part instruction field.\n"
  (define-full-multi-ifield name comment attrs UINT subflds #f #f)
  (define-full-multi-ifield name comment attrs UINT subflds #f #f)
)
)


; Hardware.
; Hardware.
; Simpler version for most hardware elements.
; Simpler version for most hardware elements.
; Allow special assembler support specification but no semantic-name or
; Allow special assembler support specification but no semantic-name or
; get/set specs.
; get/set specs.
(define-pmacro (define-normal-hardware name comment attrs type
(define-pmacro (define-normal-hardware name comment attrs type
                 indices values handlers)
                 indices values handlers)
  "\
  "\
Define a normal hardware element.
Define a normal hardware element.
"
"
  (define-full-hardware name comment attrs name type
  (define-full-hardware name comment attrs name type
    indices values handlers () () ())
    indices values handlers () () ())
)
)
; For those who don't like typing.
; For those who don't like typing.
(define-pmacro dnh
(define-pmacro dnh
  "Shorthand form of define-normal-hardware.\n"
  "Shorthand form of define-normal-hardware.\n"
  define-normal-hardware
  define-normal-hardware
)
)
; Simpler version of dnh that leaves out the indices, values, handlers,
; Simpler version of dnh that leaves out the indices, values, handlers,
; get, set, and layout specs.
; get, set, and layout specs.
; This is useful for 1 bit registers.
; This is useful for 1 bit registers.
; ??? While dsh and dnh aren't that distinguishable when perusing a .cpu file,
; ??? While dsh and dnh aren't that distinguishable when perusing a .cpu file,
; they both take a fixed number of positional arguments, and dsh is a proper
; they both take a fixed number of positional arguments, and dsh is a proper
; subset of dnh with all arguments in the same positions, so methinks things
; subset of dnh with all arguments in the same positions, so methinks things
; are ok.
; are ok.
(define-pmacro (define-simple-hardware name comment attrs type)
(define-pmacro (define-simple-hardware name comment attrs type)
  "\
  "\
Define a simple hardware element (usually a scalar register).
Define a simple hardware element (usually a scalar register).
"
"
  (define-full-hardware name comment attrs name type () () () () () ())
  (define-full-hardware name comment attrs name type () () () () () ())
)
)
(define-pmacro dsh
(define-pmacro dsh
  "Shorthand form of define-simple-hardware.\n"
  "Shorthand form of define-simple-hardware.\n"
  define-simple-hardware
  define-simple-hardware
)
)


; Operands.
; Operands.
(define-pmacro (define-normal-operand name comment attrs type index)
(define-pmacro (define-normal-operand name comment attrs type index)
  "Define a normal operand.\n"
  "Define a normal operand.\n"
  (define-full-operand name comment attrs type DFLT index () () ())
  (define-full-operand name comment attrs type DFLT index () () ())
)
)
; For those who don't like typing.
; For those who don't like typing.
; FIXME: dno?
; FIXME: dno?
(define-pmacro dnop
(define-pmacro dnop
  "Shorthand form of define-normal-operand.\n"
  "Shorthand form of define-normal-operand.\n"
  define-normal-operand
  define-normal-operand
)
)
(define-pmacro (dndo x-name x-mode x-args
(define-pmacro (dndo x-name x-mode x-args
                     x-syntax x-base-ifield x-encoding x-ifield-assertion
                     x-syntax x-base-ifield x-encoding x-ifield-assertion
                     x-getter x-setter)
                     x-getter x-setter)
  "Define a normal derived operand."
  "Define a normal derived operand."
  (define-derived-operand
  (define-derived-operand
    (name x-name)
    (name x-name)
    (mode x-mode)
    (mode x-mode)
    (args x-args)
    (args x-args)
    (syntax x-syntax)
    (syntax x-syntax)
    (base-ifield x-base-ifield)
    (base-ifield x-base-ifield)
    (encoding x-encoding)
    (encoding x-encoding)
    (ifield-assertion x-ifield-assertion)
    (ifield-assertion x-ifield-assertion)
    (getter x-getter)
    (getter x-getter)
    (setter x-setter)
    (setter x-setter)
    )
    )
)
)


; Instructions.
; Instructions.
; Define an instruction object, normal version.
; Define an instruction object, normal version.
; At present all fields must be specified.
; At present all fields must be specified.
; Fields ifield-assertion is absent.
; Fields ifield-assertion is absent.
(define-pmacro (define-normal-insn name comment attrs syntax fmt semantics timing)
(define-pmacro (define-normal-insn name comment attrs syntax fmt semantics timing)
  "Define a normal instruction.\n"
  "Define a normal instruction.\n"
  (define-full-insn name comment attrs syntax fmt () semantics timing)
  (define-full-insn name comment attrs syntax fmt () semantics timing)
)
)
; To reduce the amount of typing.
; To reduce the amount of typing.
; Note that this is the same name as the D'ni in MYST.  Oooohhhh.....
; Note that this is the same name as the D'ni in MYST.  Oooohhhh.....
; this must be the right way to go. :-)
; this must be the right way to go. :-)
(define-pmacro dni
(define-pmacro dni
  "Shorthand form of define-normal-insn.\n"
  "Shorthand form of define-normal-insn.\n"
  define-normal-insn
  define-normal-insn
)
)


; Macro instructions.
; Macro instructions.
; Define a macro-insn object, normal version.
; Define a macro-insn object, normal version.
; This only supports expanding to one real insn.
; This only supports expanding to one real insn.
(define-pmacro (define-normal-macro-insn name comment attrs syntax expansion)
(define-pmacro (define-normal-macro-insn name comment attrs syntax expansion)
  "Define a normal macro instruction.\n"
  "Define a normal macro instruction.\n"
  (define-full-minsn name comment attrs syntax expansion)
  (define-full-minsn name comment attrs syntax expansion)
)
)
; To reduce the amount of typing.
; To reduce the amount of typing.
(define-pmacro dnmi
(define-pmacro dnmi
  "Shorthand form of define-normal-macro-insn.\n"
  "Shorthand form of define-normal-macro-insn.\n"
  define-normal-macro-insn
  define-normal-macro-insn
)
)


; Modes.
; Modes.
; ??? Not currently available for use.
; ??? Not currently available for use.
;
;
; Define Normal Mode
; Define Normal Mode
;
;
;(define-pmacro (define-normal-mode name comment attrs bits bytes
;(define-pmacro (define-normal-mode name comment attrs bits bytes
;                non-mode-c-type printf-type sem-mode ptr-to host?)
;                non-mode-c-type printf-type sem-mode ptr-to host?)
;  "Define a normal mode.\n"
;  "Define a normal mode.\n"
;  (define-full-mode name comment attrs bits bytes
;  (define-full-mode name comment attrs bits bytes
;    non-mode-c-type printf-type sem-mode ptr-to host?)
;    non-mode-c-type printf-type sem-mode ptr-to host?)
;)
;)
;
;
; For those who don't like typing.
; For those who don't like typing.
;(define-pmacro dnm
;(define-pmacro dnm
;  "Shorthand form of define-normal-mode.\n"
;  "Shorthand form of define-normal-mode.\n"
;  define-normal-mode
;  define-normal-mode
;)
;)
 
 

powered by: WebSVN 2.1.0

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