/*___________________________________________________________________________ | | | Constants and Globals | | | | $Id $ |___________________________________________________________________________| */ extern Flag Overflow; extern Flag Carry; #define MAX_32 (Word32)0x7fffffffL #define MIN_32 (Word32)0x80000000L #define MAX_16 (Word16)0x7fff #define MIN_16 (Word16)0x8000 /*___________________________________________________________________________ | | | Prototypes for basic arithmetic operators | |___________________________________________________________________________| */ Word16 add_ex (Word16 var1, Word16 var2); /* Short add, 1 */ Word16 sub_ex (Word16 var1, Word16 var2); /* Short sub_ex, 1 */ Word16 abs_s_ex (Word16 var1); /* Short abs, 1 */ Word16 shl_ex (Word16 var1, Word16 var2); /* Short shift left, 1 */ Word16 shr_ex (Word16 var1, Word16 var2); /* Short shift right, 1 */ Word16 mult_ex (Word16 var1, Word16 var2); /* Short mult_ex, 1 */ Word32 L_mult_ex (Word16 var1, Word16 var2); /* Long mult_ex, 1 */ Word16 negate_ex (Word16 var1); /* Short negate_ex, 1 */ Word16 extract_h_ex (Word32 L_var1); /* Extract high, 1 */ Word16 extract_l_ex (Word32 L_var1); /* Extract low, 1 */ Word16 round_ex (Word32 L_var1); /* Round, 1 */ Word32 L_mac_ex (Word32 L_var3, Word16 var1, Word16 var2); /* Mac, 1 */ Word32 L_msu_ex (Word32 L_var3, Word16 var1, Word16 var2); /* Msu, 1 */ Word32 L_macNs (Word32 L_var3, Word16 var1, Word16 var2); /* Mac without sat, 1 */ Word32 L_msuNs (Word32 L_var3, Word16 var1, Word16 var2); /* Msu without sat, 1 */ Word32 L_add_ex (Word32 L_var1, Word32 L_var2); /* Long add, 2 */ Word32 L_sub_ex (Word32 L_var1, Word32 L_var2); /* Long sub_ex, 2 */ Word32 L_add_c (Word32 L_var1, Word32 L_var2); /* Long add with c, 2 */ Word32 L_sub_c (Word32 L_var1, Word32 L_var2); /* Long sub_ex with c, 2 */ Word32 L_negate_ex (Word32 L_var1); /* Long negate_ex, 2 */ Word16 mult_r_ex (Word16 var1, Word16 var2); /* Mult with round, 2 */ Word32 L_shl_ex (Word32 L_var1, Word16 var2); /* Long shift left, 2 */ Word32 L_shr_ex (Word32 L_var1, Word16 var2); /* Long shift right, 2*/ Word16 shr_r_ex (Word16 var1, Word16 var2); /* Shift right with round, 2 */ Word16 mac_r_ex (Word32 L_var3, Word16 var1, Word16 var2); /* Mac with rounding,2 */ Word16 msu_r_ex (Word32 L_var3, Word16 var1, Word16 var2); /* Msu with rounding,2 */ Word32 L_deposit_h_ex (Word16 var1); /* 16 bit var1 -> MSB, 2 */ Word32 L_deposit_l_ex (Word16 var1); /* 16 bit var1 -> LSB, 2 */ Word32 L_shr_r_ex (Word32 L_var1, Word16 var2); /* Long shift right with round, 3 */ Word32 L_abs_ex (Word32 L_var1); /* Long abs, 3 */ Word32 L_sat (Word32 L_var1); /* Long saturation, 4 */ Word16 norm_s_ex (Word16 var1); /* Short norm, 15 */ Word16 div_s (Word16 var1, Word16 var2); /* Short division, 18 */ Word16 norm_l_ex (Word32 L_var1); /* Long norm, 30 */