; Copyright 2011 Free Software Foundation, Inc.
;
; Contributed by Red Hat Inc;
;
; This file is part of the GNU Binutils.
;
; 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
; the Free Software Foundation; either version 3 of the License, or
; (at your option) any later version.
;
; This program 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 this program; if not, write to the Free Software
; Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
; MA 02110-1301, USA.
;; This coprocessor definition is being used to verify vliw mode behaviour.
;; This is a mock-up done by Red Hat and is in no way supposed to represent
;; a real coprocessor. The hardware is defined in mep-core.cpu.
; ifields For 32-bit insns (some of the above are used too)
; Notes:
;
; f-alone: A value of 0111 means that the insn can run alone in
; one of the vliw modes.
;
; f-seg32: Together f-seg32 and f-seg32-a allow 64 different 32-bit
; f-seg32-a: insns to be defined.
(dnf f-seg32 "Enumerate 32 bit-insns" ((ISA ext_cop1_32)) 9 3)
(dnf f-alone "Run-alone indicator" ((ISA ext_cop1_16,ext_cop1_32,ext_cop1_64)) 12 4)
(dnf f-seg32-a "Enumerate 32 bit-insns" ((ISA ext_cop1_32)) 21 3)
(dnf f-code8 "8 bit unsigned immediate" ((ISA ext_cop1_32)) 24 8)
(dnf f-cpcrm-32 "Corpocessor Reg" ((ISA ext_cop1_32)) 16 5)
; ifields for 48-bit insns
; Note: Part of f-uu12 can be broken off later to enumerate
; any 48-bit insns that may be added.
(dnf f-uu12 "Unusued 12 bits" ((ISA ext_cop1_48)) 4 12)
(dnf f-code16a "Unsigned immediate" ((ISA ext_cop1_48)) 16 16)
(dnf f-code16b "Unsigned immediate" ((ISA ext_cop1_48,ext_cop1_64)) 32 16)
; 16- and 32-bit nops can be defined as normal instructions without
; any problems. nops take no operands, so nops longer than 32
; bits cannot be defined as normal insns since that would result in
; decodable bits beyond cgen's 32-bit boundary. As a result, we
; have to use macros and other real insns to create 48- and 64-bit nops.
;
; In addition, since the names of the nops that will be created as part
; of future insn sets are not known at this time, the assembler needs a
; fixed set of nop names that it can use for automatic nop insertion.
; The idea is that no matter what those insns are called, we don't want
; to have to change the C code in the assemblers vliw grouping validation
; and nop insertion routines. We therefore have to create macros for
; all nops to map the macro names which are known to the assembler to the
; names of the real nop insns.
;
; These emitted insns in these macros will need to be modified when
; new nops are defined in new coprocessor insn sets.
; A real 16-bit nop insn exists
(dnmi cpnop16 "cpnop16"
((ISA ext_cop1_16))
"cpnop16"
(emit cp16nop)
)
; A real 32-bit nop insn exists
(dnmi cpnop32 "cpnop32"
((ISA ext_cop1_32))
"cpnop32"
(emit cp32nop)
)
; There is no 48-bit nop insn so we use a real "dummy" insn to enable the nop.
(dnmi cpnop48 "cpnop48"
((ISA ext_cop1_48))
"cpnop48"
(emit cpf1nop (code16a 0) (code16b 0))
)
; There is no 64-bit nop insn so we use a real "dummy" insn to enable the nop.
(dnmi cpnop64 "cpnop64"
((ISA ext_cop1_64))
"cpnop64"
(emit cpf3nop (code16b 0) (code16c 0))
)