basic_op.h 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*___________________________________________________________________________
  2. | |
  3. | Constants and Globals |
  4. | |
  5. | $Id $
  6. |___________________________________________________________________________|
  7. */
  8. extern Flag Overflow;
  9. extern Flag Carry;
  10. #define MAX_32 (Word32)0x7fffffffL
  11. #define MIN_32 (Word32)0x80000000L
  12. #define MAX_16 (Word16)0x7fff
  13. #define MIN_16 (Word16)0x8000
  14. /*___________________________________________________________________________
  15. | |
  16. | Prototypes for basic arithmetic operators |
  17. |___________________________________________________________________________|
  18. */
  19. Word16 add_ex (Word16 var1, Word16 var2); /* Short add, 1 */
  20. Word16 sub_ex (Word16 var1, Word16 var2); /* Short sub_ex, 1 */
  21. Word16 abs_s_ex (Word16 var1); /* Short abs, 1 */
  22. Word16 shl_ex (Word16 var1, Word16 var2); /* Short shift left, 1 */
  23. Word16 shr_ex (Word16 var1, Word16 var2); /* Short shift right, 1 */
  24. Word16 mult_ex (Word16 var1, Word16 var2); /* Short mult_ex, 1 */
  25. Word32 L_mult_ex (Word16 var1, Word16 var2); /* Long mult_ex, 1 */
  26. Word16 negate_ex (Word16 var1); /* Short negate_ex, 1 */
  27. Word16 extract_h_ex (Word32 L_var1); /* Extract high, 1 */
  28. Word16 extract_l_ex (Word32 L_var1); /* Extract low, 1 */
  29. Word16 round_ex (Word32 L_var1); /* Round, 1 */
  30. Word32 L_mac_ex (Word32 L_var3, Word16 var1, Word16 var2); /* Mac, 1 */
  31. Word32 L_msu_ex (Word32 L_var3, Word16 var1, Word16 var2); /* Msu, 1 */
  32. Word32 L_macNs (Word32 L_var3, Word16 var1, Word16 var2); /* Mac without
  33. sat, 1 */
  34. Word32 L_msuNs (Word32 L_var3, Word16 var1, Word16 var2); /* Msu without
  35. sat, 1 */
  36. Word32 L_add_ex (Word32 L_var1, Word32 L_var2); /* Long add, 2 */
  37. Word32 L_sub_ex (Word32 L_var1, Word32 L_var2); /* Long sub_ex, 2 */
  38. Word32 L_add_c (Word32 L_var1, Word32 L_var2); /* Long add with c, 2 */
  39. Word32 L_sub_c (Word32 L_var1, Word32 L_var2); /* Long sub_ex with c, 2 */
  40. Word32 L_negate_ex (Word32 L_var1); /* Long negate_ex, 2 */
  41. Word16 mult_r_ex (Word16 var1, Word16 var2); /* Mult with round, 2 */
  42. Word32 L_shl_ex (Word32 L_var1, Word16 var2); /* Long shift left, 2 */
  43. Word32 L_shr_ex (Word32 L_var1, Word16 var2); /* Long shift right, 2*/
  44. Word16 shr_r_ex (Word16 var1, Word16 var2); /* Shift right with
  45. round, 2 */
  46. Word16 mac_r_ex (Word32 L_var3, Word16 var1, Word16 var2); /* Mac with
  47. rounding,2 */
  48. Word16 msu_r_ex (Word32 L_var3, Word16 var1, Word16 var2); /* Msu with
  49. rounding,2 */
  50. Word32 L_deposit_h_ex (Word16 var1); /* 16 bit var1 -> MSB, 2 */
  51. Word32 L_deposit_l_ex (Word16 var1); /* 16 bit var1 -> LSB, 2 */
  52. Word32 L_shr_r_ex (Word32 L_var1, Word16 var2); /* Long shift right with
  53. round, 3 */
  54. Word32 L_abs_ex (Word32 L_var1); /* Long abs, 3 */
  55. Word32 L_sat (Word32 L_var1); /* Long saturation, 4 */
  56. Word16 norm_s_ex (Word16 var1); /* Short norm, 15 */
  57. Word16 div_s (Word16 var1, Word16 var2); /* Short division, 18 */
  58. Word16 norm_l_ex (Word32 L_var1); /* Long norm, 30 */