# SPARC64 helper macros
# $Id$

include(l2c_arith.m4)

dnl Define pins on a Multi bit adder for sparc64 complete with xcc flags
dnl DEF_MULTI_ADDER(prefix, num_adders)
define(`DEF_SPARC64_MULTI_ADDER',`
# l2c_arith::DEF_SPARC64_MULTI_ADDER, prefix = [$1], num = [$2]
        DEF_MULTI_ADDER(`$1',`$2'); dnl
	def `$1'_xcc_z `$1'_xcc_c dnl
dnl until we support signed numbers these are useless
dnl	def `$1'_xcc_n `$1'_xcc_v dnl
dnl do we need icc too?
') dnl
dnl 
dnl Define a multi_adder a with connected carry-in -> carry outs
dnl MULTI_ADDER(prefix, num_adders)
define(`SPARC64_MULTI_ADDER',`
# l2c_arith::SPARC64_MULTI_ADDER, prefix = [$1], num = [$2]
	MULTI_ADDER(`$1',`$2') .
	(`$1'_xcc_c <=> `$1'eval($2-1)_co) .
	(`$1'_xcc_z <=> FORVAR(`~range',`_s',` . ',`0',eval($2-1)))
')
