This is the mail archive of the cgen@sourceware.org mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ms1] Add ms2 support


Aldy,
this patch adds binutils support for morphotech's ms2 processor. Note that ms1 is not the same as mrisc2 -- the latter is, confusingly, ms1-16-003.
This adds 6 new instructions (two loop insn and four domain specific ones).


The private data merging is a temporary kludge until gcc multilib support is implemented. The existing behaviour allowed arbitrary merging of ms1 and ms1-16-003 object files, even though that is unsafe. This merely continues that behaviour but notes that it is incorrect.

The ms1 architecture name has become less applicable, and a future renaming patch is anticipated. That will rename the canonical architecture 'mt', and have 'ms1' and 'ms2' variants. The 'mt' target will be multilibbed, whereas 'ms1' and 'ms2' will be single target machines.

ok?

nathan.

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2005-11-07  Nathan Sidwell  <nathan@codesourcery.com>

bfd:
	Add ms2.
	* archures.c (bfd_mach_ms2): Define.
	* cpu-ms1.c (arch_info_struct): Add ms2 stanza.
	* elf32-ms1.c (elf32_ms1_machine): Add ms2 case.
	(ms1_elf_merge_private_bfd_data): Remove unused variables.  Add
	correct merging logic, with workaround.
	(ms1_elf_print_private_bfd_data): Add ms2 case.
	* reloc.c (BFD_RELOC_MS1_PCINSN8): Add ms2 specific reloc.
	* libbfd.h: Regenerated.
	* bfd-in2.h: Regenerated.

cpu:
	Add ms2
	* ms1.cpu (ms2, ms2bf): New architecture variant, cpu, machine and
	model.
	(f-uu8, f-uu1, f-imm16l, f-loopo, f-cb1sel, f-cb2sel, f-cb1incr,
	f-cb2incr, f-rc3): New fields.
	(LOOP): New instruction.
	(JAL-HAZARD): New hazard.
	(imm16o, loopsize, imm16l, rc3, cb1sel, cb2sel, cb1incr, cb2incr):
	New operands.
	(mul, muli, dbnz, iflush): Enable for ms2
	(jal, reti): Has JAL-HAZARD.
	(ldctxt, ldfb, stfb): Only ms1.
	(fbcb): Only ms1,ms1-003.
	(wfbinc, mefbinc, wfbincr, mwfbincr, fbcbincs, mfbcbincs,
	fbcbincrs, mfbcbincrs): Enable for ms2.
	(loop, loopu, dfbc, dwfb, fbwfb, dfbr): New ms2 insns.
	* ms1.opc (parse_loopsize): New.
	(parse_imm16): hi16/lo16 relocs are applicable to IMM16L.
	(print_pcrel): New.

gas:
	Add ms2.
	* config/tc-ms1.c (ms1_mach_bitmask): Initialize to MS1.
	(ms1_architectures): Add ms2.
	(md_parse_option): Add ms2.
	(md_show_usage): Add ms2.
	(md_assemble): Add JAL_HAZARD detection logic.
	(md_cgen_lookup_reloc): Add MS1_OPERAND_LOOPSIZE case.

gas/testsuite:
	Add ms2.
	* gas/ms1/allinsn.d: Adjust pcrel disassembly.
	* gas/ms1/errors.exp: Fix target triplet.
	* gas/ms1/ms1-16-003.d: Adjust pcrel disassembly.
	* gas/ms1/ms1-16-003.s: Tweak label.
	* gas/ms1/ms1.exp: Adjust target triplet.  Add ms2 test.
	* gas/ms1/ms2.d, gas/ms1/ms2.s: New.
	* gas/ms1/relocs.d: Adjust expected machine name and pcrel
	disassembly. 
	* gas/ms1/relocs.exp: Adjust target triplet.

include:
	Add ms2.
	* elf/ms1.h (EF_MS1_CPU_MS2): New.


opcodes:
	Add ms2.
	* ms1-asm.c, ms1-desc.c, ms1-desc.h, ms1-dis.c, ms1-ibld.c,
	ms1-opc.c, ms1-opc.h: Regenerated.

Index: bfd/archures.c
===================================================================
RCS file: /cvs/src/src/bfd/archures.c,v
retrieving revision 1.111
diff -c -3 -p -r1.111 archures.c
*** bfd/archures.c	25 Oct 2005 17:40:09 -0000	1.111
--- bfd/archures.c	7 Nov 2005 11:23:14 -0000
*************** DESCRIPTION
*** 320,325 ****
--- 320,326 ----
  .  bfd_arch_ms1,
  .#define bfd_mach_ms1           1
  .#define bfd_mach_mrisc2        2
+ .#define bfd_mach_ms2           3
  .  bfd_arch_pj,
  .  bfd_arch_avr,       {* Atmel AVR microcontrollers.  *}
  .#define bfd_mach_avr1		1
Index: bfd/bfd-in2.h
===================================================================
RCS file: /cvs/src/src/bfd/bfd-in2.h,v
retrieving revision 1.370
diff -c -3 -p -r1.370 bfd-in2.h
*** bfd/bfd-in2.h	25 Oct 2005 17:40:09 -0000	1.370
--- bfd/bfd-in2.h	7 Nov 2005 11:23:17 -0000
*************** enum bfd_architecture
*** 1908,1913 ****
--- 1908,1914 ----
    bfd_arch_ms1,
  #define bfd_mach_ms1           1
  #define bfd_mach_mrisc2        2
+ #define bfd_mach_ms2           3
    bfd_arch_pj,
    bfd_arch_avr,       /* Atmel AVR microcontrollers.  */
  #define bfd_mach_avr1          1
*************** This is the 5 bits of a value.  */
*** 3970,3975 ****
--- 3971,3979 ----
  /* Morpho MS1 - Used to tell the linker which vtable entries are used.  */
    BFD_RELOC_MS1_GNU_VTENTRY,
  
+ /* Morpho MS1 - 8 bit immediate relocation.  */
+   BFD_RELOC_MS1_PCINSN8,
+ 
  /* msp430 specific relocation codes  */
    BFD_RELOC_MSP430_10_PCREL,
    BFD_RELOC_MSP430_16_PCREL,
Index: bfd/cpu-ms1.c
===================================================================
RCS file: /cvs/src/src/bfd/cpu-ms1.c,v
retrieving revision 1.1
diff -c -3 -p -r1.1 cpu-ms1.c
*** bfd/cpu-ms1.c	7 Jun 2005 21:07:30 -0000	1.1
--- bfd/cpu-ms1.c	7 Nov 2005 11:23:17 -0000
*************** const bfd_arch_info_type arch_info_struc
*** 35,42 ****
    FALSE,		        /* The default ?  */
    bfd_default_compatible,	/* Architecture comparison fn.  */
    bfd_default_scan,		/* String to architecture convert fn.  */
    NULL				/* Next in list.  */
! }
  };
  
  const bfd_arch_info_type bfd_ms1_arch =
--- 35,56 ----
    FALSE,		        /* The default ?  */
    bfd_default_compatible,	/* Architecture comparison fn.  */
    bfd_default_scan,		/* String to architecture convert fn.  */
+   &arch_info_struct[1]          /* Next in list.  */
+ },
+ {
+   32,				/* Bits per word - not really true.  */
+   32,				/* Bits per address.  */
+   8,				/* Bits per byte.  */
+   bfd_arch_ms1,			/* Architecture.  */
+   bfd_mach_ms2,		        /* Machine.  */
+   "ms1",			/* Architecture name.  */
+   "ms2",			/* Printable name.  */
+   1,				/* Section align power.  */
+   FALSE,		        /* The default ?  */
+   bfd_default_compatible,	/* Architecture comparison fn.  */
+   bfd_default_scan,		/* String to architecture convert fn.  */
    NULL				/* Next in list.  */
! },
  };
  
  const bfd_arch_info_type bfd_ms1_arch =
Index: bfd/elf32-ms1.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ms1.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 elf32-ms1.c
*** bfd/elf32-ms1.c	20 Jun 2005 18:12:07 -0000	1.2
--- bfd/elf32-ms1.c	7 Nov 2005 11:23:20 -0000
*************** elf32_ms1_machine (bfd *abfd)
*** 501,506 ****
--- 501,507 ----
      {
      case EF_MS1_CPU_MRISC:	return bfd_mach_ms1;
      case EF_MS1_CPU_MRISC2:  return bfd_mach_mrisc2;
+     case EF_MS1_CPU_MS2:  return bfd_mach_ms2;
      }
  
    return bfd_mach_ms1;
*************** ms1_elf_merge_private_bfd_data (bfd * ib
*** 548,554 ****
  {
    flagword     old_flags, new_flags;
    bfd_boolean  error = FALSE;
-   static bfd * last_ibfd = 0;
  
    /* Check if we have the same endianess.  */
    if (_bfd_generic_verify_endian_match (ibfd, obfd) == FALSE)
--- 549,554 ----
*************** ms1_elf_merge_private_bfd_data (bfd * ib
*** 569,581 ****
  		      ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no");
  #endif
  
!   elf_flags_init (obfd) = TRUE;
! 
!   if ((new_flags & EF_MS1_CPU_MASK) == EF_MS1_CPU_MRISC2)
      {
-       elf_elfheader (obfd)->e_flags = new_flags;
-       last_ibfd = ibfd;
        obfd->arch_info = ibfd->arch_info;
      }
  
    return !error;
--- 569,597 ----
  		      ibfd, old_flags, new_flags, elf_flags_init (obfd) ? "yes" : "no");
  #endif
  
!   if (!elf_flags_init (obfd))
!     {
!       old_flags = new_flags;
!       elf_flags_init (obfd) = TRUE;
!     }
!   else if ((new_flags & EF_MS1_CPU_MASK) != (old_flags & EF_MS1_CPU_MASK))
!     {
!       /* CPU has changed.  This is invalid, because MRISC, MRISC2 and
! 	 MS2 are not subsets of each other.   */
!       error = 1;
!       
!       /* FIXME:However, until the compiler is multilibbed, preventing
! 	 mixing breaks the build.  So we allow merging and use the
! 	 greater CPU value.  This is of course unsafe.  */
!       error = 0;
!       if ((new_flags & EF_MS1_CPU_MASK) > (old_flags & EF_MS1_CPU_MASK))
! 	old_flags = ((old_flags & ~EF_MS1_CPU_MASK)
! 		     | (new_flags & EF_MS1_CPU_MASK));
!     }
!   if (!error)
      {
        obfd->arch_info = ibfd->arch_info;
+       elf_elfheader (obfd)->e_flags = old_flags;
      }
  
    return !error;
*************** ms1_elf_print_private_bfd_data (bfd * ab
*** 598,605 ****
    switch (flags & EF_MS1_CPU_MASK)
      {
      default:
!     case EF_MS1_CPU_MRISC:	fprintf (file, " ms1-16-002");	break;
      case EF_MS1_CPU_MRISC2:  fprintf (file, " ms1-16-003");	break;
      }
  
    fputc ('\n', file);
--- 614,622 ----
    switch (flags & EF_MS1_CPU_MASK)
      {
      default:
!     case EF_MS1_CPU_MRISC:   fprintf (file, " ms1-16-002");	break;
      case EF_MS1_CPU_MRISC2:  fprintf (file, " ms1-16-003");	break;
+     case EF_MS1_CPU_MS2:     fprintf (file, " ms2");	break;
      }
  
    fputc ('\n', file);
Index: bfd/libbfd.h
===================================================================
RCS file: /cvs/src/src/bfd/libbfd.h,v
retrieving revision 1.163
diff -c -3 -p -r1.163 libbfd.h
*** bfd/libbfd.h	3 Nov 2005 16:06:11 -0000	1.163
--- bfd/libbfd.h	7 Nov 2005 11:23:20 -0000
*************** static const char *const bfd_reloc_code_
*** 1764,1769 ****
--- 1764,1770 ----
    "BFD_RELOC_MS1_LO16",
    "BFD_RELOC_MS1_GNU_VTINHERIT",
    "BFD_RELOC_MS1_GNU_VTENTRY",
+   "BFD_RELOC_MS1_PCINSN8",
    "BFD_RELOC_MSP430_10_PCREL",
    "BFD_RELOC_MSP430_16_PCREL",
    "BFD_RELOC_MSP430_16",
Index: bfd/reloc.c
===================================================================
RCS file: /cvs/src/src/bfd/reloc.c,v
retrieving revision 1.141
diff -c -3 -p -r1.141 reloc.c
*** bfd/reloc.c	25 Oct 2005 17:40:10 -0000	1.141
--- bfd/reloc.c	7 Nov 2005 11:23:21 -0000
*************** ENUM
*** 4424,4429 ****
--- 4424,4433 ----
    BFD_RELOC_MS1_GNU_VTENTRY
  ENUMDOC
    Morpho MS1 - Used to tell the linker which vtable entries are used.
+ ENUM
+   BFD_RELOC_MS1_PCINSN8
+ ENUMDOC
+   Morpho MS1 - 8 bit immediate relocation. 
  
  ENUM
    BFD_RELOC_MSP430_10_PCREL
Index: cpu/ms1.cpu
===================================================================
RCS file: /cvs/src/src/cpu/ms1.cpu,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ms1.cpu
*** cpu/ms1.cpu	15 Jun 2005 15:33:07 -0000	1.1
--- cpu/ms1.cpu	7 Nov 2005 11:23:22 -0000
***************
*** 32,38 ****
    (comment "Morpho Technologies mRISC family")
    (default-alignment aligned)
    (insn-lsb0? #t)
!   (machs ms1 ms1-003)
    (isas ms1)
  )
  
--- 32,38 ----
    (comment "Morpho Technologies mRISC family")
    (default-alignment aligned)
    (insn-lsb0? #t)
!   (machs ms1 ms1-003 ms2)
    (isas ms1)
  )
  
***************
*** 66,71 ****
--- 66,79 ----
    (word-bitsize 32)
  )
  
+ (define-cpu
+   ; cpu names must be distinct from the architecture name and machine names.
+   (name ms2bf)
+   (comment "Morpho Technologies mRISC family")
+   (endian big)
+   (word-bitsize 32)
+ )
+ 
  (define-mach
    (name ms1)
    (comment "Morpho Technologies mrisc")
***************
*** 80,85 ****
--- 88,100 ----
    (isas ms1)
  )
  
+ (define-mach
+   (name ms2)
+   (comment "Morpho Technologies ms2")
+   (cpu ms2bf)
+   (isas ms1)
+ )
+ 
  
  ; Model descriptions.
  ; Can probably take the u-exec out.  We'll see.
***************
*** 109,118 ****
  	)
  )
  
! ; Macros to simplify MACH attribute specification.
! 
! (define-pmacro MACHMS1 (MACH ms1))
! (define-pmacro MACHMS1-003 (MACH ms1-003))
  
  ; FIXME: It might simplify things to separate the execute process from the
  ; one that updates the PC.
--- 124,141 ----
  	)
  )
  
! (define-model
!   (name ms2)
!   (comment "Morpho Technologies ms2")
!   (mach ms2)
!   (unit u-exec "Execution Unit" ()
! 	1 1 ; issue done
! 	() ; state
! 	() ; inputs
! 	() ; outputs
! 	() ; profile action (default)
! 	)
! )
  
  ; FIXME: It might simplify things to separate the execute process from the
  ; one that updates the PC.
***************
*** 140,145 ****
--- 163,169 ----
  ; f-imm16a: 16 bit immediate value when it's a pc-rel offset.
  ; f-uu4a: unused 4 bit field.
  ; f-uu4b: second unsed 4 bit field.
+ ; f-uu1: unused 1 bit field
  ; f-uu12: unused 12 bit field.
  ; f-uu16: unused 16 bit field.
  ; f-uu24: unused 24 bit field.
***************
*** 158,164 ****
--- 182,190 ----
  (dnf f-uu4a      "unused 4 bit field"		() 19 4)
  (dnf f-uu4b      "unused 4 bit field"		() 23 4)
  (dnf f-uu12      "unused 12 bit field"	        () 11 12)
+ (dnf f-uu8       "unused 8 bit field"           () 15 8)
  (dnf f-uu16      "unused 16 bit field" 	        () 15 16)
+ (dnf f-uu1       "unused 1 bit field" 	        ()  7 1)
  
  ; The following ifields are used exclusively for the MorphoSys instructions.
  ; In a few cases, a bit field is used for something in addition to what its
***************
*** 214,219 ****
--- 240,256 ----
  (dnf f-rc2       "rc2"           		()  6 1)
  (dnf f-ctxdisp   "context displacement"		()  5 6)
  
+ ; additional fields in ms2
+ (dnf f-imm16l    "loop count"                   () 23 16)
+ (df  f-loopo	 "loop offset"			() 7 8 UINT
+     ((value pc) (srl SI value 2))
+     ((value pc) (add SI (sll value 2) 8))
+  )
+ (dnf f-cb1sel    "cb1 select"                   () 25 3)
+ (dnf f-cb2sel    "cb2 select"                   () 22 3)
+ (dnf f-cb1incr   "cb1 increment"                (SIGNED) 19 6)
+ (dnf f-cb2incr   "cb2 increment"                (SIGNED) 13 6)
+ (dnf f-rc3       "row/colum context"            ()  7 1)
  
  ; The following is just for a test
  (dnf f-msysfrsr2 "sr2 for msys"			() 19 4)
***************
*** 237,243 ****
    (ADD  ADDU SUB  SUBU MUL   -      -    -
     AND  OR   XOR  NAND NOR   XNOR   LDUI -
     LSL  LSR  ASR  -    -     -      -    -
!    BRLT BRLE BREQ JMP  JAL   BRNEQ  DBNZ -
     LDW  STW  -    -    -     -      -    -
     -    -    -    -    -     -      -    -
     EI   DI   SI   RETI BREAK IFLUSH -    -
--- 274,280 ----
    (ADD  ADDU SUB  SUBU MUL   -      -    -
     AND  OR   XOR  NAND NOR   XNOR   LDUI -
     LSL  LSR  ASR  -    -     -      -    -
!    BRLT BRLE BREQ JMP  JAL   BRNEQ  DBNZ LOOP
     LDW  STW  -    -    -     -      -    -
     -    -    -    -    -     -      -    -
     EI   DI   SI   RETI BREAK IFLUSH -    -
***************
*** 257,263 ****
  ; insn-imm: bit 24.  Immediate operand indicator.
  (define-normal-insn-enum insn-imm "imm enums" () IMM_ f-imm
    ; This bit specifies whether and immediate operand will be present.
!   ; It's 1 if ther is, 0 if there is not.
    (NO YES)
  )
  ;;;;;;;;;;;;;;;;
--- 294,300 ----
  ; insn-imm: bit 24.  Immediate operand indicator.
  (define-normal-insn-enum insn-imm "imm enums" () IMM_ f-imm
    ; This bit specifies whether and immediate operand will be present.
!   ; It's 1 if there is, 0 if there is not.
    (NO YES)
  )
  ;;;;;;;;;;;;;;;;
***************
*** 307,312 ****
--- 344,356 ----
    (comment "insn performs an I/O operation")
  )
  
+ (define-attr
+   (for insn)
+   (type boolean)
+   (name JAL-HAZARD)
+   (comment "insn has jal-like hazard")
+ )
+ 
  (define-pmacro (define-reg-use-attr regfield)
    (define-attr
      (for insn)
***************
*** 375,382 ****
    (type h-sint) (index f-imm16s) (handlers (parse "imm16") (print "dollarhex")))
  (define-operand (name imm16z) (comment "immediate value - zero extd") (attrs) 
    (type h-uint) (index f-imm16u) (handlers (parse "imm16") (print "dollarhex")))
! (define-operand (name imm16o) (comment "immediate value") (attrs) 
!   (type h-uint) (index f-imm16s) (handlers (parse "imm16") (print "dollarhex")))
  
  ; Operands for MorphoSys Instructions
  
--- 419,426 ----
    (type h-sint) (index f-imm16s) (handlers (parse "imm16") (print "dollarhex")))
  (define-operand (name imm16z) (comment "immediate value - zero extd") (attrs) 
    (type h-uint) (index f-imm16u) (handlers (parse "imm16") (print "dollarhex")))
! (define-operand (name imm16o) (comment "immediate value") (attrs PCREL-ADDR) 
!   (type h-uint) (index f-imm16s) (handlers (parse "imm16") (print "pcrel")))
  
  ; Operands for MorphoSys Instructions
  
***************
*** 490,495 ****
--- 534,557 ----
  (define-operand (name fbincr)	(comment "fb incr") (attrs)
    (type h-uint) (index f-fbincr) (handlers (print "dollarhex")))
  
+ ; For the ms2 insns
+ (define-operand (name loopsize) (comment "immediate value")
+   (attrs (MACH ms2) PCREL-ADDR)
+   (type h-uint) (index f-loopo) (handlers (parse "loopsize") (print "pcrel")))
+ (define-operand (name imm16l) (comment "immediate value")
+   (attrs (MACH ms2))
+   (type h-uint) (index f-imm16l) (handlers (print "dollarhex")))
+ (define-operand (name rc3) (comment "rc3") (attrs (MACH ms2))
+   (type h-uint) (index f-rc3) (handlers (parse "rc") (print "dollarhex")))
+ (define-operand (name cb1sel) (comment "cb1sel") (attrs (MACH ms2))
+   (type h-uint) (index f-cb1sel) (handlers (print "dollarhex")))
+ (define-operand (name cb2sel) (comment "cb2sel") (attrs (MACH ms2))
+   (type h-uint) (index f-cb2sel) (handlers (print "dollarhex")))
+ (define-operand (name cb1incr) (comment "cb1incr") (attrs (MACH ms2))
+   (type h-sint) (index f-cb1incr) (handlers (print "dollarhex")))
+ (define-operand (name cb2incr) (comment "cb2incr") (attrs (MACH ms2))
+   (type h-sint) (index f-cb2incr) (handlers (print "dollarhex")))
+ 
  ; Probaby won't need most of these.
  (define-pmacro r0    (reg h-spr #x0))
  (define-pmacro r1    (reg h-spr #x01))
***************
*** 594,600 ****
  )
  
  (dni mul "MUL DstReg, SrcReg1, SrcReg2"
!      (MACHMS1-003 AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2)
       "mul $frdrrr,$frsr1,$frsr2"
       (+ MSYS_NO OPC_MUL IMM_NO frsr1 frsr2 frdrrr (f-uu12 0))
       (sequence((HI op1) (HI op2))
--- 656,662 ----
  )
  
  (dni mul "MUL DstReg, SrcReg1, SrcReg2"
!      ((MACH ms1-003,ms2) AL-INSN USES-FRDRRR USES-FRSR1 USES-FRSR2)
       "mul $frdrrr,$frsr1,$frsr2"
       (+ MSYS_NO OPC_MUL IMM_NO frsr1 frsr2 frdrrr (f-uu12 0))
       (sequence((HI op1) (HI op2))
***************
*** 612,618 ****
  )
  
  (dni muli "MULI DstReg, SrcReg1, UnsImm"
!      (MACHMS1-003 AL-INSN USES-FRDR USES-FRSR1)
       "muli $frdr,$frsr1,#$imm16"
       (+ MSYS_NO OPC_MUL IMM_YES frsr1 frdr imm16)
       (sequence((HI op1) (HI op2))
--- 674,680 ----
  )
  
  (dni muli "MULI DstReg, SrcReg1, UnsImm"
!      ((MACH ms1-003,ms2) AL-INSN USES-FRDR USES-FRSR1)
       "muli $frdr,$frsr1,#$imm16"
       (+ MSYS_NO OPC_MUL IMM_YES frsr1 frdr imm16)
       (sequence((HI op1) (HI op2))
***************
*** 851,857 ****
  )
  
  (dni jal "JAL DstReg, SrcReg1"
!      (BR-INSN DELAY-SLOT BR-INSN USES-FRDR USES-FRSR1)
       "jal $frdrrr,$frsr1"
       (+ MSYS_NO OPC_JAL IMM_NO frsr1 (f-uu4a 0) frdrrr (f-uu12 0))
       (sequence()
--- 913,919 ----
  )
  
  (dni jal "JAL DstReg, SrcReg1"
!      (BR-INSN DELAY-SLOT BR-INSN USES-FRDR USES-FRSR1 JAL-HAZARD)
       "jal $frdrrr,$frsr1"
       (+ MSYS_NO OPC_JAL IMM_NO frsr1 (f-uu4a 0) frdrrr (f-uu12 0))
       (sequence()
***************
*** 867,873 ****
  )
  
  (dni dbnz "DBNZ SrcReg1, label"
!      (MACHMS1-003 BR-INSN DELAY-SLOT USES-FRSR1)
       "dbnz $frsr1,$imm16o"
       (+ MSYS_NO OPC_DBNZ IMM_YES frsr1 (f-uu4a 0) imm16o)
       (sequence()
--- 929,935 ----
  )
  
  (dni dbnz "DBNZ SrcReg1, label"
!      ((MACH ms1-003,ms2) BR-INSN DELAY-SLOT USES-FRSR1)
       "dbnz $frsr1,$imm16o"
       (+ MSYS_NO OPC_DBNZ IMM_YES frsr1 (f-uu4a 0) imm16o)
       (sequence()
***************
*** 913,919 ****
  )
  
  (dni reti "RETI SrcReg1"
!      (DELAY-SLOT BR-INSN USES-FRSR1)
       "reti $frsr1"
       (+ MSYS_NO OPC_RETI IMM_NO frsr1 (f-uu4a 0) (f-uu16 0))
       (sequence()
--- 975,981 ----
  )
  
  (dni reti "RETI SrcReg1"
!      (DELAY-SLOT BR-INSN USES-FRSR1 JAL-HAZARD)
       "reti $frsr1"
       (+ MSYS_NO OPC_RETI IMM_NO frsr1 (f-uu4a 0) (f-uu16 0))
       (sequence()
***************
*** 962,968 ****
  ; Cache Flush Instruction
  
  (dni iflush "IFLUSH"
!      (MACHMS1-003)
       "iflush"
       (+ MSYS_NO OPC_IFLUSH (f-imm 0) (f-uu24 0))
       (nop)
--- 1024,1030 ----
  ; Cache Flush Instruction
  
  (dni iflush "IFLUSH"
!      ((MACH ms1-003,ms2))
       "iflush"
       (+ MSYS_NO OPC_IFLUSH (f-imm 0) (f-uu24 0))
       (nop)
***************
*** 972,978 ****
  ; MorphoSys Instructions
  
  (dni ldctxt "LDCTXT SRC1, SRC2, r/c, r/c#, context#"
!      ()
       "ldctxt $frsr1,$frsr2,#$rc,#$rcnum,#$contnum"
       (+ MSYS_YES MSOPC_LDCTXT (f-uu-2-25 0) frsr1 frsr2 rc rcnum (f-uu-3-11 0)
  	contnum )
--- 1034,1040 ----
  ; MorphoSys Instructions
  
  (dni ldctxt "LDCTXT SRC1, SRC2, r/c, r/c#, context#"
!      ((MACH ms1))
       "ldctxt $frsr1,$frsr2,#$rc,#$rcnum,#$contnum"
       (+ MSYS_YES MSOPC_LDCTXT (f-uu-2-25 0) frsr1 frsr2 rc rcnum (f-uu-3-11 0)
  	contnum )
***************
*** 981,987 ****
  )
  
  (dni ldfb "LDFB SRC1, byte#"
!      ()
       "ldfb $frsr1,$frsr2,#$imm16z"
       (+ MSYS_YES MSOPC_LDFB (f-uu-2-25 0) frsr1 frsr2 imm16z)
       (nop)
--- 1043,1049 ----
  )
  
  (dni ldfb "LDFB SRC1, byte#"
!      ((MACH ms1))
       "ldfb $frsr1,$frsr2,#$imm16z"
       (+ MSYS_YES MSOPC_LDFB (f-uu-2-25 0) frsr1 frsr2 imm16z)
       (nop)
***************
*** 989,995 ****
  )
  
  (dni stfb "STFB SRC1, SRC2, byte "
!      ()
       "stfb $frsr1,$frsr2,#$imm16z"
       (+ MSYS_YES MSOPC_STFB (f-uu-2-25 0) frsr1 frsr2 imm16z)
       (nop)
--- 1051,1057 ----
  )
  
  (dni stfb "STFB SRC1, SRC2, byte "
!      ((MACH ms1))
       "stfb $frsr1,$frsr2,#$imm16z"
       (+ MSYS_YES MSOPC_STFB (f-uu-2-25 0) frsr1 frsr2 imm16z)
       (nop)
***************
*** 997,1003 ****
  )
  
  (dni fbcb "FBCB SRC1, RT/BR1/BR2/CS, B_all, B_r_c, r/c, CB/RB, cell, dup, ctx_disp"
!      ()
       "fbcb $frsr1,#$rbbc,#$ball,#$brc,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_FBCB rbbc frsr1 ball brc (f-uu-4-15 0) rc cbrb cell dup ctxdisp)
       (nop)
--- 1059,1065 ----
  )
  
  (dni fbcb "FBCB SRC1, RT/BR1/BR2/CS, B_all, B_r_c, r/c, CB/RB, cell, dup, ctx_disp"
!      ((MACH ms1,ms1-003))
       "fbcb $frsr1,#$rbbc,#$ball,#$brc,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_FBCB rbbc frsr1 ball brc (f-uu-4-15 0) rc cbrb cell dup ctxdisp)
       (nop)
***************
*** 1176,1182 ****
  ;; Issue 66262: The documenatation gives the wrong order for 
  ;;               the arguments to the WFBINC instruction.
  (dni wfbinc "WFBINC type, ccb/rcb, incr, all, c/r, length, rca_row, word, dup, ctxt_disp"
!      (MACHMS1-003)
       "wfbinc #$rda,#$wr,#$fbincr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_WFBINC rda wr fbincr ball colnum length rownum1 rownum2 dup ctxdisp)
       (nop)
--- 1238,1244 ----
  ;; Issue 66262: The documenatation gives the wrong order for 
  ;;               the arguments to the WFBINC instruction.
  (dni wfbinc "WFBINC type, ccb/rcb, incr, all, c/r, length, rca_row, word, dup, ctxt_disp"
!      ((MACH ms1-003,ms2))
       "wfbinc #$rda,#$wr,#$fbincr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_WFBINC rda wr fbincr ball colnum length rownum1 rownum2 dup ctxdisp)
       (nop)
***************
*** 1184,1190 ****
  )
  
  (dni mwfbinc "MWFBINC mreg, type, ccb/rcb, incr, length, rca_row, word, dup, ctxt_disp"
!      (MACHMS1-003)
       "mwfbinc $frsr2,#$rda,#$wr,#$fbincr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_MWFBINC rda wr fbincr frsr2 length rownum1 rownum2 dup ctxdisp)
       (nop)
--- 1246,1252 ----
  )
  
  (dni mwfbinc "MWFBINC mreg, type, ccb/rcb, incr, length, rca_row, word, dup, ctxt_disp"
!      ((MACH ms1-003,ms2))
       "mwfbinc $frsr2,#$rda,#$wr,#$fbincr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_MWFBINC rda wr fbincr frsr2 length rownum1 rownum2 dup ctxdisp)
       (nop)
***************
*** 1192,1198 ****
  )
  
  (dni wfbincr "WFBINCR ireg, type, ccb/rcb, all, c/r, length, rca_row, word, dup, ctxt_disp"
!      (MACHMS1-003)
       "wfbincr $frsr1,#$rda,#$wr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_WFBINCR rda wr frsr1 ball colnum length rownum1 rownum2 dup ctxdisp)
       (nop)
--- 1254,1260 ----
  )
  
  (dni wfbincr "WFBINCR ireg, type, ccb/rcb, all, c/r, length, rca_row, word, dup, ctxt_disp"
!      ((MACH ms1-003,ms2))
       "wfbincr $frsr1,#$rda,#$wr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_WFBINCR rda wr frsr1 ball colnum length rownum1 rownum2 dup ctxdisp)
       (nop)
***************
*** 1200,1206 ****
  )
  
  (dni mwfbincr "MWFBINCR ireg, mreg, type, ccb/rcb, length, rca_row, word, dup, ctxt_disp"
!      (MACHMS1-003)
       "mwfbincr $frsr1,$frsr2,#$rda,#$wr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_MWFBINCR rda wr frsr1 frsr2 length rownum1 rownum2 dup ctxdisp)
       (nop)
--- 1262,1268 ----
  )
  
  (dni mwfbincr "MWFBINCR ireg, mreg, type, ccb/rcb, length, rca_row, word, dup, ctxt_disp"
!      ((MACH ms1-003,ms2))
       "mwfbincr $frsr1,$frsr2,#$rda,#$wr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_MWFBINCR rda wr frsr1 frsr2 length rownum1 rownum2 dup ctxdisp)
       (nop)
***************
*** 1208,1214 ****
  )
  
  (dni fbcbincs "FBCBINCS	     perm, all, c/r, cbs, incr, ccb/rcb, cdb/rdb, word, dup, ctxt_disp"
!      (MACHMS1-003)
       "fbcbincs #$perm,#$a23,#$cr,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_FBCBINCS perm a23 cr cbs incr ccb cdb rownum2 dup ctxdisp)
       (nop)
--- 1270,1276 ----
  )
  
  (dni fbcbincs "FBCBINCS	     perm, all, c/r, cbs, incr, ccb/rcb, cdb/rdb, word, dup, ctxt_disp"
!      ((MACH ms1-003,ms2))
       "fbcbincs #$perm,#$a23,#$cr,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_FBCBINCS perm a23 cr cbs incr ccb cdb rownum2 dup ctxdisp)
       (nop)
***************
*** 1216,1222 ****
  )
  
  (dni mfbcbincs "MFBCBINCS		ireg, perm, cbs, incr, ccb/rcb, cdb/rdb, word, dup, ctxt_disp"
!      (MACHMS1-003)
       "mfbcbincs $frsr1,#$perm,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_MFBCBINCS perm frsr1 cbs incr ccb cdb rownum2 dup ctxdisp)
       (nop)
--- 1278,1284 ----
  )
  
  (dni mfbcbincs "MFBCBINCS		ireg, perm, cbs, incr, ccb/rcb, cdb/rdb, word, dup, ctxt_disp"
!      ((MACH ms1-003,ms2))
       "mfbcbincs $frsr1,#$perm,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_MFBCBINCS perm frsr1 cbs incr ccb cdb rownum2 dup ctxdisp)
       (nop)
***************
*** 1224,1230 ****
  )
  
  (dni fbcbincrs "FBCBINCRS	     ireg, perm, all, c/r, cbs, ccb/rcb, cdb/rdb, word, dup, ctxt_disp"
!      (MACHMS1-003)
       "fbcbincrs $frsr1,#$perm,#$ball,#$colnum,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_FBCBINCRS perm frsr1 ball colnum (f-uu-1-15 0) cbx ccb cdb rownum2 dup ctxdisp)
       (nop)
--- 1286,1292 ----
  )
  
  (dni fbcbincrs "FBCBINCRS	     ireg, perm, all, c/r, cbs, ccb/rcb, cdb/rdb, word, dup, ctxt_disp"
!      ((MACH ms1-003,ms2))
       "fbcbincrs $frsr1,#$perm,#$ball,#$colnum,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_FBCBINCRS perm frsr1 ball colnum (f-uu-1-15 0) cbx ccb cdb rownum2 dup ctxdisp)
       (nop)
***************
*** 1232,1240 ****
  )
  
  (dni mfbcbincrs "MFBCBINCRS ireg, mreg, perm, cbs, ccb/rcb, cdb/rdb, word, dup, ctxt_disp"
!      (MACHMS1-003)
       "mfbcbincrs $frsr1,$frsr2,#$perm,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_MFBCBINCRS perm frsr1 frsr2 (f-uu-1-15 0) cbx ccb cdb rownum2 dup ctxdisp)
       (nop)
       ()
  )
--- 1294,1351 ----
  )
  
  (dni mfbcbincrs "MFBCBINCRS ireg, mreg, perm, cbs, ccb/rcb, cdb/rdb, word, dup, ctxt_disp"
!      ((MACH ms1-003,ms2))
       "mfbcbincrs $frsr1,$frsr2,#$perm,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp"
       (+ MSYS_YES MSOPC_MFBCBINCRS perm frsr1 frsr2 (f-uu-1-15 0) cbx ccb cdb rownum2 dup ctxdisp)
       (nop)
       ()
  )
+ 
+ ; MS2 instructions
+ (dni loop "LOOP SrcReg1, label"
+      ((MACH ms2) DELAY-SLOT USES-FRSR1)
+      "loop $frsr1,$loopsize"
+      (+ MSYS_NO OPC_LOOP IMM_NO frsr1 (f-uu4a 0) (f-uu8 0) loopsize)
+      (nop)      ;; to be filled in
+      ()
+ )
+ 
+ (dni loopi "LOOPI niter, label"
+      ((MACH ms2) DELAY-SLOT)
+      "loopi #$imm16l,$loopsize"
+      (+ MSYS_NO OPC_LOOP IMM_YES imm16l loopsize)
+      (nop)      ;; to be filled in
+      ()
+ )
+ 
+ (dni dfbc "dfbc cb1sel,cb2sel,cb1inc,cb2inc,dr/c,cr/c,ctxdisp"
+      ((MACH ms2))
+      "dfbc #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc3,#$rc2,#$ctxdisp"
+      (+ MSYS_YES MSOPC_LDCTXT cb1sel cb2sel cb1incr cb2incr rc3 rc2 ctxdisp)
+      (nop)
+      ()
+ )
+ 
+ (dni dwfb "dwfb cb1sel,cb2sel,cb1inc,cb2inc,cr/c,ctxdisp"
+      ((MACH ms2))
+      "dwfb #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc2,#$ctxdisp"
+      (+ MSYS_YES MSOPC_LDFB cb1sel cb2sel cb1incr cb2incr (f-uu1 0) rc2 ctxdisp)
+      (nop)
+      ()
+ )
+ 
+ (dni fbwfb "fbwfb cb1sel,cb2sel,cb1inc,cb2inc,r0/1,cr/c,ctxdisp"
+      ((MACH ms2))
+      "fbwfb #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc3,#$rc2,#$ctxdisp"
+      (+ MSYS_YES MSOPC_STFB cb1sel cb2sel cb1incr cb2incr rc3 rc2 ctxdisp)
+      (nop)
+      ()
+ )
+ 
+ (dni dfbr "dfbr cb1sel,cb2sel,reg,W/O1,W/O2,mode,cr/c,ctxdisp"
+      ((MACH ms2) USES-FRSR2)
+      "dfbr #$cb1sel,#$cb2sel,$frsr2,#$length,#$rownum1,#$rownum2,#$rc2,#$ctxdisp"
+      (+ MSYS_YES MSOPC_FBCB cb1sel cb2sel frsr2 length rownum1 rownum2 rc2 ctxdisp)
+      (nop)
+      ()
+ )
Index: cpu/ms1.opc
===================================================================
RCS file: /cvs/src/src/cpu/ms1.opc,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ms1.opc
*** cpu/ms1.opc	14 Jul 2005 13:59:51 -0000	1.3
--- cpu/ms1.opc	7 Nov 2005 11:23:22 -0000
*************** signed_out_of_bounds (long val)
*** 101,106 ****
--- 101,131 ----
  }
  
  static const char *
+ parse_loopsize (CGEN_CPU_DESC cd,
+ 		const char **strp,
+ 		int opindex,
+ 		void *arg)
+ {
+   signed long * valuep = (signed long *) arg;
+   const char *errmsg;
+   bfd_reloc_code_real_type code = BFD_RELOC_NONE;
+   enum cgen_parse_operand_result result_type;
+   bfd_vma value;
+ 
+   /* Is it a control transfer instructions?  */ 
+   if (opindex == (CGEN_OPERAND_TYPE) MS1_OPERAND_LOOPSIZE)
+     {
+       code = BFD_RELOC_MS1_PCINSN8;
+       errmsg = cgen_parse_address (cd, strp, opindex, code,
+                                    & result_type, & value);
+       *valuep = value;
+       return errmsg;
+     }
+ 
+   abort ();
+ }
+ 
+ static const char *
  parse_imm16 (CGEN_CPU_DESC cd,
  	     const char **strp,
  	     int opindex,
*************** parse_imm16 (CGEN_CPU_DESC cd,
*** 129,135 ****
  
    /* If it's not a control transfer instruction, then
       we have to check for %OP relocating operators.  */
!   if (strncmp (*strp, "%hi16", 5) == 0)
      {
        *strp += 5;
        code = BFD_RELOC_HI16;
--- 154,162 ----
  
    /* If it's not a control transfer instruction, then
       we have to check for %OP relocating operators.  */
!   if (opindex == (CGEN_OPERAND_TYPE) MS1_OPERAND_IMM16L)
!     ;
!   else if (strncmp (*strp, "%hi16", 5) == 0)
      {
        *strp += 5;
        code = BFD_RELOC_HI16;
*************** parse_type (CGEN_CPU_DESC cd,
*** 411,416 ****
--- 438,444 ----
  
  /* -- dis.c */
  static void print_dollarhex (CGEN_CPU_DESC, PTR, long, unsigned, bfd_vma, int);
+ static void print_pcrel (CGEN_CPU_DESC, PTR, long, unsigned, bfd_vma, int);
  
  static void
  print_dollarhex (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
*************** print_dollarhex (CGEN_CPU_DESC cd ATTRIB
*** 428,433 ****
--- 456,471 ----
      print_normal (cd, dis_info, value, attrs, pc, length);
  }
  
+ static void
+ print_pcrel (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ 	     void * dis_info,
+ 	     long value,
+ 	     unsigned int attrs ATTRIBUTE_UNUSED,
+ 	     bfd_vma pc ATTRIBUTE_UNUSED,
+ 	     int length ATTRIBUTE_UNUSED)
+ {
+   print_address (cd, dis_info, value + pc, attrs, pc, length);
+ }
  
  /* -- */
  
Index: gas/config/tc-ms1.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ms1.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 tc-ms1.c
*** gas/config/tc-ms1.c	20 Sep 2005 18:24:47 -0000	1.2
--- gas/config/tc-ms1.c	7 Nov 2005 11:23:23 -0000
*************** const char * md_shortopts = "";
*** 84,90 ****
  
  /* Mach selected from command line.  */
  static int ms1_mach = bfd_mach_ms1;
! static unsigned ms1_mach_bitmask = 0;
  
  /* Flags to set in the elf header */
  static flagword ms1_flags = EF_MS1_CPU_MRISC;
--- 84,90 ----
  
  /* Mach selected from command line.  */
  static int ms1_mach = bfd_mach_ms1;
! static unsigned ms1_mach_bitmask = 1 << MACH_MS1;
  
  /* Flags to set in the elf header */
  static flagword ms1_flags = EF_MS1_CPU_MRISC;
*************** enum ms1_architectures
*** 94,100 ****
    {
      ms1_64_001,
      ms1_16_002,
!     ms1_16_003
    };
  
  /* MS1 architecture we are using for this output file.  */
--- 94,101 ----
    {
      ms1_64_001,
      ms1_16_002,
!     ms1_16_003,
!     ms2
    };
  
  /* MS1 architecture we are using for this output file.  */
*************** md_parse_option (int c ATTRIBUTE_UNUSED,
*** 127,132 ****
--- 128,140 ----
   	  ms1_mach_bitmask = 1 << MACH_MS1_003;
   	  ms1_arch = ms1_16_003;
   	}
+       else if (strcasecmp (arg, "MS2") == 0)
+  	{
+  	  ms1_flags = (ms1_flags & ~EF_MS1_CPU_MASK) | EF_MS1_CPU_MS2;
+  	  ms1_mach = bfd_mach_mrisc2;
+  	  ms1_mach_bitmask = 1 << MACH_MS2;
+  	  ms1_arch = ms2;
+  	}
      case OPTION_NO_SCHED_REST:
        no_scheduling_restrictions = 1;
        break;
*************** md_show_usage (FILE * stream)
*** 145,150 ****
--- 153,159 ----
    fprintf (stream, _("  -march=ms1-64-001         allow ms1-64-001 instructions (default) \n"));
    fprintf (stream, _("  -march=ms1-16-002         allow ms1-16-002 instructions \n"));
    fprintf (stream, _("  -march=ms1-16-003         allow ms1-16-003 instructions \n"));
+   fprintf (stream, _("  -march=ms2                allow ms2 instructions \n"));
    fprintf (stream, _("  -nosched                  disable scheduling restrictions \n"));
  }
  
*************** void
*** 176,181 ****
--- 185,191 ----
  md_assemble (char * str)
  {
    static long delayed_load_register = 0;
+   static long prev_delayed_load_register = 0;
    static int last_insn_had_delay_slot = 0;
    static int last_insn_in_noncond_delay_slot = 0;
    static int last_insn_has_load_delay = 0;
*************** md_assemble (char * str)
*** 241,246 ****
--- 251,274 ----
  		     insn.fields.f_sr2);
  	}
  
+       /* Detect JAL/RETI hazard */
+       if (ms1_mach == ms2
+ 	  && CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_JAL_HAZARD))
+ 	{
+ 	  if ((CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_USES_FRSR1)
+ 	       && insn.fields.f_sr1 == delayed_load_register)
+ 	      || (CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_USES_FRSR2)
+ 		  && insn.fields.f_sr2 == delayed_load_register))
+ 	    as_warn (_("operand references R%ld of previous instrutcion."),
+ 		     delayed_load_register);
+ 	  else if ((CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_USES_FRSR1)
+ 		    && insn.fields.f_sr1 == prev_delayed_load_register)
+ 		   || (CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_USES_FRSR2)
+ 		       && insn.fields.f_sr2 == prev_delayed_load_register))
+ 	    as_warn (_("operand references R%ld of instructcion before previous."),
+ 		     prev_delayed_load_register);
+ 	}
+       
        /* Detect data dependency between conditional branch instruction
           and an immediately preceding arithmetic or logical instruction.  */
        if (last_insn_was_arithmetic_or_logic
*************** md_assemble (char * str)
*** 287,292 ****
--- 315,322 ----
    CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_BR_INSN)
      && CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_USES_FRSR2);
    
+   prev_delayed_load_register = delayed_load_register;
+   
    if (CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_USES_FRDR))
       delayed_load_register = insn.fields.f_dr; 
    else if (CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_USES_FRDRRR))
*************** md_cgen_lookup_reloc (const CGEN_INSN * 
*** 381,386 ****
--- 411,422 ----
          result = fixP->fx_cgen.opinfo;
        fixP->fx_no_overflow = 1;
        break;
+     case MS1_OPERAND_LOOPSIZE:
+       result = BFD_RELOC_MS1_PCINSN8;
+       fixP->fx_pcrel = 1;
+       /* Adjust for the delay slot, which is not part of the loop  */
+       fixP->fx_offset -= 8;
+       break;
      default:
        result = BFD_RELOC_NONE;
        break;
Index: gas/testsuite/gas/ms1/allinsn.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ms1/allinsn.d,v
retrieving revision 1.1
diff -c -3 -p -r1.1 allinsn.d
*** gas/testsuite/gas/ms1/allinsn.d	5 Jul 2005 13:08:08 -0000	1.1
--- gas/testsuite/gas/ms1/allinsn.d	7 Nov 2005 11:23:25 -0000
*************** Disassembly of section .text:
*** 88,103 ****
    68:	25 00 00 00 	asri R0,R0,#\$0
  
  0000006c <brlt>:
!   6c:	31 00 00 00 	brlt R0,R0,\$0
  
  00000070 <brle>:
!   70:	33 00 00 00 	brle R0,R0,\$0
  
  00000074 <breq>:
!   74:	35 00 00 00 	breq R0,R0,\$0
  
  00000078 <jmp>:
!   78:	37 00 00 00 	jmp \$0
  
  0000007c <jal>:
    7c:	38 00 00 00 	jal R0,R0
--- 88,103 ----
    68:	25 00 00 00 	asri R0,R0,#\$0
  
  0000006c <brlt>:
!   6c:	31 00 00 00 	brlt R0,R0,6c <brlt>
  
  00000070 <brle>:
!   70:	33 00 00 00 	brle R0,R0,70 <brle>
  
  00000074 <breq>:
!   74:	35 00 00 00 	breq R0,R0,74 <breq>
  
  00000078 <jmp>:
!   78:	37 00 00 00 	jmp 78 <jmp>
  
  0000007c <jal>:
    7c:	38 00 00 00 	jal R0,R0
*************** Disassembly of section .text:
*** 121,127 ****
    94:	64 00 00 00 	si R0
  
  00000098 <brne>:
!   98:	3b 00 00 00 	brne R0,R0,\$0
  
  0000009c <break>:
    9c:	68 00 00 00 	break
--- 121,127 ----
    94:	64 00 00 00 	si R0
  
  00000098 <brne>:
!   98:	3b 00 00 00 	brne R0,R0,98 <brne>
  
  0000009c <break>:
    9c:	68 00 00 00 	break
Index: gas/testsuite/gas/ms1/errors.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ms1/errors.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 errors.exp
*** gas/testsuite/gas/ms1/errors.exp	5 Jul 2005 13:08:08 -0000	1.1
--- gas/testsuite/gas/ms1/errors.exp	7 Nov 2005 11:23:25 -0000
*************** proc mrisc1_error_test { file testname {
*** 27,33 ****
      }
  }
  
! if [istarget mrisc1*-*-*] {
      foreach file [glob -nocomplain -- $srcdir/$subdir/bad*.s] {
  	set file [file tail $file]
  	switch -- $file {
--- 27,33 ----
      }
  }
  
! if [istarget ms1-*-*] {
      foreach file [glob -nocomplain -- $srcdir/$subdir/bad*.s] {
  	set file [file tail $file]
  	switch -- $file {
Index: gas/testsuite/gas/ms1/ms1-16-003.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ms1/ms1-16-003.d,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ms1-16-003.d
*** gas/testsuite/gas/ms1/ms1-16-003.d	5 Jul 2005 13:08:08 -0000	1.1
--- gas/testsuite/gas/ms1/ms1-16-003.d	7 Nov 2005 11:23:25 -0000
*************** Disassembly of section .text:
*** 12,19 ****
     4:	08 00 00 00 	mul R0,R0,R0
  00000008 <muli>:
     8:	09 00 00 00 	muli R0,R0,#\$0
! 0000000c <dbnz>:
!    c:	3d 00 00 00 	dbnz R0,\$0
  [ 	]*c: R_MS1_PC16	dbnz
  00000010 <fbcbincs>:
    10:	f0 00 00 00 	fbcbincs #\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0
--- 12,19 ----
     4:	08 00 00 00 	mul R0,R0,R0
  00000008 <muli>:
     8:	09 00 00 00 	muli R0,R0,#\$0
! 0000000c <dbnz_>:
!    c:	3d 00 00 00 	dbnz R0,c <dbnz_>
  [ 	]*c: R_MS1_PC16	dbnz
  00000010 <fbcbincs>:
    10:	f0 00 00 00 	fbcbincs #\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0
Index: gas/testsuite/gas/ms1/ms1-16-003.s
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ms1/ms1-16-003.s,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ms1-16-003.s
*** gas/testsuite/gas/ms1/ms1-16-003.s	5 Jul 2005 13:08:08 -0000	1.1
--- gas/testsuite/gas/ms1/ms1-16-003.s	7 Nov 2005 11:23:25 -0000
*************** muli:
*** 12,18 ****
  	muli R0, R0, #0
  
  	.global dbnz
! dbnz:
  	dbnz	r0, dbnz
  
  	.global fbcbincs
--- 12,18 ----
  	muli R0, R0, #0
  
  	.global dbnz
! dbnz_:
  	dbnz	r0, dbnz
  
  	.global fbcbincs
Index: gas/testsuite/gas/ms1/ms1.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ms1/ms1.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ms1.exp
*** gas/testsuite/gas/ms1/ms1.exp	5 Jul 2005 13:08:08 -0000	1.1
--- gas/testsuite/gas/ms1/ms1.exp	7 Nov 2005 11:23:25 -0000
***************
*** 1,10 ****
  # MRISC1 assembler testsuite.
  
! if { [istarget mrisc1*-*-*] || [istarget ms1-*-*]} then {
      #
      run_dump_test "allinsn"
      run_dump_test "misc"
      run_dump_test "msys"
      run_dump_test "ms1-16-003"
      #
  }
--- 1,11 ----
  # MRISC1 assembler testsuite.
  
! if [istarget ms1*-*-*] {
      #
      run_dump_test "allinsn"
      run_dump_test "misc"
      run_dump_test "msys"
      run_dump_test "ms1-16-003"
+     run_dump_test "ms2"
      #
  }
Index: gas/testsuite/gas/ms1/ms2.d
===================================================================
RCS file: gas/testsuite/gas/ms1/ms2.d
diff -N gas/testsuite/gas/ms1/ms2.d
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gas/testsuite/gas/ms1/ms2.d	7 Nov 2005 11:23:25 -0000
***************
*** 0 ****
--- 1,18 ----
+ #as: -march=ms2
+ #objdump: -dr
+ #name: ms2
+ 
+ .*: +file format .*
+ 
+ Disassembly of section .text:
+ 
+ 00000000 <code>:
+    0:	3e 10 00 05 	loop R1,1c <label>
+    4:	3f 00 10 04 	loopi #\$10,1c <label>
+    8:	83 ff ff ff 	dfbc #\$7,#\$7,#\$ffffffff,#\$ffffffff,#\$1,#\$1,#\$3f
+    c:	87 ff ff 7f 	dwfb #\$7,#\$7,#\$ffffffff,#\$ffffffff,#\$1,#\$3f
+   10:	8b ff ff ff 	fbwfb #\$7,#\$7,#\$ffffffff,#\$ffffffff,#\$1,#\$1,#\$3f
+   14:	8f f0 ff ff 	dfbr #\$7,#\$7,R0,#\$7,#\$7,#\$7,#\$1,#\$3f
+   18:	12 00 00 00 	nop
+ 0000001c <label>:
+   1c:	f0 00 00 00 	fbcbincs #\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0,#\$0
Index: gas/testsuite/gas/ms1/ms2.s
===================================================================
RCS file: gas/testsuite/gas/ms1/ms2.s
diff -N gas/testsuite/gas/ms1/ms2.s
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- gas/testsuite/gas/ms1/ms2.s	7 Nov 2005 11:23:25 -0000
***************
*** 0 ****
--- 1,11 ----
+ 
+ code:	
+ 	loop R1, label
+ 	loopi #16,label
+ 	dfbc #7,#7,#-1,#-1,#1,#1,#63
+ 	dwfb #7,#7,#-1,#-1,#1,#63
+ 	fbwfb #7,#7,#-1,#-1,#1,#1,#63
+ 	dfbr #7,#7,R0,#7,#7,#7,#1,#63
+ 	nop
+ label:	 
+ 	fbcbincs  #0,#0,#0,#0,#0,#0,#0,#0,#0,#0
Index: gas/testsuite/gas/ms1/relocs.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ms1/relocs.d,v
retrieving revision 1.1
diff -c -3 -p -r1.1 relocs.d
*** gas/testsuite/gas/ms1/relocs.d	5 Jul 2005 13:08:08 -0000	1.1
--- gas/testsuite/gas/ms1/relocs.d	7 Nov 2005 11:23:25 -0000
***************
*** 1,8 ****
  
! relocs.x:     file format elf32-mrisc1
  
  Contents of section .text:
!  2000 00131000 37000004 12000000 3700fff8  ....7.......7...
   2010 03210000 03212215 03210001 03210000  .!...!"..!...!..
   2020 0321ffff 0321eeee 03210005 03210006  .!...!...!...!..
   2030 00675000                             .gP.            
--- 1,8 ----
  
! relocs.x:     file format elf32-(mrisc1|ms1)
  
  Contents of section .text:
!  2000 00131000 3700dffc 12000000 3700fff8  ....7.......7...
   2010 03210000 03212215 03210001 03210000  .!...!"..!...!..
   2020 0321ffff 0321eeee 03210005 03210006  .!...!...!...!..
   2030 00675000                             .gP.            
*************** Contents of section .data:
*** 38,55 ****
   22f4 00000000 00000000 00000000 00000000  ................
   2304 00000000 00000000 00000000 00000000  ................
   2314 000003                               ...             
! Contents of section .sbss:
  Disassembly of section .text:
  
  00002000 <_start>:
      2000:	00 13 10 00 	add R1,R1,R3
  
  00002004 <local>:
!     2004:	37 00 00 04 	jmp \$4
  
  00002008 <none>:
!     2008:	12 00 00 00 	or R0,R0,R0
!     200c:	37 00 ff f8 	jmp \$fffffff8
      2010:	03 21 00 00 	addui R1,R2,#\$0
      2014:	03 21 22 15 	addui R1,R2,#\$2215
      2018:	03 21 00 01 	addui R1,R2,#\$1
--- 38,56 ----
   22f4 00000000 00000000 00000000 00000000  ................
   2304 00000000 00000000 00000000 00000000  ................
   2314 000003                               ...             
! Contents of section .stack:
!  7ffff0 deaddead                             ....            
  Disassembly of section .text:
  
  00002000 <_start>:
      2000:	00 13 10 00 	add R1,R1,R3
  
  00002004 <local>:
!     2004:	37 00 df fc 	jmp 0 <_start-0x2000>
  
  00002008 <none>:
!     2008:	12 00 00 00 	nop
!     200c:	37 00 ff f8 	jmp 2004 <local>
      2010:	03 21 00 00 	addui R1,R2,#\$0
      2014:	03 21 22 15 	addui R1,R2,#\$2215
      2018:	03 21 00 01 	addui R1,R2,#\$1
Index: gas/testsuite/gas/ms1/relocs.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/ms1/relocs.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 relocs.exp
*** gas/testsuite/gas/ms1/relocs.exp	5 Jul 2005 13:08:08 -0000	1.1
--- gas/testsuite/gas/ms1/relocs.exp	7 Nov 2005 11:23:25 -0000
*************** proc regexp_test { file1 file2 test } {
*** 20,26 ****
  
  
  global srcdir subdir
! if [istarget mrisc1*-*-* || istarget ms1-*] {
      gas_test "relocs1.s" {-o relocs1.o} {} {assembling relocs1}
  
      #    gas_test "relocs2.s" {-o relocs2.o} {} {assembling relocs2}
--- 20,26 ----
  
  
  global srcdir subdir
! if [istarget ms1-*] {
      gas_test "relocs1.s" {-o relocs1.o} {} {assembling relocs1}
  
      #    gas_test "relocs2.s" {-o relocs2.o} {} {assembling relocs2}
Index: include/elf/ms1.h
===================================================================
RCS file: /cvs/src/src/include/elf/ms1.h,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ms1.h
*** include/elf/ms1.h	7 Jun 2005 21:10:08 -0000	1.1
--- include/elf/ms1.h	7 Nov 2005 11:23:25 -0000
*************** END_RELOC_NUMBERS(R_MS1_max)
*** 35,40 ****
--- 35,41 ----
  
  #define EF_MS1_CPU_MRISC	0x00000001	/* default */
  #define EF_MS1_CPU_MRISC2	0x00000002	/* MRISC2 */
+ #define EF_MS1_CPU_MS2		0x00000003      /* MS2 */
  #define EF_MS1_CPU_MASK		0x00000003	/* specific cpu bits */
  #define EF_MS1_ALL_FLAGS	(EF_MS1_CPU_MASK)
  
Index: opcodes/ms1-asm.c
===================================================================
RCS file: /cvs/src/src/opcodes/ms1-asm.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ms1-asm.c
*** opcodes/ms1-asm.c	5 Jul 2005 15:07:46 -0000	1.3
--- opcodes/ms1-asm.c	7 Nov 2005 11:23:27 -0000
*************** signed_out_of_bounds (long val)
*** 61,66 ****
--- 61,91 ----
  }
  
  static const char *
+ parse_loopsize (CGEN_CPU_DESC cd,
+ 		const char **strp,
+ 		int opindex,
+ 		void *arg)
+ {
+   signed long * valuep = (signed long *) arg;
+   const char *errmsg;
+   bfd_reloc_code_real_type code = BFD_RELOC_NONE;
+   enum cgen_parse_operand_result result_type;
+   bfd_vma value;
+ 
+   /* Is it a control transfer instructions?  */ 
+   if (opindex == (CGEN_OPERAND_TYPE) MS1_OPERAND_LOOPSIZE)
+     {
+       code = BFD_RELOC_MS1_PCINSN8;
+       errmsg = cgen_parse_address (cd, strp, opindex, code,
+                                    & result_type, & value);
+       *valuep = value;
+       return errmsg;
+     }
+ 
+   abort ();
+ }
+ 
+ static const char *
  parse_imm16 (CGEN_CPU_DESC cd,
  	     const char **strp,
  	     int opindex,
*************** parse_imm16 (CGEN_CPU_DESC cd,
*** 89,95 ****
  
    /* If it's not a control transfer instruction, then
       we have to check for %OP relocating operators.  */
!   if (strncmp (*strp, "%hi16", 5) == 0)
      {
        *strp += 5;
        code = BFD_RELOC_HI16;
--- 114,122 ----
  
    /* If it's not a control transfer instruction, then
       we have to check for %OP relocating operators.  */
!   if (opindex == (CGEN_OPERAND_TYPE) MS1_OPERAND_IMM16L)
!     ;
!   else if (strncmp (*strp, "%hi16", 5) == 0)
      {
        *strp += 5;
        code = BFD_RELOC_HI16;
*************** ms1_cgen_parse_operand (CGEN_CPU_DESC cd
*** 417,422 ****
--- 444,461 ----
      case MS1_OPERAND_BRC2 :
        errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_BRC2, (unsigned long *) (& fields->f_brc2));
        break;
+     case MS1_OPERAND_CB1INCR :
+       errmsg = cgen_parse_signed_integer (cd, strp, MS1_OPERAND_CB1INCR, (long *) (& fields->f_cb1incr));
+       break;
+     case MS1_OPERAND_CB1SEL :
+       errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CB1SEL, (unsigned long *) (& fields->f_cb1sel));
+       break;
+     case MS1_OPERAND_CB2INCR :
+       errmsg = cgen_parse_signed_integer (cd, strp, MS1_OPERAND_CB2INCR, (long *) (& fields->f_cb2incr));
+       break;
+     case MS1_OPERAND_CB2SEL :
+       errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_CB2SEL, (unsigned long *) (& fields->f_cb2sel));
+       break;
      case MS1_OPERAND_CBRB :
        errmsg = parse_cbrb (cd, strp, MS1_OPERAND_CBRB, (unsigned long *) (& fields->f_cbrb));
        break;
*************** ms1_cgen_parse_operand (CGEN_CPU_DESC cd
*** 474,479 ****
--- 513,521 ----
      case MS1_OPERAND_IMM16 :
        errmsg = parse_imm16 (cd, strp, MS1_OPERAND_IMM16, (long *) (& fields->f_imm16s));
        break;
+     case MS1_OPERAND_IMM16L :
+       errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_IMM16L, (unsigned long *) (& fields->f_imm16l));
+       break;
      case MS1_OPERAND_IMM16O :
        errmsg = parse_imm16 (cd, strp, MS1_OPERAND_IMM16O, (unsigned long *) (& fields->f_imm16s));
        break;
*************** ms1_cgen_parse_operand (CGEN_CPU_DESC cd
*** 489,494 ****
--- 531,539 ----
      case MS1_OPERAND_LENGTH :
        errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_LENGTH, (unsigned long *) (& fields->f_length));
        break;
+     case MS1_OPERAND_LOOPSIZE :
+       errmsg = parse_loopsize (cd, strp, MS1_OPERAND_LOOPSIZE, (unsigned long *) (& fields->f_loopo));
+       break;
      case MS1_OPERAND_MASK :
        errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_MASK, (unsigned long *) (& fields->f_mask));
        break;
*************** ms1_cgen_parse_operand (CGEN_CPU_DESC cd
*** 513,518 ****
--- 558,566 ----
      case MS1_OPERAND_RC2 :
        errmsg = parse_rc (cd, strp, MS1_OPERAND_RC2, (unsigned long *) (& fields->f_rc2));
        break;
+     case MS1_OPERAND_RC3 :
+       errmsg = parse_rc (cd, strp, MS1_OPERAND_RC3, (unsigned long *) (& fields->f_rc3));
+       break;
      case MS1_OPERAND_RCNUM :
        errmsg = cgen_parse_unsigned_integer (cd, strp, MS1_OPERAND_RCNUM, (unsigned long *) (& fields->f_rcnum));
        break;
Index: opcodes/ms1-desc.c
===================================================================
RCS file: /cvs/src/src/opcodes/ms1-desc.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ms1-desc.c
*** opcodes/ms1-desc.c	28 Oct 2005 19:49:22 -0000	1.3
--- opcodes/ms1-desc.c	7 Nov 2005 11:23:28 -0000
*************** static const CGEN_ATTR_ENTRY MACH_attr[]
*** 48,53 ****
--- 48,54 ----
    { "base", MACH_BASE },
    { "ms1", MACH_MS1 },
    { "ms1_003", MACH_MS1_003 },
+   { "ms2", MACH_MS2 },
    { "max", MACH_MAX },
    { 0, 0 }
  };
*************** const CGEN_ATTR_TABLE ms1_cgen_insn_attr
*** 113,118 ****
--- 114,120 ----
    { "AL-INSN", &bool_attr[0], &bool_attr[0] },
    { "IO-INSN", &bool_attr[0], &bool_attr[0] },
    { "BR-INSN", &bool_attr[0], &bool_attr[0] },
+   { "JAL-HAZARD", &bool_attr[0], &bool_attr[0] },
    { "USES-FRDR", &bool_attr[0], &bool_attr[0] },
    { "USES-FRDRRR", &bool_attr[0], &bool_attr[0] },
    { "USES-FRSR1", &bool_attr[0], &bool_attr[0] },
*************** static const CGEN_ISA ms1_cgen_isa_table
*** 133,138 ****
--- 135,141 ----
  static const CGEN_MACH ms1_cgen_mach_table[] = {
    { "ms1", "ms1", MACH_MS1, 0 },
    { "ms1-003", "ms1-003", MACH_MS1_003, 0 },
+   { "ms2", "ms2", MACH_MS2, 0 },
    { 0, 0, 0, 0 }
  };
  
*************** const CGEN_IFLD ms1_cgen_ifld_table[] =
*** 230,236 ****
--- 233,241 ----
    { MS1_F_UU4A, "f-uu4a", 0, 32, 19, 4, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_UU4B, "f-uu4b", 0, 32, 23, 4, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_UU12, "f-uu12", 0, 32, 11, 12, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_UU8, "f-uu8", 0, 32, 15, 8, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_UU16, "f-uu16", 0, 32, 15, 16, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_UU1, "f-uu1", 0, 32, 7, 1, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_MSOPC, "f-msopc", 0, 32, 30, 5, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_UU_26_25, "f-uu-26-25", 0, 32, 25, 26, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_MASK, "f-mask", 0, 32, 25, 16, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
*************** const CGEN_IFLD ms1_cgen_ifld_table[] =
*** 280,285 ****
--- 285,297 ----
    { MS1_F_DUP, "f-dup", 0, 32, 6, 1, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_RC2, "f-rc2", 0, 32, 6, 1, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_CTXDISP, "f-ctxdisp", 0, 32, 5, 6, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_IMM16L, "f-imm16l", 0, 32, 23, 16, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_LOOPO, "f-loopo", 0, 32, 7, 8, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_CB1SEL, "f-cb1sel", 0, 32, 25, 3, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_CB2SEL, "f-cb2sel", 0, 32, 22, 3, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_CB1INCR, "f-cb1incr", 0, 32, 19, 6, { 0|A(SIGNED), { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_CB2INCR, "f-cb2incr", 0, 32, 13, 6, { 0|A(SIGNED), { { { (1<<MACH_BASE), 0 } } } }  },
+   { MS1_F_RC3, "f-rc3", 0, 32, 7, 1, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_MSYSFRSR2, "f-msysfrsr2", 0, 32, 19, 4, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_BRC2, "f-brc2", 0, 32, 14, 3, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
    { MS1_F_BALL2, "f-ball2", 0, 32, 15, 1, { 0, { { { (1<<MACH_BASE), 0 } } } }  },
*************** const CGEN_OPERAND ms1_cgen_operand_tabl
*** 343,349 ****
  /* imm16o: immediate value */
    { "imm16o", MS1_OPERAND_IMM16O, HW_H_UINT, 15, 16,
      { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_IMM16S] } }, 
!     { 0, { { { (1<<MACH_BASE), 0 } } } }  },
  /* rc: rc */
    { "rc", MS1_OPERAND_RC, HW_H_UINT, 15, 1,
      { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_RC] } }, 
--- 355,361 ----
  /* imm16o: immediate value */
    { "imm16o", MS1_OPERAND_IMM16O, HW_H_UINT, 15, 16,
      { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_IMM16S] } }, 
!     { 0|A(PCREL_ADDR), { { { (1<<MACH_BASE), 0 } } } }  },
  /* rc: rc */
    { "rc", MS1_OPERAND_RC, HW_H_UINT, 15, 1,
      { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_RC] } }, 
*************** const CGEN_OPERAND ms1_cgen_operand_tabl
*** 504,509 ****
--- 516,549 ----
    { "fbincr", MS1_OPERAND_FBINCR, HW_H_UINT, 23, 4,
      { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_FBINCR] } }, 
      { 0, { { { (1<<MACH_BASE), 0 } } } }  },
+ /* loopsize: immediate value */
+   { "loopsize", MS1_OPERAND_LOOPSIZE, HW_H_UINT, 7, 8,
+     { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_LOOPO] } }, 
+     { 0|A(PCREL_ADDR), { { { (1<<MACH_MS2), 0 } } } }  },
+ /* imm16l: immediate value */
+   { "imm16l", MS1_OPERAND_IMM16L, HW_H_UINT, 23, 16,
+     { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_IMM16L] } }, 
+     { 0, { { { (1<<MACH_MS2), 0 } } } }  },
+ /* rc3: rc3 */
+   { "rc3", MS1_OPERAND_RC3, HW_H_UINT, 7, 1,
+     { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_RC3] } }, 
+     { 0, { { { (1<<MACH_MS2), 0 } } } }  },
+ /* cb1sel: cb1sel */
+   { "cb1sel", MS1_OPERAND_CB1SEL, HW_H_UINT, 25, 3,
+     { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_CB1SEL] } }, 
+     { 0, { { { (1<<MACH_MS2), 0 } } } }  },
+ /* cb2sel: cb2sel */
+   { "cb2sel", MS1_OPERAND_CB2SEL, HW_H_UINT, 22, 3,
+     { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_CB2SEL] } }, 
+     { 0, { { { (1<<MACH_MS2), 0 } } } }  },
+ /* cb1incr: cb1incr */
+   { "cb1incr", MS1_OPERAND_CB1INCR, HW_H_SINT, 19, 6,
+     { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_CB1INCR] } }, 
+     { 0|A(SIGNED), { { { (1<<MACH_MS2), 0 } } } }  },
+ /* cb2incr: cb2incr */
+   { "cb2incr", MS1_OPERAND_CB2INCR, HW_H_SINT, 13, 6,
+     { 0, { (const PTR) &ms1_cgen_ifld_table[MS1_F_CB2INCR] } }, 
+     { 0|A(SIGNED), { { { (1<<MACH_MS2), 0 } } } }  },
  /* sentinel */
    { 0, 0, 0, 0, 0,
      { 0, { (const PTR) 0 } },
*************** static const CGEN_IBASE ms1_cgen_insn_ta
*** 571,582 ****
  /* mul $frdrrr,$frsr1,$frsr2 */
    {
      MS1_INSN_MUL, "mul", "mul", 32,
!     { 0|A(USES_FRSR2)|A(USES_FRSR1)|A(USES_FRDRRR)|A(AL_INSN), { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* muli $frdr,$frsr1,#$imm16 */
    {
      MS1_INSN_MULI, "muli", "muli", 32,
!     { 0|A(USES_FRSR1)|A(USES_FRDR)|A(AL_INSN), { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* and $frdrrr,$frsr1,$frsr2 */
    {
--- 611,622 ----
  /* mul $frdrrr,$frsr1,$frsr2 */
    {
      MS1_INSN_MUL, "mul", "mul", 32,
!     { 0|A(USES_FRSR2)|A(USES_FRSR1)|A(USES_FRDRRR)|A(AL_INSN), { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* muli $frdr,$frsr1,#$imm16 */
    {
      MS1_INSN_MULI, "muli", "muli", 32,
!     { 0|A(USES_FRSR1)|A(USES_FRDR)|A(AL_INSN), { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* and $frdrrr,$frsr1,$frsr2 */
    {
*************** static const CGEN_IBASE ms1_cgen_insn_ta
*** 706,717 ****
  /* jal $frdrrr,$frsr1 */
    {
      MS1_INSN_JAL, "jal", "jal", 32,
!     { 0|A(USES_FRSR1)|A(USES_FRDR)|A(BR_INSN)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
    },
  /* dbnz $frsr1,$imm16o */
    {
      MS1_INSN_DBNZ, "dbnz", "dbnz", 32,
!     { 0|A(USES_FRSR1)|A(DELAY_SLOT)|A(BR_INSN), { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* ei */
    {
--- 746,757 ----
  /* jal $frdrrr,$frsr1 */
    {
      MS1_INSN_JAL, "jal", "jal", 32,
!     { 0|A(JAL_HAZARD)|A(USES_FRSR1)|A(USES_FRDR)|A(BR_INSN)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
    },
  /* dbnz $frsr1,$imm16o */
    {
      MS1_INSN_DBNZ, "dbnz", "dbnz", 32,
!     { 0|A(USES_FRSR1)|A(DELAY_SLOT)|A(BR_INSN), { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* ei */
    {
*************** static const CGEN_IBASE ms1_cgen_insn_ta
*** 731,737 ****
  /* reti $frsr1 */
    {
      MS1_INSN_RETI, "reti", "reti", 32,
!     { 0|A(USES_FRSR1)|A(BR_INSN)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
    },
  /* ldw $frdr,$frsr1,#$imm16 */
    {
--- 771,777 ----
  /* reti $frsr1 */
    {
      MS1_INSN_RETI, "reti", "reti", 32,
!     { 0|A(JAL_HAZARD)|A(USES_FRSR1)|A(BR_INSN)|A(DELAY_SLOT), { { { (1<<MACH_BASE), 0 } } } }
    },
  /* ldw $frdr,$frsr1,#$imm16 */
    {
*************** static const CGEN_IBASE ms1_cgen_insn_ta
*** 751,777 ****
  /* iflush */
    {
      MS1_INSN_IFLUSH, "iflush", "iflush", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* ldctxt $frsr1,$frsr2,#$rc,#$rcnum,#$contnum */
    {
      MS1_INSN_LDCTXT, "ldctxt", "ldctxt", 32,
!     { 0, { { { (1<<MACH_BASE), 0 } } } }
    },
  /* ldfb $frsr1,$frsr2,#$imm16z */
    {
      MS1_INSN_LDFB, "ldfb", "ldfb", 32,
!     { 0, { { { (1<<MACH_BASE), 0 } } } }
    },
  /* stfb $frsr1,$frsr2,#$imm16z */
    {
      MS1_INSN_STFB, "stfb", "stfb", 32,
!     { 0, { { { (1<<MACH_BASE), 0 } } } }
    },
  /* fbcb $frsr1,#$rbbc,#$ball,#$brc,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */
    {
      MS1_INSN_FBCB, "fbcb", "fbcb", 32,
!     { 0, { { { (1<<MACH_BASE), 0 } } } }
    },
  /* mfbcb $frsr1,#$rbbc,$frsr2,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */
    {
--- 791,817 ----
  /* iflush */
    {
      MS1_INSN_IFLUSH, "iflush", "iflush", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* ldctxt $frsr1,$frsr2,#$rc,#$rcnum,#$contnum */
    {
      MS1_INSN_LDCTXT, "ldctxt", "ldctxt", 32,
!     { 0, { { { (1<<MACH_MS1), 0 } } } }
    },
  /* ldfb $frsr1,$frsr2,#$imm16z */
    {
      MS1_INSN_LDFB, "ldfb", "ldfb", 32,
!     { 0, { { { (1<<MACH_MS1), 0 } } } }
    },
  /* stfb $frsr1,$frsr2,#$imm16z */
    {
      MS1_INSN_STFB, "stfb", "stfb", 32,
!     { 0, { { { (1<<MACH_MS1), 0 } } } }
    },
  /* fbcb $frsr1,#$rbbc,#$ball,#$brc,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */
    {
      MS1_INSN_FBCB, "fbcb", "fbcb", 32,
!     { 0, { { { (1<<MACH_MS1)|(1<<MACH_MS1_003), 0 } } } }
    },
  /* mfbcb $frsr1,#$rbbc,$frsr2,#$rc1,#$cbrb,#$cell,#$dup,#$ctxdisp */
    {
*************** static const CGEN_IBASE ms1_cgen_insn_ta
*** 876,917 ****
  /* wfbinc #$rda,#$wr,#$fbincr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_WFBINC, "wfbinc", "wfbinc", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* mwfbinc $frsr2,#$rda,#$wr,#$fbincr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_MWFBINC, "mwfbinc", "mwfbinc", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* wfbincr $frsr1,#$rda,#$wr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_WFBINCR, "wfbincr", "wfbincr", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* mwfbincr $frsr1,$frsr2,#$rda,#$wr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_MWFBINCR, "mwfbincr", "mwfbincr", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* fbcbincs #$perm,#$a23,#$cr,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_FBCBINCS, "fbcbincs", "fbcbincs", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* mfbcbincs $frsr1,#$perm,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_MFBCBINCS, "mfbcbincs", "mfbcbincs", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* fbcbincrs $frsr1,#$perm,#$ball,#$colnum,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_FBCBINCRS, "fbcbincrs", "fbcbincrs", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  /* mfbcbincrs $frsr1,$frsr2,#$perm,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_MFBCBINCRS, "mfbcbincrs", "mfbcbincrs", 32,
!     { 0, { { { (1<<MACH_MS1_003), 0 } } } }
    },
  };
  
--- 916,987 ----
  /* wfbinc #$rda,#$wr,#$fbincr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_WFBINC, "wfbinc", "wfbinc", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* mwfbinc $frsr2,#$rda,#$wr,#$fbincr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_MWFBINC, "mwfbinc", "mwfbinc", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* wfbincr $frsr1,#$rda,#$wr,#$ball,#$colnum,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_WFBINCR, "wfbincr", "wfbincr", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* mwfbincr $frsr1,$frsr2,#$rda,#$wr,#$length,#$rownum1,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_MWFBINCR, "mwfbincr", "mwfbincr", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* fbcbincs #$perm,#$a23,#$cr,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_FBCBINCS, "fbcbincs", "fbcbincs", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* mfbcbincs $frsr1,#$perm,#$cbs,#$incr,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_MFBCBINCS, "mfbcbincs", "mfbcbincs", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* fbcbincrs $frsr1,#$perm,#$ball,#$colnum,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_FBCBINCRS, "fbcbincrs", "fbcbincrs", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
    },
  /* mfbcbincrs $frsr1,$frsr2,#$perm,#$cbx,#$ccb,#$cdb,#$rownum2,#$dup,#$ctxdisp */
    {
      MS1_INSN_MFBCBINCRS, "mfbcbincrs", "mfbcbincrs", 32,
!     { 0, { { { (1<<MACH_MS1_003)|(1<<MACH_MS2), 0 } } } }
!   },
! /* loop $frsr1,$loopsize */
!   {
!     MS1_INSN_LOOP, "loop", "loop", 32,
!     { 0|A(USES_FRSR1)|A(DELAY_SLOT), { { { (1<<MACH_MS2), 0 } } } }
!   },
! /* loopi #$imm16l,$loopsize */
!   {
!     MS1_INSN_LOOPI, "loopi", "loopi", 32,
!     { 0|A(DELAY_SLOT), { { { (1<<MACH_MS2), 0 } } } }
!   },
! /* dfbc #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc3,#$rc2,#$ctxdisp */
!   {
!     MS1_INSN_DFBC, "dfbc", "dfbc", 32,
!     { 0, { { { (1<<MACH_MS2), 0 } } } }
!   },
! /* dwfb #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc2,#$ctxdisp */
!   {
!     MS1_INSN_DWFB, "dwfb", "dwfb", 32,
!     { 0, { { { (1<<MACH_MS2), 0 } } } }
!   },
! /* fbwfb #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc3,#$rc2,#$ctxdisp */
!   {
!     MS1_INSN_FBWFB, "fbwfb", "fbwfb", 32,
!     { 0, { { { (1<<MACH_MS2), 0 } } } }
!   },
! /* dfbr #$cb1sel,#$cb2sel,$frsr2,#$length,#$rownum1,#$rownum2,#$rc2,#$ctxdisp */
!   {
!     MS1_INSN_DFBR, "dfbr", "dfbr", 32,
!     { 0|A(USES_FRSR2), { { { (1<<MACH_MS2), 0 } } } }
    },
  };
  
Index: opcodes/ms1-desc.h
===================================================================
RCS file: /cvs/src/src/opcodes/ms1-desc.h,v
retrieving revision 1.2
diff -c -3 -p -r1.2 ms1-desc.h
*** opcodes/ms1-desc.h	28 Oct 2005 19:49:22 -0000	1.2
--- opcodes/ms1-desc.h	7 Nov 2005 11:23:28 -0000
*************** with this program; if not, write to the 
*** 40,45 ****
--- 40,46 ----
  /* Selected cpu families.  */
  #define HAVE_CPU_MS1BF
  #define HAVE_CPU_MS1_003BF
+ #define HAVE_CPU_MS2BF
  
  #define CGEN_INSN_LSB0_P 1
  
*************** typedef enum insn_opc {
*** 76,84 ****
   , OPC_NAND = 11, OPC_NOR = 12, OPC_XNOR = 13, OPC_LDUI = 14
   , OPC_LSL = 16, OPC_LSR = 17, OPC_ASR = 18, OPC_BRLT = 24
   , OPC_BRLE = 25, OPC_BREQ = 26, OPC_JMP = 27, OPC_JAL = 28
!  , OPC_BRNEQ = 29, OPC_DBNZ = 30, OPC_LDW = 32, OPC_STW = 33
!  , OPC_EI = 48, OPC_DI = 49, OPC_SI = 50, OPC_RETI = 51
!  , OPC_BREAK = 52, OPC_IFLUSH = 53
  } INSN_OPC;
  
  /* Enum declaration for msopc enums.  */
--- 77,85 ----
   , OPC_NAND = 11, OPC_NOR = 12, OPC_XNOR = 13, OPC_LDUI = 14
   , OPC_LSL = 16, OPC_LSR = 17, OPC_ASR = 18, OPC_BRLT = 24
   , OPC_BRLE = 25, OPC_BREQ = 26, OPC_JMP = 27, OPC_JAL = 28
!  , OPC_BRNEQ = 29, OPC_DBNZ = 30, OPC_LOOP = 31, OPC_LDW = 32
!  , OPC_STW = 33, OPC_EI = 48, OPC_DI = 49, OPC_SI = 50
!  , OPC_RETI = 51, OPC_BREAK = 52, OPC_IFLUSH = 53
  } INSN_OPC;
  
  /* Enum declaration for msopc enums.  */
*************** typedef enum msys_syms {
*** 107,113 ****
  
  /* Enum declaration for machine type selection.  */
  typedef enum mach_attr {
!   MACH_BASE, MACH_MS1, MACH_MS1_003, MACH_MAX
  } MACH_ATTR;
  
  /* Enum declaration for instruction set selection.  */
--- 108,115 ----
  
  /* Enum declaration for machine type selection.  */
  typedef enum mach_attr {
!   MACH_BASE, MACH_MS1, MACH_MS1_003, MACH_MS2
!  , MACH_MAX
  } MACH_ATTR;
  
  /* Enum declaration for instruction set selection.  */
*************** typedef enum ifield_type {
*** 148,167 ****
   , MS1_F_IMM, MS1_F_UU24, MS1_F_SR1, MS1_F_SR2
   , MS1_F_DR, MS1_F_DRRR, MS1_F_IMM16U, MS1_F_IMM16S
   , MS1_F_IMM16A, MS1_F_UU4A, MS1_F_UU4B, MS1_F_UU12
!  , MS1_F_UU16, MS1_F_MSOPC, MS1_F_UU_26_25, MS1_F_MASK
!  , MS1_F_BANKADDR, MS1_F_RDA, MS1_F_UU_2_25, MS1_F_RBBC
!  , MS1_F_PERM, MS1_F_MODE, MS1_F_UU_1_24, MS1_F_WR
!  , MS1_F_FBINCR, MS1_F_UU_2_23, MS1_F_XMODE, MS1_F_A23
!  , MS1_F_MASK1, MS1_F_CR, MS1_F_TYPE, MS1_F_INCAMT
!  , MS1_F_CBS, MS1_F_UU_1_19, MS1_F_BALL, MS1_F_COLNUM
!  , MS1_F_BRC, MS1_F_INCR, MS1_F_FBDISP, MS1_F_UU_4_15
!  , MS1_F_LENGTH, MS1_F_UU_1_15, MS1_F_RC, MS1_F_RCNUM
!  , MS1_F_ROWNUM, MS1_F_CBX, MS1_F_ID, MS1_F_SIZE
!  , MS1_F_ROWNUM1, MS1_F_UU_3_11, MS1_F_RC1, MS1_F_CCB
!  , MS1_F_CBRB, MS1_F_CDB, MS1_F_ROWNUM2, MS1_F_CELL
!  , MS1_F_UU_3_9, MS1_F_CONTNUM, MS1_F_UU_1_6, MS1_F_DUP
!  , MS1_F_RC2, MS1_F_CTXDISP, MS1_F_MSYSFRSR2, MS1_F_BRC2
!  , MS1_F_BALL2, MS1_F_MAX
  } IFIELD_TYPE;
  
  #define MAX_IFLD ((int) MS1_F_MAX)
--- 150,171 ----
   , MS1_F_IMM, MS1_F_UU24, MS1_F_SR1, MS1_F_SR2
   , MS1_F_DR, MS1_F_DRRR, MS1_F_IMM16U, MS1_F_IMM16S
   , MS1_F_IMM16A, MS1_F_UU4A, MS1_F_UU4B, MS1_F_UU12
!  , MS1_F_UU8, MS1_F_UU16, MS1_F_UU1, MS1_F_MSOPC
!  , MS1_F_UU_26_25, MS1_F_MASK, MS1_F_BANKADDR, MS1_F_RDA
!  , MS1_F_UU_2_25, MS1_F_RBBC, MS1_F_PERM, MS1_F_MODE
!  , MS1_F_UU_1_24, MS1_F_WR, MS1_F_FBINCR, MS1_F_UU_2_23
!  , MS1_F_XMODE, MS1_F_A23, MS1_F_MASK1, MS1_F_CR
!  , MS1_F_TYPE, MS1_F_INCAMT, MS1_F_CBS, MS1_F_UU_1_19
!  , MS1_F_BALL, MS1_F_COLNUM, MS1_F_BRC, MS1_F_INCR
!  , MS1_F_FBDISP, MS1_F_UU_4_15, MS1_F_LENGTH, MS1_F_UU_1_15
!  , MS1_F_RC, MS1_F_RCNUM, MS1_F_ROWNUM, MS1_F_CBX
!  , MS1_F_ID, MS1_F_SIZE, MS1_F_ROWNUM1, MS1_F_UU_3_11
!  , MS1_F_RC1, MS1_F_CCB, MS1_F_CBRB, MS1_F_CDB
!  , MS1_F_ROWNUM2, MS1_F_CELL, MS1_F_UU_3_9, MS1_F_CONTNUM
!  , MS1_F_UU_1_6, MS1_F_DUP, MS1_F_RC2, MS1_F_CTXDISP
!  , MS1_F_IMM16L, MS1_F_LOOPO, MS1_F_CB1SEL, MS1_F_CB2SEL
!  , MS1_F_CB1INCR, MS1_F_CB2INCR, MS1_F_RC3, MS1_F_MSYSFRSR2
!  , MS1_F_BRC2, MS1_F_BALL2, MS1_F_MAX
  } IFIELD_TYPE;
  
  #define MAX_IFLD ((int) MS1_F_MAX)
*************** typedef enum cgen_operand_type {
*** 229,239 ****
   , MS1_OPERAND_A23, MS1_OPERAND_CR, MS1_OPERAND_CBS, MS1_OPERAND_INCR
   , MS1_OPERAND_LENGTH, MS1_OPERAND_CBX, MS1_OPERAND_CCB, MS1_OPERAND_CDB
   , MS1_OPERAND_MODE, MS1_OPERAND_ID, MS1_OPERAND_SIZE, MS1_OPERAND_FBINCR
!  , MS1_OPERAND_MAX
  } CGEN_OPERAND_TYPE;
  
  /* Number of operands types.  */
! #define MAX_OPERANDS 48
  
  /* Maximum number of operands referenced by any insn.  */
  #define MAX_OPERAND_INSTANCES 8
--- 233,244 ----
   , MS1_OPERAND_A23, MS1_OPERAND_CR, MS1_OPERAND_CBS, MS1_OPERAND_INCR
   , MS1_OPERAND_LENGTH, MS1_OPERAND_CBX, MS1_OPERAND_CCB, MS1_OPERAND_CDB
   , MS1_OPERAND_MODE, MS1_OPERAND_ID, MS1_OPERAND_SIZE, MS1_OPERAND_FBINCR
!  , MS1_OPERAND_LOOPSIZE, MS1_OPERAND_IMM16L, MS1_OPERAND_RC3, MS1_OPERAND_CB1SEL
!  , MS1_OPERAND_CB2SEL, MS1_OPERAND_CB1INCR, MS1_OPERAND_CB2INCR, MS1_OPERAND_MAX
  } CGEN_OPERAND_TYPE;
  
  /* Number of operands types.  */
! #define MAX_OPERANDS 55
  
  /* Maximum number of operands referenced by any insn.  */
  #define MAX_OPERAND_INSTANCES 8
*************** typedef enum cgen_insn_attr {
*** 245,253 ****
    CGEN_INSN_ALIAS, CGEN_INSN_VIRTUAL, CGEN_INSN_UNCOND_CTI, CGEN_INSN_COND_CTI
   , CGEN_INSN_SKIP_CTI, CGEN_INSN_DELAY_SLOT, CGEN_INSN_RELAXABLE, CGEN_INSN_RELAXED
   , CGEN_INSN_NO_DIS, CGEN_INSN_PBB, CGEN_INSN_LOAD_DELAY, CGEN_INSN_MEMORY_ACCESS
!  , CGEN_INSN_AL_INSN, CGEN_INSN_IO_INSN, CGEN_INSN_BR_INSN, CGEN_INSN_USES_FRDR
!  , CGEN_INSN_USES_FRDRRR, CGEN_INSN_USES_FRSR1, CGEN_INSN_USES_FRSR2, CGEN_INSN_SKIPA
!  , CGEN_INSN_END_BOOLS, CGEN_INSN_START_NBOOLS = 31, CGEN_INSN_MACH, CGEN_INSN_END_NBOOLS
  } CGEN_INSN_ATTR;
  
  /* Number of non-boolean elements in cgen_insn_attr.  */
--- 250,259 ----
    CGEN_INSN_ALIAS, CGEN_INSN_VIRTUAL, CGEN_INSN_UNCOND_CTI, CGEN_INSN_COND_CTI
   , CGEN_INSN_SKIP_CTI, CGEN_INSN_DELAY_SLOT, CGEN_INSN_RELAXABLE, CGEN_INSN_RELAXED
   , CGEN_INSN_NO_DIS, CGEN_INSN_PBB, CGEN_INSN_LOAD_DELAY, CGEN_INSN_MEMORY_ACCESS
!  , CGEN_INSN_AL_INSN, CGEN_INSN_IO_INSN, CGEN_INSN_BR_INSN, CGEN_INSN_JAL_HAZARD
!  , CGEN_INSN_USES_FRDR, CGEN_INSN_USES_FRDRRR, CGEN_INSN_USES_FRSR1, CGEN_INSN_USES_FRSR2
!  , CGEN_INSN_SKIPA, CGEN_INSN_END_BOOLS, CGEN_INSN_START_NBOOLS = 31, CGEN_INSN_MACH
!  , CGEN_INSN_END_NBOOLS
  } CGEN_INSN_ATTR;
  
  /* Number of non-boolean elements in cgen_insn_attr.  */
*************** typedef enum cgen_insn_attr {
*** 270,275 ****
--- 276,282 ----
  #define CGEN_ATTR_CGEN_INSN_AL_INSN_VALUE(attrs) (((attrs)->bool & (1 << CGEN_INSN_AL_INSN)) != 0)
  #define CGEN_ATTR_CGEN_INSN_IO_INSN_VALUE(attrs) (((attrs)->bool & (1 << CGEN_INSN_IO_INSN)) != 0)
  #define CGEN_ATTR_CGEN_INSN_BR_INSN_VALUE(attrs) (((attrs)->bool & (1 << CGEN_INSN_BR_INSN)) != 0)
+ #define CGEN_ATTR_CGEN_INSN_JAL_HAZARD_VALUE(attrs) (((attrs)->bool & (1 << CGEN_INSN_JAL_HAZARD)) != 0)
  #define CGEN_ATTR_CGEN_INSN_USES_FRDR_VALUE(attrs) (((attrs)->bool & (1 << CGEN_INSN_USES_FRDR)) != 0)
  #define CGEN_ATTR_CGEN_INSN_USES_FRDRRR_VALUE(attrs) (((attrs)->bool & (1 << CGEN_INSN_USES_FRDRRR)) != 0)
  #define CGEN_ATTR_CGEN_INSN_USES_FRSR1_VALUE(attrs) (((attrs)->bool & (1 << CGEN_INSN_USES_FRSR1)) != 0)
Index: opcodes/ms1-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/ms1-dis.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 ms1-dis.c
*** opcodes/ms1-dis.c	28 Oct 2005 19:49:22 -0000	1.4
--- opcodes/ms1-dis.c	7 Nov 2005 11:23:29 -0000
*************** static int read_insn
*** 60,65 ****
--- 60,66 ----
  
  /* -- dis.c */
  static void print_dollarhex (CGEN_CPU_DESC, PTR, long, unsigned, bfd_vma, int);
+ static void print_pcrel (CGEN_CPU_DESC, PTR, long, unsigned, bfd_vma, int);
  
  static void
  print_dollarhex (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
*************** print_dollarhex (CGEN_CPU_DESC cd ATTRIB
*** 77,82 ****
--- 78,93 ----
      print_normal (cd, dis_info, value, attrs, pc, length);
  }
  
+ static void
+ print_pcrel (CGEN_CPU_DESC cd ATTRIBUTE_UNUSED,
+ 	     void * dis_info,
+ 	     long value,
+ 	     unsigned int attrs ATTRIBUTE_UNUSED,
+ 	     bfd_vma pc ATTRIBUTE_UNUSED,
+ 	     int length ATTRIBUTE_UNUSED)
+ {
+   print_address (cd, dis_info, value + pc, attrs, pc, length);
+ }
  
  /* -- */
  
*************** ms1_cgen_print_operand (CGEN_CPU_DESC cd
*** 129,134 ****
--- 140,157 ----
      case MS1_OPERAND_BRC2 :
        print_dollarhex (cd, info, fields->f_brc2, 0, pc, length);
        break;
+     case MS1_OPERAND_CB1INCR :
+       print_dollarhex (cd, info, fields->f_cb1incr, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
+       break;
+     case MS1_OPERAND_CB1SEL :
+       print_dollarhex (cd, info, fields->f_cb1sel, 0, pc, length);
+       break;
+     case MS1_OPERAND_CB2INCR :
+       print_dollarhex (cd, info, fields->f_cb2incr, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
+       break;
+     case MS1_OPERAND_CB2SEL :
+       print_dollarhex (cd, info, fields->f_cb2sel, 0, pc, length);
+       break;
      case MS1_OPERAND_CBRB :
        print_dollarhex (cd, info, fields->f_cbrb, 0, pc, length);
        break;
*************** ms1_cgen_print_operand (CGEN_CPU_DESC cd
*** 186,193 ****
      case MS1_OPERAND_IMM16 :
        print_dollarhex (cd, info, fields->f_imm16s, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
        break;
      case MS1_OPERAND_IMM16O :
!       print_dollarhex (cd, info, fields->f_imm16s, 0, pc, length);
        break;
      case MS1_OPERAND_IMM16Z :
        print_dollarhex (cd, info, fields->f_imm16u, 0, pc, length);
--- 209,219 ----
      case MS1_OPERAND_IMM16 :
        print_dollarhex (cd, info, fields->f_imm16s, 0|(1<<CGEN_OPERAND_SIGNED), pc, length);
        break;
+     case MS1_OPERAND_IMM16L :
+       print_dollarhex (cd, info, fields->f_imm16l, 0, pc, length);
+       break;
      case MS1_OPERAND_IMM16O :
!       print_pcrel (cd, info, fields->f_imm16s, 0|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
        break;
      case MS1_OPERAND_IMM16Z :
        print_dollarhex (cd, info, fields->f_imm16u, 0, pc, length);
*************** ms1_cgen_print_operand (CGEN_CPU_DESC cd
*** 201,206 ****
--- 227,235 ----
      case MS1_OPERAND_LENGTH :
        print_dollarhex (cd, info, fields->f_length, 0, pc, length);
        break;
+     case MS1_OPERAND_LOOPSIZE :
+       print_pcrel (cd, info, fields->f_loopo, 0|(1<<CGEN_OPERAND_PCREL_ADDR), pc, length);
+       break;
      case MS1_OPERAND_MASK :
        print_dollarhex (cd, info, fields->f_mask, 0, pc, length);
        break;
*************** ms1_cgen_print_operand (CGEN_CPU_DESC cd
*** 225,230 ****
--- 254,262 ----
      case MS1_OPERAND_RC2 :
        print_dollarhex (cd, info, fields->f_rc2, 0, pc, length);
        break;
+     case MS1_OPERAND_RC3 :
+       print_dollarhex (cd, info, fields->f_rc3, 0, pc, length);
+       break;
      case MS1_OPERAND_RCNUM :
        print_dollarhex (cd, info, fields->f_rcnum, 0, pc, length);
        break;
Index: opcodes/ms1-ibld.c
===================================================================
RCS file: /cvs/src/src/opcodes/ms1-ibld.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 ms1-ibld.c
*** opcodes/ms1-ibld.c	1 Jul 2005 11:16:32 -0000	1.2
--- opcodes/ms1-ibld.c	7 Nov 2005 11:23:29 -0000
*************** ms1_cgen_insert_operand (CGEN_CPU_DESC c
*** 576,581 ****
--- 576,593 ----
      case MS1_OPERAND_BRC2 :
        errmsg = insert_normal (cd, fields->f_brc2, 0, 0, 14, 3, 32, total_length, buffer);
        break;
+     case MS1_OPERAND_CB1INCR :
+       errmsg = insert_normal (cd, fields->f_cb1incr, 0|(1<<CGEN_IFLD_SIGNED), 0, 19, 6, 32, total_length, buffer);
+       break;
+     case MS1_OPERAND_CB1SEL :
+       errmsg = insert_normal (cd, fields->f_cb1sel, 0, 0, 25, 3, 32, total_length, buffer);
+       break;
+     case MS1_OPERAND_CB2INCR :
+       errmsg = insert_normal (cd, fields->f_cb2incr, 0|(1<<CGEN_IFLD_SIGNED), 0, 13, 6, 32, total_length, buffer);
+       break;
+     case MS1_OPERAND_CB2SEL :
+       errmsg = insert_normal (cd, fields->f_cb2sel, 0, 0, 22, 3, 32, total_length, buffer);
+       break;
      case MS1_OPERAND_CBRB :
        errmsg = insert_normal (cd, fields->f_cbrb, 0, 0, 10, 1, 32, total_length, buffer);
        break;
*************** ms1_cgen_insert_operand (CGEN_CPU_DESC c
*** 637,642 ****
--- 649,657 ----
          errmsg = insert_normal (cd, value, 0|(1<<CGEN_IFLD_SIGNED), 0, 15, 16, 32, total_length, buffer);
        }
        break;
+     case MS1_OPERAND_IMM16L :
+       errmsg = insert_normal (cd, fields->f_imm16l, 0, 0, 23, 16, 32, total_length, buffer);
+       break;
      case MS1_OPERAND_IMM16O :
        {
          long value = fields->f_imm16s;
*************** ms1_cgen_insert_operand (CGEN_CPU_DESC c
*** 656,661 ****
--- 671,683 ----
      case MS1_OPERAND_LENGTH :
        errmsg = insert_normal (cd, fields->f_length, 0, 0, 15, 3, 32, total_length, buffer);
        break;
+     case MS1_OPERAND_LOOPSIZE :
+       {
+         long value = fields->f_loopo;
+         value = ((unsigned int) (value) >> (2));
+         errmsg = insert_normal (cd, value, 0, 0, 7, 8, 32, total_length, buffer);
+       }
+       break;
      case MS1_OPERAND_MASK :
        errmsg = insert_normal (cd, fields->f_mask, 0, 0, 25, 16, 32, total_length, buffer);
        break;
*************** ms1_cgen_insert_operand (CGEN_CPU_DESC c
*** 680,685 ****
--- 702,710 ----
      case MS1_OPERAND_RC2 :
        errmsg = insert_normal (cd, fields->f_rc2, 0, 0, 6, 1, 32, total_length, buffer);
        break;
+     case MS1_OPERAND_RC3 :
+       errmsg = insert_normal (cd, fields->f_rc3, 0, 0, 7, 1, 32, total_length, buffer);
+       break;
      case MS1_OPERAND_RCNUM :
        errmsg = insert_normal (cd, fields->f_rcnum, 0, 0, 14, 3, 32, total_length, buffer);
        break;
*************** ms1_cgen_extract_operand (CGEN_CPU_DESC 
*** 768,773 ****
--- 793,810 ----
      case MS1_OPERAND_BRC2 :
        length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 3, 32, total_length, pc, & fields->f_brc2);
        break;
+     case MS1_OPERAND_CB1INCR :
+       length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 19, 6, 32, total_length, pc, & fields->f_cb1incr);
+       break;
+     case MS1_OPERAND_CB1SEL :
+       length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 3, 32, total_length, pc, & fields->f_cb1sel);
+       break;
+     case MS1_OPERAND_CB2INCR :
+       length = extract_normal (cd, ex_info, insn_value, 0|(1<<CGEN_IFLD_SIGNED), 0, 13, 6, 32, total_length, pc, & fields->f_cb2incr);
+       break;
+     case MS1_OPERAND_CB2SEL :
+       length = extract_normal (cd, ex_info, insn_value, 0, 0, 22, 3, 32, total_length, pc, & fields->f_cb2sel);
+       break;
      case MS1_OPERAND_CBRB :
        length = extract_normal (cd, ex_info, insn_value, 0, 0, 10, 1, 32, total_length, pc, & fields->f_cbrb);
        break;
*************** ms1_cgen_extract_operand (CGEN_CPU_DESC 
*** 830,835 ****
--- 867,875 ----
          fields->f_imm16s = value;
        }
        break;
+     case MS1_OPERAND_IMM16L :
+       length = extract_normal (cd, ex_info, insn_value, 0, 0, 23, 16, 32, total_length, pc, & fields->f_imm16l);
+       break;
      case MS1_OPERAND_IMM16O :
        {
          long value;
*************** ms1_cgen_extract_operand (CGEN_CPU_DESC 
*** 850,855 ****
--- 890,903 ----
      case MS1_OPERAND_LENGTH :
        length = extract_normal (cd, ex_info, insn_value, 0, 0, 15, 3, 32, total_length, pc, & fields->f_length);
        break;
+     case MS1_OPERAND_LOOPSIZE :
+       {
+         long value;
+         length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 8, 32, total_length, pc, & value);
+         value = ((((value) << (2))) + (8));
+         fields->f_loopo = value;
+       }
+       break;
      case MS1_OPERAND_MASK :
        length = extract_normal (cd, ex_info, insn_value, 0, 0, 25, 16, 32, total_length, pc, & fields->f_mask);
        break;
*************** ms1_cgen_extract_operand (CGEN_CPU_DESC 
*** 874,879 ****
--- 922,930 ----
      case MS1_OPERAND_RC2 :
        length = extract_normal (cd, ex_info, insn_value, 0, 0, 6, 1, 32, total_length, pc, & fields->f_rc2);
        break;
+     case MS1_OPERAND_RC3 :
+       length = extract_normal (cd, ex_info, insn_value, 0, 0, 7, 1, 32, total_length, pc, & fields->f_rc3);
+       break;
      case MS1_OPERAND_RCNUM :
        length = extract_normal (cd, ex_info, insn_value, 0, 0, 14, 3, 32, total_length, pc, & fields->f_rcnum);
        break;
*************** ms1_cgen_get_int_operand (CGEN_CPU_DESC 
*** 957,962 ****
--- 1008,1025 ----
      case MS1_OPERAND_BRC2 :
        value = fields->f_brc2;
        break;
+     case MS1_OPERAND_CB1INCR :
+       value = fields->f_cb1incr;
+       break;
+     case MS1_OPERAND_CB1SEL :
+       value = fields->f_cb1sel;
+       break;
+     case MS1_OPERAND_CB2INCR :
+       value = fields->f_cb2incr;
+       break;
+     case MS1_OPERAND_CB2SEL :
+       value = fields->f_cb2sel;
+       break;
      case MS1_OPERAND_CBRB :
        value = fields->f_cbrb;
        break;
*************** ms1_cgen_get_int_operand (CGEN_CPU_DESC 
*** 1014,1019 ****
--- 1077,1085 ----
      case MS1_OPERAND_IMM16 :
        value = fields->f_imm16s;
        break;
+     case MS1_OPERAND_IMM16L :
+       value = fields->f_imm16l;
+       break;
      case MS1_OPERAND_IMM16O :
        value = fields->f_imm16s;
        break;
*************** ms1_cgen_get_int_operand (CGEN_CPU_DESC 
*** 1029,1034 ****
--- 1095,1103 ----
      case MS1_OPERAND_LENGTH :
        value = fields->f_length;
        break;
+     case MS1_OPERAND_LOOPSIZE :
+       value = fields->f_loopo;
+       break;
      case MS1_OPERAND_MASK :
        value = fields->f_mask;
        break;
*************** ms1_cgen_get_int_operand (CGEN_CPU_DESC 
*** 1053,1058 ****
--- 1122,1130 ----
      case MS1_OPERAND_RC2 :
        value = fields->f_rc2;
        break;
+     case MS1_OPERAND_RC3 :
+       value = fields->f_rc3;
+       break;
      case MS1_OPERAND_RCNUM :
        value = fields->f_rcnum;
        break;
*************** ms1_cgen_get_vma_operand (CGEN_CPU_DESC 
*** 1118,1123 ****
--- 1190,1207 ----
      case MS1_OPERAND_BRC2 :
        value = fields->f_brc2;
        break;
+     case MS1_OPERAND_CB1INCR :
+       value = fields->f_cb1incr;
+       break;
+     case MS1_OPERAND_CB1SEL :
+       value = fields->f_cb1sel;
+       break;
+     case MS1_OPERAND_CB2INCR :
+       value = fields->f_cb2incr;
+       break;
+     case MS1_OPERAND_CB2SEL :
+       value = fields->f_cb2sel;
+       break;
      case MS1_OPERAND_CBRB :
        value = fields->f_cbrb;
        break;
*************** ms1_cgen_get_vma_operand (CGEN_CPU_DESC 
*** 1175,1180 ****
--- 1259,1267 ----
      case MS1_OPERAND_IMM16 :
        value = fields->f_imm16s;
        break;
+     case MS1_OPERAND_IMM16L :
+       value = fields->f_imm16l;
+       break;
      case MS1_OPERAND_IMM16O :
        value = fields->f_imm16s;
        break;
*************** ms1_cgen_get_vma_operand (CGEN_CPU_DESC 
*** 1190,1195 ****
--- 1277,1285 ----
      case MS1_OPERAND_LENGTH :
        value = fields->f_length;
        break;
+     case MS1_OPERAND_LOOPSIZE :
+       value = fields->f_loopo;
+       break;
      case MS1_OPERAND_MASK :
        value = fields->f_mask;
        break;
*************** ms1_cgen_get_vma_operand (CGEN_CPU_DESC 
*** 1214,1219 ****
--- 1304,1312 ----
      case MS1_OPERAND_RC2 :
        value = fields->f_rc2;
        break;
+     case MS1_OPERAND_RC3 :
+       value = fields->f_rc3;
+       break;
      case MS1_OPERAND_RCNUM :
        value = fields->f_rcnum;
        break;
*************** ms1_cgen_set_int_operand (CGEN_CPU_DESC 
*** 1286,1291 ****
--- 1379,1396 ----
      case MS1_OPERAND_BRC2 :
        fields->f_brc2 = value;
        break;
+     case MS1_OPERAND_CB1INCR :
+       fields->f_cb1incr = value;
+       break;
+     case MS1_OPERAND_CB1SEL :
+       fields->f_cb1sel = value;
+       break;
+     case MS1_OPERAND_CB2INCR :
+       fields->f_cb2incr = value;
+       break;
+     case MS1_OPERAND_CB2SEL :
+       fields->f_cb2sel = value;
+       break;
      case MS1_OPERAND_CBRB :
        fields->f_cbrb = value;
        break;
*************** ms1_cgen_set_int_operand (CGEN_CPU_DESC 
*** 1343,1348 ****
--- 1448,1456 ----
      case MS1_OPERAND_IMM16 :
        fields->f_imm16s = value;
        break;
+     case MS1_OPERAND_IMM16L :
+       fields->f_imm16l = value;
+       break;
      case MS1_OPERAND_IMM16O :
        fields->f_imm16s = value;
        break;
*************** ms1_cgen_set_int_operand (CGEN_CPU_DESC 
*** 1358,1363 ****
--- 1466,1474 ----
      case MS1_OPERAND_LENGTH :
        fields->f_length = value;
        break;
+     case MS1_OPERAND_LOOPSIZE :
+       fields->f_loopo = value;
+       break;
      case MS1_OPERAND_MASK :
        fields->f_mask = value;
        break;
*************** ms1_cgen_set_int_operand (CGEN_CPU_DESC 
*** 1382,1387 ****
--- 1493,1501 ----
      case MS1_OPERAND_RC2 :
        fields->f_rc2 = value;
        break;
+     case MS1_OPERAND_RC3 :
+       fields->f_rc3 = value;
+       break;
      case MS1_OPERAND_RCNUM :
        fields->f_rcnum = value;
        break;
*************** ms1_cgen_set_vma_operand (CGEN_CPU_DESC 
*** 1444,1449 ****
--- 1558,1575 ----
      case MS1_OPERAND_BRC2 :
        fields->f_brc2 = value;
        break;
+     case MS1_OPERAND_CB1INCR :
+       fields->f_cb1incr = value;
+       break;
+     case MS1_OPERAND_CB1SEL :
+       fields->f_cb1sel = value;
+       break;
+     case MS1_OPERAND_CB2INCR :
+       fields->f_cb2incr = value;
+       break;
+     case MS1_OPERAND_CB2SEL :
+       fields->f_cb2sel = value;
+       break;
      case MS1_OPERAND_CBRB :
        fields->f_cbrb = value;
        break;
*************** ms1_cgen_set_vma_operand (CGEN_CPU_DESC 
*** 1501,1506 ****
--- 1627,1635 ----
      case MS1_OPERAND_IMM16 :
        fields->f_imm16s = value;
        break;
+     case MS1_OPERAND_IMM16L :
+       fields->f_imm16l = value;
+       break;
      case MS1_OPERAND_IMM16O :
        fields->f_imm16s = value;
        break;
*************** ms1_cgen_set_vma_operand (CGEN_CPU_DESC 
*** 1516,1521 ****
--- 1645,1653 ----
      case MS1_OPERAND_LENGTH :
        fields->f_length = value;
        break;
+     case MS1_OPERAND_LOOPSIZE :
+       fields->f_loopo = value;
+       break;
      case MS1_OPERAND_MASK :
        fields->f_mask = value;
        break;
*************** ms1_cgen_set_vma_operand (CGEN_CPU_DESC 
*** 1540,1545 ****
--- 1672,1680 ----
      case MS1_OPERAND_RC2 :
        fields->f_rc2 = value;
        break;
+     case MS1_OPERAND_RC3 :
+       fields->f_rc3 = value;
+       break;
      case MS1_OPERAND_RCNUM :
        fields->f_rcnum = value;
        break;
Index: opcodes/ms1-opc.c
===================================================================
RCS file: /cvs/src/src/opcodes/ms1-opc.c,v
retrieving revision 1.2
diff -c -3 -p -r1.2 ms1-opc.c
*** opcodes/ms1-opc.c	1 Jul 2005 11:16:32 -0000	1.2
--- opcodes/ms1-opc.c	7 Nov 2005 11:23:29 -0000
*************** static const CGEN_IFMT ifmt_mfbcbincrs A
*** 237,242 ****
--- 237,262 ----
    32, 32, 0xfc008000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_PERM) }, { F (F_SR1) }, { F (F_SR2) }, { F (F_UU_1_15) }, { F (F_CBX) }, { F (F_CCB) }, { F (F_CDB) }, { F (F_ROWNUM2) }, { F (F_DUP) }, { F (F_CTXDISP) }, { 0 } }
  };
  
+ static const CGEN_IFMT ifmt_loop ATTRIBUTE_UNUSED = {
+   32, 32, 0xff0fff00, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_SR1) }, { F (F_UU4A) }, { F (F_UU8) }, { F (F_LOOPO) }, { 0 } }
+ };
+ 
+ static const CGEN_IFMT ifmt_loopi ATTRIBUTE_UNUSED = {
+   32, 32, 0xff000000, { { F (F_MSYS) }, { F (F_OPC) }, { F (F_IMM) }, { F (F_IMM16L) }, { F (F_LOOPO) }, { 0 } }
+ };
+ 
+ static const CGEN_IFMT ifmt_dfbc ATTRIBUTE_UNUSED = {
+   32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_CB1SEL) }, { F (F_CB2SEL) }, { F (F_CB1INCR) }, { F (F_CB2INCR) }, { F (F_RC3) }, { F (F_RC2) }, { F (F_CTXDISP) }, { 0 } }
+ };
+ 
+ static const CGEN_IFMT ifmt_dwfb ATTRIBUTE_UNUSED = {
+   32, 32, 0xfc000080, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_CB1SEL) }, { F (F_CB2SEL) }, { F (F_CB1INCR) }, { F (F_CB2INCR) }, { F (F_UU1) }, { F (F_RC2) }, { F (F_CTXDISP) }, { 0 } }
+ };
+ 
+ static const CGEN_IFMT ifmt_dfbr ATTRIBUTE_UNUSED = {
+   32, 32, 0xfc000000, { { F (F_MSYS) }, { F (F_MSOPC) }, { F (F_CB1SEL) }, { F (F_CB2SEL) }, { F (F_SR2) }, { F (F_LENGTH) }, { F (F_ROWNUM1) }, { F (F_ROWNUM2) }, { F (F_RC2) }, { F (F_CTXDISP) }, { 0 } }
+ };
+ 
  #undef F
  
  #if defined (__STDC__) || defined (ALMOST_STDC) || defined (HAVE_STRINGIZE)
*************** static const CGEN_OPCODE ms1_cgen_insn_o
*** 722,727 ****
--- 742,783 ----
      { { MNEM, ' ', OP (FRSR1), ',', OP (FRSR2), ',', '#', OP (PERM), ',', '#', OP (CBX), ',', '#', OP (CCB), ',', '#', OP (CDB), ',', '#', OP (ROWNUM2), ',', '#', OP (DUP), ',', '#', OP (CTXDISP), 0 } },
      & ifmt_mfbcbincrs, { 0xfc000000 }
    },
+ /* loop $frsr1,$loopsize */
+   {
+     { 0, 0, 0, 0 },
+     { { MNEM, ' ', OP (FRSR1), ',', OP (LOOPSIZE), 0 } },
+     & ifmt_loop, { 0x3e000000 }
+   },
+ /* loopi #$imm16l,$loopsize */
+   {
+     { 0, 0, 0, 0 },
+     { { MNEM, ' ', '#', OP (IMM16L), ',', OP (LOOPSIZE), 0 } },
+     & ifmt_loopi, { 0x3f000000 }
+   },
+ /* dfbc #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc3,#$rc2,#$ctxdisp */
+   {
+     { 0, 0, 0, 0 },
+     { { MNEM, ' ', '#', OP (CB1SEL), ',', '#', OP (CB2SEL), ',', '#', OP (CB1INCR), ',', '#', OP (CB2INCR), ',', '#', OP (RC3), ',', '#', OP (RC2), ',', '#', OP (CTXDISP), 0 } },
+     & ifmt_dfbc, { 0x80000000 }
+   },
+ /* dwfb #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc2,#$ctxdisp */
+   {
+     { 0, 0, 0, 0 },
+     { { MNEM, ' ', '#', OP (CB1SEL), ',', '#', OP (CB2SEL), ',', '#', OP (CB1INCR), ',', '#', OP (CB2INCR), ',', '#', OP (RC2), ',', '#', OP (CTXDISP), 0 } },
+     & ifmt_dwfb, { 0x84000000 }
+   },
+ /* fbwfb #$cb1sel,#$cb2sel,#$cb1incr,#$cb2incr,#$rc3,#$rc2,#$ctxdisp */
+   {
+     { 0, 0, 0, 0 },
+     { { MNEM, ' ', '#', OP (CB1SEL), ',', '#', OP (CB2SEL), ',', '#', OP (CB1INCR), ',', '#', OP (CB2INCR), ',', '#', OP (RC3), ',', '#', OP (RC2), ',', '#', OP (CTXDISP), 0 } },
+     & ifmt_dfbc, { 0x88000000 }
+   },
+ /* dfbr #$cb1sel,#$cb2sel,$frsr2,#$length,#$rownum1,#$rownum2,#$rc2,#$ctxdisp */
+   {
+     { 0, 0, 0, 0 },
+     { { MNEM, ' ', '#', OP (CB1SEL), ',', '#', OP (CB2SEL), ',', OP (FRSR2), ',', '#', OP (LENGTH), ',', '#', OP (ROWNUM1), ',', '#', OP (ROWNUM2), ',', '#', OP (RC2), ',', '#', OP (CTXDISP), 0 } },
+     & ifmt_dfbr, { 0x8c000000 }
+   },
  };
  
  #undef A
Index: opcodes/ms1-opc.h
===================================================================
RCS file: /cvs/src/src/opcodes/ms1-opc.h,v
retrieving revision 1.1
diff -c -3 -p -r1.1 ms1-opc.h
*** opcodes/ms1-opc.h	15 Jun 2005 16:23:54 -0000	1.1
--- opcodes/ms1-opc.h	7 Nov 2005 11:23:29 -0000
*************** typedef enum cgen_insn_type {
*** 68,81 ****
   , MS1_INSN_WFBI, MS1_INSN_WFB, MS1_INSN_RCRISC, MS1_INSN_FBCBINC
   , MS1_INSN_RCXMODE, MS1_INSN_INTERLEAVER, MS1_INSN_WFBINC, MS1_INSN_MWFBINC
   , MS1_INSN_WFBINCR, MS1_INSN_MWFBINCR, MS1_INSN_FBCBINCS, MS1_INSN_MFBCBINCS
!  , MS1_INSN_FBCBINCRS, MS1_INSN_MFBCBINCRS
  } CGEN_INSN_TYPE;
  
  /* Index of `invalid' insn place holder.  */
  #define CGEN_INSN_INVALID MS1_INSN_INVALID
  
  /* Total number of insns in table.  */
! #define MAX_INSNS ((int) MS1_INSN_MFBCBINCRS + 1)
  
  /* This struct records data prior to insertion or after extraction.  */
  struct cgen_fields
--- 68,82 ----
   , MS1_INSN_WFBI, MS1_INSN_WFB, MS1_INSN_RCRISC, MS1_INSN_FBCBINC
   , MS1_INSN_RCXMODE, MS1_INSN_INTERLEAVER, MS1_INSN_WFBINC, MS1_INSN_MWFBINC
   , MS1_INSN_WFBINCR, MS1_INSN_MWFBINCR, MS1_INSN_FBCBINCS, MS1_INSN_MFBCBINCS
!  , MS1_INSN_FBCBINCRS, MS1_INSN_MFBCBINCRS, MS1_INSN_LOOP, MS1_INSN_LOOPI
!  , MS1_INSN_DFBC, MS1_INSN_DWFB, MS1_INSN_FBWFB, MS1_INSN_DFBR
  } CGEN_INSN_TYPE;
  
  /* Index of `invalid' insn place holder.  */
  #define CGEN_INSN_INVALID MS1_INSN_INVALID
  
  /* Total number of insns in table.  */
! #define MAX_INSNS ((int) MS1_INSN_DFBR + 1)
  
  /* This struct records data prior to insertion or after extraction.  */
  struct cgen_fields
*************** struct cgen_fields
*** 97,103 ****
--- 98,106 ----
    long f_uu4a;
    long f_uu4b;
    long f_uu12;
+   long f_uu8;
    long f_uu16;
+   long f_uu1;
    long f_msopc;
    long f_uu_26_25;
    long f_mask;
*************** struct cgen_fields
*** 147,152 ****
--- 150,162 ----
    long f_dup;
    long f_rc2;
    long f_ctxdisp;
+   long f_imm16l;
+   long f_loopo;
+   long f_cb1sel;
+   long f_cb2sel;
+   long f_cb1incr;
+   long f_cb2incr;
+   long f_rc3;
    long f_msysfrsr2;
    long f_brc2;
    long f_ball2;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]