This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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]

RFA: FRV: Have GAS detect odd register numbers


Hi Dave,

  Another FRV patch based on a bug report from Fujitsu (#23201).  This
  time they noticed that GAS does not detect a malformed mdrotli
  instruction where either of the register operands is odd.

  The patch below fixes this, in a rather extensive fashion, by
  creating three new operands in the frv.cpu file. These operands
  check for odd numbered registers and the patch uses them in the
  appropriate places in the patterns that follow.  It also adds code
  to frv.opc to perform the even-number checking.  It also defines
  CGEN_VERBOSE_ASSEMBLER_ERRORS so that GAS will report an appropriate
  error message if a bad mdrotli is encountered.

  Any objections to my applying it ?  (To cpu/ and cgen/cpu/).
  
Cheers
        Nick

cpu/ChangeLog and cgen/cpu/ChangeLog
2003-06-04  Nick Clifton  <nickc@redhat.com>

	* frv.cpu (FRintieven): New operand.  An even-numbered only
	version of the FRinti operand.
        (FRintjeven): Likewise for FRintj.
        (FRintkeven): Likewise for FRintk.
        (mdcutssi, media-dual-word-rotate-r-r, mqsaths,
	media-quad-arith-sat-semantics, media-quad-arith-sat,
	conditional-media-quad-arith-sat, mdunpackh,
	media-quad-multiply-semantics, media-quad-multiply,
        conditional-media-quad-multiply, media-quad-complex-i, 
	media-quad-multiply-acc-semantics, media-quad-multiply-acc,
	conditional-media-quad-multiply-acc, munpackh,
	media-quad-multiply-cross-acc-semantics, mdpackh,
	media-quad-multiply-cross-acc, mbtoh-semantics,
	media-quad-cross-multiply-cross-acc-semantics,
	media-quad-cross-multiply-cross-acc, mbtoh, mhtob-semantics,
        media-quad-cross-multiply-acc-semantics, cmbtoh,
        media-quad-cross-multiply-acc, media-quad-complex, mhtob,
	media-expand-halfword-to-double-semantics, mexpdhd, cmexpdhd,
	cmhtob): Use new operands.        
	* frv.opc (CGEN_VERBOSE_ASSEMBLER_ERRORS): Define.
        (parse_even_register): New function.

opcodes/ChangeLog
2003-06-04  Nick Clifton  <nickc@redhat.com>

	* frv-asm.c: Regenerate.
	* frv-desc.c: Regenerate.
	* frv-desc.h: Regenerate.
	* frv-dis.c: Regenerate.
	* frv-ibld.c: Regenerate.
	* frv-opc.c: Regenerate.
	* frv-opc.h: Regenerate.
	* po/opcodes.pot: Regenerate.
	
Index: cpu/frv.cpu
===================================================================
RCS file: /cvs/src/src/cpu/frv.cpu,v
retrieving revision 1.2
diff -c -3 -p -r1.2 frv.cpu
*** cpu/frv.cpu	3 Jun 2003 17:15:23 -0000	1.2
--- cpu/frv.cpu	4 Jun 2003 14:28:59 -0000
***************
*** 2210,2215 ****
--- 2210,2245 ----
  (dnop label24  "26 bit pc relative address" () h-iaddr f-label24)
  
  (define-operand
+   (name FRintieven)
+   (comment "(even) source register 1")
+   (attrs)
+   (type h-fr_int)
+   (index f-FRi)
+   (mode SI)
+   (handlers (parse "even_register"))
+ )
+ 
+ (define-operand
+   (name FRintjeven)
+   (comment "(even) source register 2")
+   (attrs)
+   (type h-fr_int)
+   (index f-FRj)
+   (mode SI)
+   (handlers (parse "even_register"))
+ )
+ 
+ (define-operand
+   (name FRintkeven)
+   (comment "(even) target register")
+   (attrs)
+   (type h-fr_int)
+   (index f-FRk)
+   (mode SI)
+   (handlers (parse "even_register"))
+ )
+ 
+ (define-operand
    (name d12)
    (comment "12 bit signed immediate")
    (attrs)
***************
*** 6594,6608 ****
  (dni mdcutssi
       "Media dual cut with signed saturation"
       ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!      "mdcutssi$pack $ACC40Si,$s6,$FRintk"
!      (+ pack FRintk OP_78 ACC40Si OPE1_0E s6)
       (if (register-unaligned ACC40Si 2)
  	 (c-call VOID "@cpu@_media_acc_not_aligned")
! 	 (if (register-unaligned FRintk 2)
  	     (c-call VOID "@cpu@_media_register_not_aligned")
  	     (sequence ()
! 		       (set FRintk (c-call SI "@cpu@_media_cut_ss" ACC40Si s6))
! 		       (set (nextreg h-fr_int FRintk 1)
  			    (c-call SI "@cpu@_media_cut_ss"
  				    (nextreg h-acc40S ACC40Si 1) s6)))))
       ((fr400 (unit u-media-4-acc-dual)))
--- 6624,6638 ----
  (dni mdcutssi
       "Media dual cut with signed saturation"
       ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!      "mdcutssi$pack $ACC40Si,$s6,$FRintkeven"
!      (+ pack FRintkeven OP_78 ACC40Si OPE1_0E s6)
       (if (register-unaligned ACC40Si 2)
  	 (c-call VOID "@cpu@_media_acc_not_aligned")
! 	 (if (register-unaligned FRintkeven 2)
  	     (c-call VOID "@cpu@_media_register_not_aligned")
  	     (sequence ()
! 		       (set FRintkeven (c-call SI "@cpu@_media_cut_ss" ACC40Si s6))
! 		       (set (nextreg h-fr_int FRintkeven 1)
  			    (c-call SI "@cpu@_media_cut_ss"
  				    (nextreg h-acc40S ACC40Si 1) s6)))))
       ((fr400 (unit u-media-4-acc-dual)))
***************
*** 6660,6674 ****
    (dni name
         (comment)
         ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!        (.str name "$pack $FRinti,$s6,$FRintk")
!        (+ pack FRintk op FRinti ope s6)
!        (if (orif (register-unaligned FRinti 2)
! 		 (register-unaligned FRintk 2))
  	   (c-call VOID "@cpu@_media_register_not_aligned")
  	   (sequence ()
! 		     (set FRintk (operation FRinti (and s6 #x1f)))
! 		     (set (nextreg h-fr_int FRintk 1)
! 			  (operation (nextreg h-fr_int FRinti 1)
  				     (and s6 #x1f)))))
         ((fr400 (unit u-media-3-quad)))
    )
--- 6690,6704 ----
    (dni name
         (comment)
         ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!        (.str name "$pack $FRintieven,$s6,$FRintkeven")
!        (+ pack FRintkeven op FRintieven ope s6)
!        (if (orif (register-unaligned FRintieven 2)
! 		 (register-unaligned FRintkeven 2))
  	   (c-call VOID "@cpu@_media_register_not_aligned")
  	   (sequence ()
! 		     (set FRintkeven (operation FRintieven (and s6 #x1f)))
! 		     (set (nextreg h-fr_int FRintkeven 1)
! 			  (operation (nextreg h-fr_int FRintieven 1)
  				     (and s6 #x1f)))))
         ((fr400 (unit u-media-3-quad)))
    )
***************
*** 6738,6758 ****
  (dni mqsaths
       "Media quad saturation signed"
       ((UNIT FM01) (MACH fr400) (FR400-MAJOR M-1))
!      "mqsaths$pack $FRinti,$FRintj,$FRintk"
!      (+ pack FRintk OP_78 FRinti OPE1_0F FRintj)
!      (if (orif (register-unaligned FRinti 2)
! 	       (orif (register-unaligned FRintj 2)
! 		     (register-unaligned FRintk 2)))
  	 (c-call VOID "@cpu@_media_register_not_aligned")
  	 (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo))
! 		   ; hack to get FRintk referenced as a target for profiling
! 		   (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
! 		   (extract-hilo FRinti 0 FRintj 0 argihi argilo argjhi argjlo)
! 		   (saturate argihi argjhi (inv argjhi) (halfword hi FRintk 0))
! 		   (saturate argilo argjlo (inv argjlo) (halfword lo FRintk 0))
! 		   (extract-hilo FRinti 1 FRintj 1 argihi argilo argjhi argjlo)
! 		   (saturate argihi argjhi (inv argjhi) (halfword hi FRintk 1))
! 		   (saturate argilo argjlo (inv argjlo) (halfword lo FRintk 1))))
       ((fr400 (unit u-media-1-quad)))
  )
  
--- 6768,6788 ----
  (dni mqsaths
       "Media quad saturation signed"
       ((UNIT FM01) (MACH fr400) (FR400-MAJOR M-1))
!      "mqsaths$pack $FRintieven,$FRintjeven,$FRintk"
!      (+ pack FRintkeven OP_78 FRintieven OPE1_0F FRintjeven)
!      (if (orif (register-unaligned FRintieven 2)
! 	       (orif (register-unaligned FRintjeven 2)
! 		     (register-unaligned FRintkeven 2)))
  	 (c-call VOID "@cpu@_media_register_not_aligned")
  	 (sequence ((HI argihi) (HI argilo) (HI argjhi) (HI argjlo))
! 		   ; hack to get FRintkeven referenced as a target for profiling
! 		   (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
! 		   (extract-hilo FRintieven 0 FRintjeven 0 argihi argilo argjhi argjlo)
! 		   (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 0))
! 		   (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 0))
! 		   (extract-hilo FRintieven 1 FRintjeven 1 argihi argilo argjhi argjlo)
! 		   (saturate argihi argjhi (inv argjhi) (halfword hi FRintkeven 1))
! 		   (saturate argilo argjlo (inv argjlo) (halfword lo FRintkeven 1))))
       ((fr400 (unit u-media-1-quad)))
  )
  
***************
*** 6894,6922 ****
  (conditional-media-dual-arith-sat cmsubhus sub UHI 65535      0 OP_71 OPE4_3 "Conditional Media dual sub unsigned with saturation")
  
  (define-pmacro (media-quad-arith-sat-semantics cond operation mode max min)
!   (if (orif (register-unaligned FRinti 2)
! 	    (orif (register-unaligned FRintj 2)
! 		  (register-unaligned FRintk 2)))
        (c-call VOID "@cpu@_media_register_not_aligned")
        (if cond
  	  (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
! 		    ; hack to get FRintk referenced as a target for profiling
! 		    (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
! 		    (extract-hilo FRinti 0 FRintj 0
  				  argihi argilo argjhi argjlo)
  		    (media-arith-sat-semantics operation argihi argjhi
! 					       (halfword hi FRintk 0) mode
  					       max min (msr-sie-fri-hi))
  		    (media-arith-sat-semantics operation argilo argjlo
! 					       (halfword lo FRintk 0) mode
  					       max min (msr-sie-fri-lo))
! 		    (extract-hilo FRinti 1 FRintj 1
  				  argihi argilo argjhi argjlo)
  		    (media-arith-sat-semantics operation argihi argjhi
! 					       (halfword hi FRintk 1) mode
  					       max min	(msr-sie-fri-1-hi))
  		    (media-arith-sat-semantics operation argilo argjlo
! 					       (halfword lo FRintk 1) mode
  					       max min (msr-sie-fri-1-lo)))))
  )
  
--- 6924,6952 ----
  (conditional-media-dual-arith-sat cmsubhus sub UHI 65535      0 OP_71 OPE4_3 "Conditional Media dual sub unsigned with saturation")
  
  (define-pmacro (media-quad-arith-sat-semantics cond operation mode max min)
!   (if (orif (register-unaligned FRintieven 2)
! 	    (orif (register-unaligned FRintjeven 2)
! 		  (register-unaligned FRintkeven 2)))
        (c-call VOID "@cpu@_media_register_not_aligned")
        (if cond
  	  (sequence ((mode argihi) (mode argilo) (mode argjhi) (mode argjlo))
! 		    ; hack to get FRintkeven referenced as a target for profiling
! 		    (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
! 		    (extract-hilo FRintieven 0 FRintjeven 0
  				  argihi argilo argjhi argjlo)
  		    (media-arith-sat-semantics operation argihi argjhi
! 					       (halfword hi FRintkeven 0) mode
  					       max min (msr-sie-fri-hi))
  		    (media-arith-sat-semantics operation argilo argjlo
! 					       (halfword lo FRintkeven 0) mode
  					       max min (msr-sie-fri-lo))
! 		    (extract-hilo FRintieven 1 FRintjeven 1
  				  argihi argilo argjhi argjlo)
  		    (media-arith-sat-semantics operation argihi argjhi
! 					       (halfword hi FRintkeven 1) mode
  					       max min	(msr-sie-fri-1-hi))
  		    (media-arith-sat-semantics operation argilo argjlo
! 					       (halfword lo FRintkeven 1) mode
  					       max min (msr-sie-fri-1-lo)))))
  )
  
***************
*** 6924,6931 ****
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-1) (FR400-MAJOR M-2))
!        (.str name "$pack $FRinti,$FRintj,$FRintk")
!        (+ pack FRintk op FRinti ope FRintj)
         (media-quad-arith-sat-semantics 1 operation mode max min)
         ((fr400 (unit u-media-1-quad))
  	(fr500 (unit u-media-quad-arith)))
--- 6954,6961 ----
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-1) (FR400-MAJOR M-2))
!        (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven")
!        (+ pack FRintkeven op FRintieven ope FRintjeven)
         (media-quad-arith-sat-semantics 1 operation mode max min)
         ((fr400 (unit u-media-1-quad))
  	(fr500 (unit u-media-quad-arith)))
***************
*** 6943,6950 ****
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-1) (FR400-MAJOR M-2) CONDITIONAL)
!        (.str name "$pack $FRinti,$FRintj,$FRintk,$CCi,$cond")
!        (+ pack FRintk op FRinti CCi cond ope FRintj)
         (media-quad-arith-sat-semantics (eq CCi (or cond 2))
  				       operation mode max min)
         ((fr400 (unit u-media-1-quad))
--- 6973,6980 ----
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-1) (FR400-MAJOR M-2) CONDITIONAL)
!        (.str name "$pack $FRintieven,$FRintjeven,$FRintkeven,$CCi,$cond")
!        (+ pack FRintkeven op FRintieven CCi cond ope FRintjeven)
         (media-quad-arith-sat-semantics (eq CCi (or cond 2))
  				       operation mode max min)
         ((fr400 (unit u-media-1-quad))
***************
*** 7131,7148 ****
  (define-pmacro (media-quad-multiply-semantics cond mode conv rhs1 rhs2)
    (if (register-unaligned ACC40Sk 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRinti 2)
! 		(register-unaligned FRintj 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRinti 0 FRintj 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-semantics conv argihi rhs1 ACC40Sk)
  			(media-multiply-semantics conv argilo rhs2
  						  (nextreg h-acc40S ACC40Sk 1))
! 			(extract-hilo FRinti 1 FRintj 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-semantics conv argihi rhs1
  						  (nextreg h-acc40S ACC40Sk 2))
--- 7161,7178 ----
  (define-pmacro (media-quad-multiply-semantics cond mode conv rhs1 rhs2)
    (if (register-unaligned ACC40Sk 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRintieven 2)
! 		(register-unaligned FRintjeven 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRintieven 0 FRintjeven 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-semantics conv argihi rhs1 ACC40Sk)
  			(media-multiply-semantics conv argilo rhs2
  						  (nextreg h-acc40S ACC40Sk 1))
! 			(extract-hilo FRintieven 1 FRintjeven 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-semantics conv argihi rhs1
  						  (nextreg h-acc40S ACC40Sk 2))
***************
*** 7154,7161 ****
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2) PRESERVE-OVF)
!        (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
!        (+ pack ACC40Sk op FRinti ope FRintj)
         (media-quad-multiply-semantics 1 mode conv rhs1 rhs2) 
         ((fr400 (unit u-media-2-quad))
  	(fr500 (unit u-media-quad-mul)))
--- 7184,7191 ----
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2) PRESERVE-OVF)
!        (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
!        (+ pack ACC40Sk op FRintieven ope FRintjeven)
         (media-quad-multiply-semantics 1 mode conv rhs1 rhs2) 
         ((fr400 (unit u-media-2-quad))
  	(fr500 (unit u-media-quad-mul)))
***************
*** 7174,7181 ****
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2)
  	PRESERVE-OVF CONDITIONAL)
!        (.str name "$pack $FRinti,$FRintj,$ACC40Sk,$CCi,$cond")
!        (+ pack ACC40Sk op FRinti CCi cond ope FRintj)
         (media-quad-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2)
         ((fr400 (unit u-media-2-quad))
  	(fr500 (unit u-media-quad-mul)))
--- 7204,7211 ----
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2)
  	PRESERVE-OVF CONDITIONAL)
!        (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk,$CCi,$cond")
!        (+ pack ACC40Sk op FRintieven CCi cond ope FRintjeven)
         (media-quad-multiply-semantics (eq CCi (or cond 2)) mode conv rhs1 rhs2)
         ((fr400 (unit u-media-2-quad))
  	(fr500 (unit u-media-quad-mul)))
***************
*** 7269,7281 ****
  		cond mode conv addop rhw res max min)
    (if (register-unaligned res 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRinti 2)
! 		(register-unaligned FRintj 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRinti 0 FRintj 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjhi
  						      res
--- 7299,7311 ----
  		cond mode conv addop rhw res max min)
    (if (register-unaligned res 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRintieven 2)
! 		(register-unaligned FRintjeven 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRintieven 0 FRintjeven 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjhi
  						      res
***************
*** 7283,7289 ****
  			(media-multiply-acc-semantics conv argilo addop argjlo
  						      (nextreg rhw res 1)
  						      max min (msr-sie-acci-1))
! 			(extract-hilo FRinti 1 FRintj 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjhi
  						      (nextreg rhw res 2)
--- 7313,7319 ----
  			(media-multiply-acc-semantics conv argilo addop argjlo
  						      (nextreg rhw res 1)
  						      max min (msr-sie-acci-1))
! 			(extract-hilo FRintieven 1 FRintjeven 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjhi
  						      (nextreg rhw res 2)
***************
*** 7299,7306 ****
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2))
!        (.str name "$pack $FRinti,$FRintj,$" res)
!        (+ pack res op FRinti ope FRintj)
         (media-quad-multiply-acc-semantics 1 mode conv addop rhw res max min)
         ((fr400 (unit u-media-2-quad))
  	(fr500 (unit u-media-quad-mul)))
--- 7329,7336 ----
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2))
!        (.str name "$pack $FRintieven,$FRintjeven,$" res)
!        (+ pack res op FRintieven ope FRintjeven)
         (media-quad-multiply-acc-semantics 1 mode conv addop rhw res max min)
         ((fr400 (unit u-media-2-quad))
  	(fr500 (unit u-media-quad-mul)))
***************
*** 7322,7329 ****
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2) CONDITIONAL)
!        (.str name "$pack $FRinti,$FRintj,$" res ",$CCi,$cond")
!        (+ pack res op FRinti CCi cond ope FRintj)
         (media-quad-multiply-acc-semantics (eq CCi (or cond 2))
  					  mode conv addop rhw res max min)
         ((fr400 (unit u-media-2-quad))
--- 7352,7359 ----
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2) CONDITIONAL)
!        (.str name "$pack $FRintieven,$FRintjeven,$" res ",$CCi,$cond")
!        (+ pack res op FRintieven CCi cond ope FRintjeven)
         (media-quad-multiply-acc-semantics (eq CCi (or cond 2))
  					  mode conv addop rhw res max min)
         ((fr400 (unit u-media-2-quad))
***************
*** 7345,7357 ****
  		cond mode conv addop rhw res max min)
    (if (register-unaligned res 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRinti 2)
! 		(register-unaligned FRintj 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRinti 0 FRintj 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjhi
  						      (nextreg rhw res 2)
--- 7375,7387 ----
  		cond mode conv addop rhw res max min)
    (if (register-unaligned res 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRintieven 2)
! 		(register-unaligned FRintjeven 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRintieven 0 FRintjeven 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjhi
  						      (nextreg rhw res 2)
***************
*** 7359,7365 ****
  			(media-multiply-acc-semantics conv argilo addop argjlo
  						      (nextreg rhw res 3)
  						      max min (msr-sie-acci-3))
! 			(extract-hilo FRinti 1 FRintj 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjhi
  						      res
--- 7389,7395 ----
  			(media-multiply-acc-semantics conv argilo addop argjlo
  						      (nextreg rhw res 3)
  						      max min (msr-sie-acci-3))
! 			(extract-hilo FRintieven 1 FRintjeven 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjhi
  						      res
***************
*** 7375,7382 ****
    (dni name
         (comment)
         ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!        (.str name "$pack $FRinti,$FRintj,$" res)
!        (+ pack res op FRinti ope FRintj)
         (media-quad-multiply-cross-acc-semantics 1 mode conv addop rhw res
  						max min)
         ((fr400 (unit u-media-2-quad)))
--- 7405,7412 ----
    (dni name
         (comment)
         ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!        (.str name "$pack $FRintieven,$FRintjeven,$" res)
!        (+ pack res op FRintieven ope FRintjeven)
         (media-quad-multiply-cross-acc-semantics 1 mode conv addop rhw res
  						max min)
         ((fr400 (unit u-media-2-quad)))
***************
*** 7392,7404 ****
  		cond mode conv addop rhw res max min)
    (if (register-unaligned res 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRinti 2)
! 		(register-unaligned FRintj 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRinti 0 FRintj 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjlo
  						      (nextreg rhw res 2)
--- 7422,7434 ----
  		cond mode conv addop rhw res max min)
    (if (register-unaligned res 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRintieven 2)
! 		(register-unaligned FRintjeven 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRintieven 0 FRintjeven 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjlo
  						      (nextreg rhw res 2)
***************
*** 7406,7412 ****
  			(media-multiply-acc-semantics conv argilo addop argjhi
  						      (nextreg rhw res 3)
  						      max min (msr-sie-acci-3))
! 			(extract-hilo FRinti 1 FRintj 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjlo
  						      res
--- 7436,7442 ----
  			(media-multiply-acc-semantics conv argilo addop argjhi
  						      (nextreg rhw res 3)
  						      max min (msr-sie-acci-3))
! 			(extract-hilo FRintieven 1 FRintjeven 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjlo
  						      res
***************
*** 7422,7429 ****
    (dni name
         (comment)
         ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!        (.str name "$pack $FRinti,$FRintj,$" res)
!        (+ pack res op FRinti ope FRintj)
         (media-quad-cross-multiply-cross-acc-semantics 1 mode conv addop rhw res
  						      max min)
         ((fr400 (unit u-media-2-quad)))
--- 7452,7459 ----
    (dni name
         (comment)
         ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!        (.str name "$pack $FRintieven,$FRintjeven,$" res)
!        (+ pack res op FRintieven ope FRintjeven)
         (media-quad-cross-multiply-cross-acc-semantics 1 mode conv addop rhw res
  						      max min)
         ((fr400 (unit u-media-2-quad)))
***************
*** 7439,7451 ****
  		cond mode conv addop rhw res max min)
    (if (register-unaligned res 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRinti 2)
! 		(register-unaligned FRintj 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRinti 0 FRintj 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjlo
  						      res
--- 7469,7481 ----
  		cond mode conv addop rhw res max min)
    (if (register-unaligned res 4)
        (c-call VOID "@cpu@_media_acc_not_aligned")
!       (if (orif (register-unaligned FRintieven 2)
! 		(register-unaligned FRintjeven 2))
  	  (c-call VOID "@cpu@_media_register_not_aligned")
  	  (if cond
  	      (sequence ((mode argihi) (mode argilo)
  			 (mode argjhi) (mode argjlo))
! 			(extract-hilo FRintieven 0 FRintjeven 0
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjlo
  						      res
***************
*** 7453,7459 ****
  			(media-multiply-acc-semantics conv argilo addop argjhi
  						      (nextreg rhw res 1)
  						      max min (msr-sie-acci-1))
! 			(extract-hilo FRinti 1 FRintj 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjlo
  						      (nextreg rhw res 2)
--- 7483,7489 ----
  			(media-multiply-acc-semantics conv argilo addop argjhi
  						      (nextreg rhw res 1)
  						      max min (msr-sie-acci-1))
! 			(extract-hilo FRintieven 1 FRintjeven 1
  				      argihi argilo argjhi argjlo)
  			(media-multiply-acc-semantics conv argihi addop argjlo
  						      (nextreg rhw res 2)
***************
*** 7469,7476 ****
    (dni name
         (comment)
         ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!        (.str name "$pack $FRinti,$FRintj,$" res)
!        (+ pack res op FRinti ope FRintj)
         (media-quad-cross-multiply-acc-semantics 1 mode conv addop rhw res
  						max min)
         ((fr400 (unit u-media-2-quad)))
--- 7499,7506 ----
    (dni name
         (comment)
         ((UNIT FM0) (MACH fr400) (FR400-MAJOR M-2))
!        (.str name "$pack $FRintieven,$FRintjeven,$" res)
!        (+ pack res op FRintieven ope FRintjeven)
         (media-quad-cross-multiply-acc-semantics 1 mode conv addop rhw res
  						max min)
         ((fr400 (unit u-media-2-quad)))
***************
*** 7613,7633 ****
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2))
!        (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
!        (+ pack ACC40Sk op FRinti ope FRintj)
         (if (register-unaligned ACC40Sk 2)
  	   (c-call VOID "@cpu@_media_acc_not_aligned")
! 	   (if (orif (register-unaligned FRinti 2)
! 		     (register-unaligned FRintj 2))
  	       (c-call VOID "@cpu@_media_register_not_aligned")
  	       (sequence ((mode argihi) (mode argilo)
  			  (mode argjhi) (mode argjlo))
! 			 (extract-hilo FRinti 0 FRintj 0
  				       argihi argilo argjhi argjlo)
  			 (media-complex-semantics conv argihi rhs1 argilo rhs2
  						  ACC40Sk
  						  max min (msr-sie-acci))
! 			 (extract-hilo FRinti 1 FRintj 1
  				       argihi argilo argjhi argjlo)
  			 (media-complex-semantics conv argihi rhs1 argilo rhs2
  						  (nextreg h-acc40S ACC40Sk 1)
--- 7643,7663 ----
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2))
!        (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
!        (+ pack ACC40Sk op FRintieven ope FRintjeven)
         (if (register-unaligned ACC40Sk 2)
  	   (c-call VOID "@cpu@_media_acc_not_aligned")
! 	   (if (orif (register-unaligned FRintieven 2)
! 		     (register-unaligned FRintjeven 2))
  	       (c-call VOID "@cpu@_media_register_not_aligned")
  	       (sequence ((mode argihi) (mode argilo)
  			  (mode argjhi) (mode argjlo))
! 			 (extract-hilo FRintieven 0 FRintjeven 0
  				       argihi argilo argjhi argjlo)
  			 (media-complex-semantics conv argihi rhs1 argilo rhs2
  						  ACC40Sk
  						  max min (msr-sie-acci))
! 			 (extract-hilo FRintieven 1 FRintjeven 1
  				       argihi argilo argjhi argjlo)
  			 (media-complex-semantics conv argihi rhs1 argilo rhs2
  						  (nextreg h-acc40S ACC40Sk 1)
***************
*** 7642,7662 ****
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2))
!        (.str name "$pack $FRinti,$FRintj,$ACC40Sk")
!        (+ pack ACC40Sk op FRinti ope FRintj)
         (if (register-unaligned ACC40Sk 2)
  	   (c-call VOID "@cpu@_media_acc_not_aligned")
! 	   (if (orif (register-unaligned FRinti 2)
! 		     (register-unaligned FRintj 2))
  	       (c-call VOID "@cpu@_media_register_not_aligned")
  	       (sequence ((mode argihi) (mode argilo)
  			  (mode argjhi) (mode argjlo))
! 			 (extract-hilo FRinti 0 FRintj 0
  				       argihi argilo argjhi argjlo)
  			 (media-complex-semantics-i conv argihi rhs1 argilo rhs2
  						  ACC40Sk
  						  max min (msr-sie-acci))
! 			 (extract-hilo FRinti 1 FRintj 1
  				       argihi argilo argjhi argjlo)
  			 (media-complex-semantics-i conv argihi rhs1 argilo rhs2
  						  (nextreg h-acc40S ACC40Sk 1)
--- 7672,7692 ----
    (dni name
         (comment)
         ((UNIT FM01) (FR500-MAJOR M-4) (FR400-MAJOR M-2))
!        (.str name "$pack $FRintieven,$FRintjeven,$ACC40Sk")
!        (+ pack ACC40Sk op FRintieven ope FRintjeven)
         (if (register-unaligned ACC40Sk 2)
  	   (c-call VOID "@cpu@_media_acc_not_aligned")
! 	   (if (orif (register-unaligned FRintieven 2)
! 		     (register-unaligned FRintjeven 2))
  	       (c-call VOID "@cpu@_media_register_not_aligned")
  	       (sequence ((mode argihi) (mode argilo)
  			  (mode argjhi) (mode argjlo))
! 			 (extract-hilo FRintieven 0 FRintjeven 0
  				       argihi argilo argjhi argjlo)
  			 (media-complex-semantics-i conv argihi rhs1 argilo rhs2
  						  ACC40Sk
  						  max min (msr-sie-acci))
! 			 (extract-hilo FRintieven 1 FRintjeven 1
  				       argihi argilo argjhi argjlo)
  			 (media-complex-semantics-i conv argihi rhs1 argilo rhs2
  						  (nextreg h-acc40S ACC40Sk 1)
***************
*** 7723,7748 ****
  )
  
  (define-pmacro (media-expand-halfword-to-double-semantics cond)
!   (if (register-unaligned FRintk 2)
        (c-call VOID "@cpu@_media_register_not_aligned")
        (if cond
  	  (sequence ((UHI tmp))
! 		    ; a hack to get FRintk referenced for profiling
! 		    (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
  		    (if (and u6 1)
  			(set tmp (halfword lo FRinti 0))
  			(set tmp (halfword hi FRinti 0)))
! 		    (set (halfword hi FRintk 0) tmp)
! 		    (set (halfword lo FRintk 0) tmp)
! 		    (set (halfword hi FRintk 1) tmp)
! 		    (set (halfword lo FRintk 1) tmp))))
  )
  
  (dni mexpdhd
       "Media expand halfword to double"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2))
!      "mexpdhd$pack $FRinti,$u6,$FRintk"
!      (+ pack FRintk OP_7B FRinti OPE1_33 u6)
       (media-expand-halfword-to-double-semantics 1)
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-expand)))
--- 7753,7778 ----
  )
  
  (define-pmacro (media-expand-halfword-to-double-semantics cond)
!   (if (register-unaligned FRintkeven 2)
        (c-call VOID "@cpu@_media_register_not_aligned")
        (if cond
  	  (sequence ((UHI tmp))
! 		    ; a hack to get FRintkeven referenced for profiling
! 		    (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
  		    (if (and u6 1)
  			(set tmp (halfword lo FRinti 0))
  			(set tmp (halfword hi FRinti 0)))
! 		    (set (halfword hi FRintkeven 0) tmp)
! 		    (set (halfword lo FRintkeven 0) tmp)
! 		    (set (halfword hi FRintkeven 1) tmp)
! 		    (set (halfword lo FRintkeven 1) tmp))))
  )
  
  (dni mexpdhd
       "Media expand halfword to double"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2))
!      "mexpdhd$pack $FRinti,$u6,$FRintkeven"
!      (+ pack FRintkeven OP_7B FRinti OPE1_33 u6)
       (media-expand-halfword-to-double-semantics 1)
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-expand)))
***************
*** 7751,7758 ****
  (dni cmexpdhd
       "Conditional media expand halfword to double"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2) CONDITIONAL)
!      "cmexpdhd$pack $FRinti,$u6,$FRintk,$CCi,$cond"
!      (+ pack FRintk OP_76 FRinti CCi cond OPE4_3 u6)
       (media-expand-halfword-to-double-semantics (eq CCi (or cond 2)))
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-expand)))
--- 7781,7788 ----
  (dni cmexpdhd
       "Conditional media expand halfword to double"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2) CONDITIONAL)
!      "cmexpdhd$pack $FRinti,$u6,$FRintkeven,$CCi,$cond"
!      (+ pack FRintkeven OP_76 FRinti CCi cond OPE4_3 u6)
       (media-expand-halfword-to-double-semantics (eq CCi (or cond 2)))
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-expand)))
***************
*** 7771,7789 ****
  (dni mdpackh
       "Media dual pack"
       ((UNIT FM01) (FR500-MAJOR M-5) (FR400-MAJOR M-2))
!      "mdpackh$pack $FRinti,$FRintj,$FRintk"
!      (+ pack FRintk OP_7B FRinti OPE1_36 FRintj)
!      (if (orif (register-unaligned FRinti 2)
! 	       (orif (register-unaligned FRintj 2)
! 		     (register-unaligned FRintk 2)))
  	 (c-call VOID "@cpu@_media_register_not_aligned")
  	 (sequence ()
  		   ; hack to get these referenced for profiling
! 		   (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
! 		   (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
! 		   (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
! 		   (media-pack FRinti FRintj FRintk 0)
! 		   (media-pack FRinti FRintj FRintk 1)))
       ((fr400 (unit u-media-3-quad))
        (fr500 (unit u-media-quad-arith)))
  )
--- 7801,7819 ----
  (dni mdpackh
       "Media dual pack"
       ((UNIT FM01) (FR500-MAJOR M-5) (FR400-MAJOR M-2))
!      "mdpackh$pack $FRintieven,$FRintjeven,$FRintkeven"
!      (+ pack FRintkeven OP_7B FRintieven OPE1_36 FRintjeven)
!      (if (orif (register-unaligned FRintieven 2)
! 	       (orif (register-unaligned FRintjeven 2)
! 		     (register-unaligned FRintkeven 2)))
  	 (c-call VOID "@cpu@_media_register_not_aligned")
  	 (sequence ()
  		   ; hack to get these referenced for profiling
! 		   (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
! 		   (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
! 		   (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
! 		   (media-pack FRintieven FRintjeven FRintkeven 0)
! 		   (media-pack FRintieven FRintjeven FRintkeven 1)))
       ((fr400 (unit u-media-3-quad))
        (fr500 (unit u-media-quad-arith)))
  )
***************
*** 7799,7813 ****
  (dni munpackh
       "Media halfword unpack"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2))
!      "munpackh$pack $FRinti,$FRintk"
!      (+ pack FRintk OP_7B FRinti OPE1_35 (FRj-null))
!      (if (register-unaligned FRintk 2)
  	 (c-call VOID "@cpu@_media_register_not_aligned")
  	 (sequence ()
  		   ; hack to get these referenced for profiling
  		   (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
! 		   (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
! 		   (media-unpack FRinti 0 FRintk 0)))
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-expand)))
  )
--- 7829,7843 ----
  (dni munpackh
       "Media halfword unpack"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2))
!      "munpackh$pack $FRinti,$FRintkeven"
!      (+ pack FRintkeven OP_7B FRinti OPE1_35 (FRj-null))
!      (if (register-unaligned FRintkeven 2)
  	 (c-call VOID "@cpu@_media_register_not_aligned")
  	 (sequence ()
  		   ; hack to get these referenced for profiling
  		   (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
! 		   (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
! 		   (media-unpack FRinti 0 FRintkeven 0)))
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-expand)))
  )
***************
*** 7815,7830 ****
  (dni mdunpackh
       "Media dual unpack"
       ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv))
!      "mdunpackh$pack $FRinti,$FRintk"
!      (+ pack FRintk OP_7B FRinti OPE1_37 (FRj-null))
!      (if (orif (register-unaligned FRinti 2) (register-unaligned FRintk 4))
  	 (c-call VOID "@cpu@_media_register_not_aligned")
  	 (sequence ()
  		   ; hack to get these referenced for profiling
! 		   (set FRinti (c-raw-call SI "frv_ref_SI" FRinti))
  		   (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
! 		   (media-unpack FRinti 0 FRintk 0)
! 		   (media-unpack FRinti 1 FRintk 2)))
       ((fr500 (unit u-media-dual-unpack)))
  )
  
--- 7845,7860 ----
  (dni mdunpackh
       "Media dual unpack"
       ((UNIT FM01) (FR500-MAJOR M-7) (MACH simple,tomcat,frv))
!      "mdunpackh$pack $FRintieven,$FRintk"
!      (+ pack FRintk OP_7B FRintieven OPE1_37 (FRj-null))
!      (if (orif (register-unaligned FRintieven 2) (register-unaligned FRintk 4))
  	 (c-call VOID "@cpu@_media_register_not_aligned")
  	 (sequence ()
  		   ; hack to get these referenced for profiling
! 		   (set FRintieven (c-raw-call SI "frv_ref_SI" FRintieven))
  		   (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
! 		   (media-unpack FRintieven 0 FRintk 0)
! 		   (media-unpack FRintieven 1 FRintk 2)))
       ((fr500 (unit u-media-dual-unpack)))
  )
  
***************
*** 7832,7856 ****
    (reg (.sym h-fr_ num) (add (index-of arg) offset)))
  
  (define-pmacro (mbtoh-semantics cond)
!   (if (register-unaligned FRintk 2)
        (c-call VOID "@cpu@_media_register_not_aligned")
        (if cond
  	  (sequence ()
! 		    (set (halfword hi FRintk 0) (ubyte 3 FRintj 0))
! 		    (set (halfword lo FRintk 0) (ubyte 2 FRintj 0))
! 		    (set (halfword hi FRintk 1) (ubyte 1 FRintj 0))
! 		    (set (halfword lo FRintk 1) (ubyte 0 FRintj 0)))))
  )
  
  (dni mbtoh
       "Media convert byte to halfword"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2))
!      "mbtoh$pack $FRintj,$FRintk"
!      (+ pack FRintk OP_7B (FRi-null) OPE1_38 FRintj)
       (sequence ()
  	       ; hack to get these referenced for profiling
  	       (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
! 	       (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
  	       (mbtoh-semantics 1))
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-btoh)))
--- 7862,7886 ----
    (reg (.sym h-fr_ num) (add (index-of arg) offset)))
  
  (define-pmacro (mbtoh-semantics cond)
!   (if (register-unaligned FRintkeven 2)
        (c-call VOID "@cpu@_media_register_not_aligned")
        (if cond
  	  (sequence ()
! 		    (set (halfword hi FRintkeven 0) (ubyte 3 FRintj 0))
! 		    (set (halfword lo FRintkeven 0) (ubyte 2 FRintj 0))
! 		    (set (halfword hi FRintkeven 1) (ubyte 1 FRintj 0))
! 		    (set (halfword lo FRintkeven 1) (ubyte 0 FRintj 0)))))
  )
  
  (dni mbtoh
       "Media convert byte to halfword"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2))
!      "mbtoh$pack $FRintj,$FRintkeven"
!      (+ pack FRintkeven OP_7B (FRi-null) OPE1_38 FRintj)
       (sequence ()
  	       ; hack to get these referenced for profiling
  	       (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
! 	       (set FRintkeven (c-raw-call SI "frv_ref_SI" FRintkeven))
  	       (mbtoh-semantics 1))
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-btoh)))
***************
*** 7859,7890 ****
  (dni cmbtoh
       "Conditional media convert byte to halfword"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2) CONDITIONAL)
!      "cmbtoh$pack $FRintj,$FRintk,$CCi,$cond"
!      (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_0 FRintj)
       (mbtoh-semantics (eq CCi (or cond 2)))
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-btoh)))
  )
  
  (define-pmacro (mhtob-semantics cond)
!   (if (register-unaligned FRintj 2)
        (c-call VOID "@cpu@_media_register_not_aligned")
        (if cond
  	  (sequence ()
! 		    (set (ubyte 3 FRintk 0) (halfword hi FRintj 0))
! 		    (set (ubyte 2 FRintk 0) (halfword lo FRintj 0))
! 		    (set (ubyte 1 FRintk 0) (halfword hi FRintj 1))
! 		    (set (ubyte 0 FRintk 0) (halfword lo FRintj 1)))))
  )
  
  (dni mhtob
       "Media convert halfword to byte"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2))
!      "mhtob$pack $FRintj,$FRintk"
!      (+ pack FRintk OP_7B (FRi-null) OPE1_39 FRintj)
       (sequence ()
  	       ; hack to get these referenced for profiling
! 	       (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
  	       (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
  	       (mhtob-semantics 1))
       ((fr400 (unit u-media-dual-htob))
--- 7889,7920 ----
  (dni cmbtoh
       "Conditional media convert byte to halfword"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2) CONDITIONAL)
!      "cmbtoh$pack $FRintj,$FRintkeven,$CCi,$cond"
!      (+ pack FRintkeven OP_77 (FRi-null) CCi cond OPE4_0 FRintj)
       (mbtoh-semantics (eq CCi (or cond 2)))
       ((fr400 (unit u-media-dual-expand))
        (fr500 (unit u-media-dual-btoh)))
  )
  
  (define-pmacro (mhtob-semantics cond)
!   (if (register-unaligned FRintjeven 2)
        (c-call VOID "@cpu@_media_register_not_aligned")
        (if cond
  	  (sequence ()
! 		    (set (ubyte 3 FRintk 0) (halfword hi FRintjeven 0))
! 		    (set (ubyte 2 FRintk 0) (halfword lo FRintjeven 0))
! 		    (set (ubyte 1 FRintk 0) (halfword hi FRintjeven 1))
! 		    (set (ubyte 0 FRintk 0) (halfword lo FRintjeven 1)))))
  )
  
  (dni mhtob
       "Media convert halfword to byte"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2))
!      "mhtob$pack $FRintjeven,$FRintk"
!      (+ pack FRintk OP_7B (FRi-null) OPE1_39 FRintjeven)
       (sequence ()
  	       ; hack to get these referenced for profiling
! 	       (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
  	       (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
  	       (mhtob-semantics 1))
       ((fr400 (unit u-media-dual-htob))
***************
*** 7894,7904 ****
  (dni cmhtob
       "Conditional media convert halfword to byte"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2) CONDITIONAL)
!      "cmhtob$pack $FRintj,$FRintk,$CCi,$cond"
!      (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_1 FRintj)
       (sequence ()
  	       ; hack to get these referenced for profiling
! 	       (set FRintj (c-raw-call SI "frv_ref_SI" FRintj))
  	       (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
  	       (mhtob-semantics (eq CCi (or cond 2))))
       ((fr400 (unit u-media-dual-htob))
--- 7924,7934 ----
  (dni cmhtob
       "Conditional media convert halfword to byte"
       ((UNIT FM01) (FR500-MAJOR M-2) (FR400-MAJOR M-2) CONDITIONAL)
!      "cmhtob$pack $FRintjeven,$FRintk,$CCi,$cond"
!      (+ pack FRintk OP_77 (FRi-null) CCi cond OPE4_1 FRintjeven)
       (sequence ()
  	       ; hack to get these referenced for profiling
! 	       (set FRintjeven (c-raw-call SI "frv_ref_SI" FRintjeven))
  	       (set FRintk (c-raw-call SI "frv_ref_SI" FRintk))
  	       (mhtob-semantics (eq CCi (or cond 2))))
       ((fr400 (unit u-media-dual-htob))
Index: cpu/frv.opc
===================================================================
RCS file: /cvs/src/src/cpu/frv.opc,v
retrieving revision 1.1
diff -c -3 -p -r1.1 frv.opc
*** cpu/frv.opc	3 Jun 2003 15:41:12 -0000	1.1
--- cpu/frv.opc	4 Jun 2003 14:28:59 -0000
***************
*** 40,50 ****
  
  /* -- opc.h */
  
! #undef CGEN_DIS_HASH_SIZE
  #define CGEN_DIS_HASH_SIZE 128
! #undef CGEN_DIS_HASH
  #define CGEN_DIS_HASH(buffer, value) (((value) >> 18) & 127)
  
  /* Vliw support.  */
  #define FRV_VLIW_SIZE 4 /* fr500 has largest vliw size of 4.  */
  typedef CGEN_ATTR_VALUE_TYPE VLIW_COMBO[FRV_VLIW_SIZE];
--- 40,53 ----
  
  /* -- opc.h */
  
! #undef  CGEN_DIS_HASH_SIZE
  #define CGEN_DIS_HASH_SIZE 128
! #undef  CGEN_DIS_HASH
  #define CGEN_DIS_HASH(buffer, value) (((value) >> 18) & 127)
  
+ /* Allows reason codes to be output when assembler errors occur.  */
+ #define CGEN_VERBOSE_ASSEMBLER_ERRORS
+ 
  /* Vliw support.  */
  #define FRV_VLIW_SIZE 4 /* fr500 has largest vliw size of 4.  */
  typedef CGEN_ATTR_VALUE_TYPE VLIW_COMBO[FRV_VLIW_SIZE];
*************** static const char * parse_s12
*** 601,606 ****
--- 604,611 ----
    PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
  static const char * parse_u12
    PARAMS ((CGEN_CPU_DESC, const char **, int, long *));
+ static const char * parse_even_register
+   PARAMS ((CGEN_CPU_DESC, const char **, CGEN_KEYWORD *, long *));
  
  static const char *
  parse_ulo16 (cd, strp, opindex, valuep)
*************** parse_u12 (cd, strp, opindex, valuep)
*** 883,888 ****
--- 888,913 ----
      }
  }
  
+ static const char *
+ parse_even_register (cd, strP, tableP, valueP)
+      CGEN_CPU_DESC  cd;
+      const char **  strP;
+      CGEN_KEYWORD * tableP;
+      long *         valueP;
+ {
+   const char * errmsg;
+   const char * saved_star_strP = * strP;
+ 
+   errmsg = cgen_parse_keyword (cd, strP, tableP, valueP);
+ 
+   if (errmsg == NULL && ((* valueP) & 1))
+     {
+       errmsg = _("register number must be even");
+       * strP = saved_star_strP;
+     }
+ 
+   return errmsg;
+ }
  /* -- */
  
  /* -- dis.c */
  


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