This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFA: FRV: Have GAS detect odd register numbers
- From: Nick Clifton <nickc at redhat dot com>
- To: Dave Brolley <brolley at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 05 Jun 2003 11:38:03 +0100
- Subject: Re: RFA: FRV: Have GAS detect odd register numbers
- References: <m3ptltga8v.fsf@redhat.com> <3EDE4D3A.5060509@redhat.com>
Hi Dave,
> The modelling units also need to be given the correct operand
> values.
> I've attached a patch showing an example of how this would be done
> for the mqsaths insn.
Thanks - here is a revised patch with the change you described applied
to all of the affected units. Is this version OK to apply ?
Cheers
Nick
2003-06-05 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.
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 5 Jun 2003 10:36:54 -0000
***************
*** 2159,2167 ****
(dnmop CPRdoublek "destination register" ((MACH frv)) h-cpr_double f-CPRk DI)
; floating point operands
! (dnmop FRinti "source register 1" () h-fr_int f-FRi SI)
! (dnmop FRintj "source register 2" () h-fr_int f-FRj SI)
! (dnmop FRintk "target register" () h-fr_int f-FRk SI)
(dnmop FRi "source register 1" () h-fr f-FRi SF)
(dnmop FRj "source register 2" () h-fr f-FRj SF)
(dnmop FRk "destination register" () h-fr f-FRk SF)
--- 2159,2167 ----
(dnmop CPRdoublek "destination register" ((MACH frv)) h-cpr_double f-CPRk DI)
; floating point operands
! (dnmop FRinti "source register 1" () h-fr_int f-FRi SI)
! (dnmop FRintj "source register 2" () h-fr_int f-FRj SI)
! (dnmop FRintk "target register" () h-fr_int f-FRk SI)
(dnmop FRi "source register 1" () h-fr f-FRi SF)
(dnmop FRj "source register 2" () h-fr f-FRj SF)
(dnmop FRk "destination register" () h-fr f-FRk SF)
***************
*** 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,6611 ****
(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)))
)
; The (add (xxxx) (mul arg 0)) is a hack to get a reference to arg generated
--- 6624,6642 ----
(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
! (out FRintk FRintkeven))))
)
; The (add (xxxx) (mul arg 0)) is a hack to get a reference to arg generated
***************
*** 6660,6676 ****
(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)))
)
)
--- 6691,6709 ----
(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
! (in FRinti FRintieven)
! (out FRintk FRintkeven))))
)
)
***************
*** 6738,6759 ****
(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)))
)
(define-pmacro (saturate-unsigned arg max result)
--- 6771,6795 ----
(dni mqsaths
"Media quad saturation signed"
((UNIT FM01) (MACH fr400) (FR400-MAJOR M-1))
! "mqsaths$pack $FRintieven,$FRintjeven,$FRintkeven"
! (+ 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
! (in FRinti FRintieven)
! (in FRintj FRintjeven)
! (out FRintk FRintkeven))))
)
(define-pmacro (saturate-unsigned arg max result)
***************
*** 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)))))
)
--- 6930,6958 ----
(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,6934 ****
(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)))
)
)
--- 6960,6976 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven)
! (out FRintk Frintkeven)))
! (fr500 (unit u-media-quad-arith
! (in FRinti FRintieven)
! (in FRintj FRintjeven)
! (out FRintk Frintkeven))))
)
)
***************
*** 6943,6954 ****
(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))
! (fr500 (unit u-media-quad-arith)))
)
)
--- 6985,7002 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven)
! (out FRintk Frintkeven)))
! (fr500 (unit u-media-quad-arith
! (in FRinti FRintieven)
! (in FRintj FRintjeven)
! (out FRintk Frintkeven))))
)
)
***************
*** 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))
--- 7179,7196 ----
(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,7164 ****
(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)))
)
)
--- 7202,7216 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven)))
! (fr500 (unit u-media-quad-mul
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 7174,7184 ****
(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)))
)
)
--- 7226,7240 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven)))
! (fr500 (unit u-media-quad-mul
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 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
--- 7325,7337 ----
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)
--- 7339,7345 ----
(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,7309 ****
(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)))
)
)
--- 7355,7369 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven)))
! (fr500 (unit u-media-quad-mul
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 7322,7333 ****
(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))
! (fr500 (unit u-media-quad-mul)))
)
)
--- 7382,7397 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven)))
! (fr500 (unit u-media-quad-mul
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 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)
--- 7409,7421 ----
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
--- 7423,7429 ----
(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,7385 ****
(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)))
)
)
--- 7439,7451 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 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)
--- 7458,7470 ----
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
--- 7472,7478 ----
(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,7432 ****
(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)))
)
)
--- 7488,7500 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 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
--- 7507,7519 ----
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)
--- 7521,7527 ----
(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,7479 ****
(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)))
)
)
--- 7537,7549 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 7613,7639 ****
(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)
max min (msr-sie-acci-1)))))
! ((fr400 (unit u-media-2-quad))
! (fr500 (unit u-media-quad-complex)))
)
)
--- 7683,7713 ----
(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)
max min (msr-sie-acci-1)))))
! ((fr400 (unit u-media-2-quad
! (in FRinti FRintieven)
! (in FRintj FRintjeven)))
! (fr500 (unit u-media-quad-complex
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 7642,7668 ****
(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)
max min (msr-sie-acci-1)))))
! ((fr400 (unit u-media-2-quad))
! (fr500 (unit u-media-quad-complex)))
)
)
--- 7716,7746 ----
(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)
max min (msr-sie-acci-1)))))
! ((fr400 (unit u-media-2-quad
! (in FRinti FRintieven)
! (in FRintj FRintjeven)))
! (fr500 (unit u-media-quad-complex
! (in FRinti FRintieven)
! (in FRintj FRintjeven))))
)
)
***************
*** 7723,7761 ****
)
(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)))
)
(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)))
)
(dni mpackh
--- 7801,7843 ----
)
(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
! (out FRintk FRintkeven)))
! (fr500 (unit u-media-dual-expand
! (out FRintk FRintkeven))))
)
(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
! (out FRintk FRintkeven)))
! (fr500 (unit u-media-dual-expand
! (out FRintk FRintkeven))))
)
(dni mpackh
***************
*** 7771,7791 ****
(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)))
)
(define-pmacro (media-unpack src soff targ toff)
--- 7853,7879 ----
(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
! (in FRinti FRintieven)
! (in FRintj FRintjeven)
! (out FRintk FRintkeven)))
! (fr500 (unit u-media-quad-arith
! (in FRinti FRintieven)
! (in FRintj FRintjeven)
! (out FRintk FRintkeven))))
)
(define-pmacro (media-unpack src soff targ toff)
***************
*** 7799,7908 ****
(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)))
)
(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)))
)
(define-pmacro (ubyte num arg offset)
(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)))
)
(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))
! (fr500 (unit u-media-dual-htob)))
)
(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))
! (fr500 (unit u-media-dual-htob)))
)
(define-pmacro (mbtohe-semantics cond)
--- 7887,8007 ----
(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
! (out FRintk FRintkeven)))
! (fr500 (unit u-media-dual-expand
! (out FRintk FRintkeven))))
)
(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
! (in FRinti FRintieven))))
)
(define-pmacro (ubyte num arg offset)
(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
! (in FRinti FRintieven)))
! (fr500 (unit u-media-dual-btoh
! (in FRinti FRintieven))))
)
(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
! (out FRintk FRintkeven)))
! (fr500 (unit u-media-dual-btoh
! (out FRintk FRintkeven))))
)
(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
! (in FRintj FRintjeven)))
! (fr500 (unit u-media-dual-htob
! (in FRintj FRintjeven))))
)
(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
! (in FRintj FRintjeven)))
! (fr500 (unit u-media-dual-htob
! (in FRintj FRintjeven))))
)
(define-pmacro (mbtohe-semantics cond)
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 5 Jun 2003 10:36:55 -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 */