Changeset 2731 for pjproject/trunk/third_party/g7221/common/basic_op.c
- Timestamp:
- Jun 1, 2009 4:43:45 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/third_party/g7221/common/basic_op.c
r2660 r2731 1 #include "config.h" 2 3 #if !PJMEDIA_LIBG7221_FUNCS_INLINED || \ 4 (PJMEDIA_LIBG7221_FUNCS_INLINED && defined(__BASIC_OP_H__)) 5 1 6 /*___________________________________________________________________________ 2 7 | | … … 73 78 |___________________________________________________________________________| 74 79 */ 75 Word16shr (Word16 var1, Word16 var2)80 LIBG7221_DEF(Word16) shr (Word16 var1, Word16 var2) 76 81 { 77 82 if (var2 < 0) … … 123 128 |___________________________________________________________________________| 124 129 */ 125 Word16shl (Word16 var1, Word16 var2)130 LIBG7221_DEF(Word16) shl (Word16 var1, Word16 var2) 126 131 { 127 132 if (var2 < 0) … … 172 177 |___________________________________________________________________________| 173 178 */ 174 Word16mult (Word16 var1, Word16 var2)179 LIBG7221_DEF(Word16) mult (Word16 var1, Word16 var2) 175 180 { 176 181 Word16 var_out; … … 229 234 |___________________________________________________________________________| 230 235 */ 231 Word32L_msu (Word32 L_var3, Word16 var1, Word16 var2)236 LIBG7221_DEF(Word32) L_msu (Word32 L_var3, Word16 var1, Word16 var2) 232 237 { 233 238 Word32 L_var_out; … … 290 295 |___________________________________________________________________________| 291 296 */ 292 Word32L_macNs (Word32 L_var3, Word16 var1, Word16 var2)297 LIBG7221_DEF(Word32) L_macNs (Word32 L_var3, Word16 var1, Word16 var2) 293 298 { 294 299 Word32 L_var_out; … … 351 356 |___________________________________________________________________________| 352 357 */ 353 Word32L_msuNs (Word32 L_var3, Word16 var1, Word16 var2)358 LIBG7221_DEF(Word32) L_msuNs (Word32 L_var3, Word16 var1, Word16 var2) 354 359 { 355 360 Word32 L_var_out; … … 409 414 |___________________________________________________________________________| 410 415 */ 411 Word32L_add_c (Word32 L_var1, Word32 L_var2)416 LIBG7221_DEF(Word32) L_add_c (Word32 L_var1, Word32 L_var2) 412 417 { 413 418 Word32 L_var_out; … … 525 530 |___________________________________________________________________________| 526 531 */ 527 Word32L_sub_c (Word32 L_var1, Word32 L_var2)532 LIBG7221_DEF(Word32) L_sub_c (Word32 L_var1, Word32 L_var2) 528 533 { 529 534 Word32 L_var_out; … … 618 623 |___________________________________________________________________________| 619 624 */ 620 Word32L_negate (Word32 L_var1)625 LIBG7221_DEF(Word32) L_negate (Word32 L_var1) 621 626 { 622 627 Word32 L_var_out; … … 664 669 |___________________________________________________________________________| 665 670 */ 666 Word16mult_r (Word16 var1, Word16 var2)671 LIBG7221_DEF(Word16) mult_r (Word16 var1, Word16 var2) 667 672 { 668 673 Word16 var_out; … … 729 734 |___________________________________________________________________________| 730 735 */ 731 Word16shr_r (Word16 var1, Word16 var2)736 LIBG7221_DEF(Word16) shr_r (Word16 var1, Word16 var2) 732 737 { 733 738 Word16 var_out; … … 798 803 |___________________________________________________________________________| 799 804 */ 800 Word16mac_r (Word32 L_var3, Word16 var1, Word16 var2)805 LIBG7221_DEF(Word16) mac_r (Word32 L_var3, Word16 var1, Word16 var2) 801 806 { 802 807 Word16 var_out; … … 858 863 |___________________________________________________________________________| 859 864 */ 860 Word16msu_r (Word32 L_var3, Word16 var1, Word16 var2)865 LIBG7221_DEF(Word16) msu_r (Word32 L_var3, Word16 var1, Word16 var2) 861 866 { 862 867 Word16 var_out; … … 908 913 |___________________________________________________________________________| 909 914 */ 910 Word32L_deposit_h (Word16 var1)915 LIBG7221_DEF(Word32) L_deposit_h (Word16 var1) 911 916 { 912 917 Word32 L_var_out; … … 949 954 |___________________________________________________________________________| 950 955 */ 951 Word32L_deposit_l (Word16 var1)956 LIBG7221_DEF(Word32) L_deposit_l (Word16 var1) 952 957 { 953 958 Word32 L_var_out; … … 1003 1008 |___________________________________________________________________________| 1004 1009 */ 1005 Word32L_shr_r (Word32 L_var1, Word16 var2)1010 LIBG7221_DEF(Word32) L_shr_r (Word32 L_var1, Word16 var2) 1006 1011 { 1007 1012 Word32 L_var_out; … … 1061 1066 |___________________________________________________________________________| 1062 1067 */ 1063 Word32L_abs (Word32 L_var1)1068 LIBG7221_DEF(Word32) L_abs (Word32 L_var1) 1064 1069 { 1065 1070 Word32 L_var_out; … … 1121 1126 |___________________________________________________________________________| 1122 1127 */ 1123 Word16norm_s (Word16 var1)1128 LIBG7221_DEF(Word16) norm_s (Word16 var1) 1124 1129 { 1125 1130 Word16 var_out; … … 1131 1136 else 1132 1137 { 1133 if (var1 == ( Word16)0xffff)1138 if (var1 == (UWord16)0xffff) 1134 1139 { 1135 1140 var_out = 15; … … 1192 1197 |___________________________________________________________________________| 1193 1198 */ 1194 Word16div_s (Word16 var1, Word16 var2)1199 LIBG7221_DEF(Word16) div_s (Word16 var1, Word16 var2) 1195 1200 { 1196 1201 Word16 var_out = 0; … … 1292 1297 |___________________________________________________________________________| 1293 1298 */ 1294 Word16norm_l (Word32 L_var1)1299 LIBG7221_DEF(Word16) norm_l (Word32 L_var1) 1295 1300 { 1296 1301 Word16 var_out; … … 1373 1378 |___________________________________________________________________________| 1374 1379 */ 1375 Word32L_mls (Word32 Lv, Word16 v)1380 LIBG7221_DEF(Word32) L_mls (Word32 Lv, Word16 v) 1376 1381 { 1377 1382 Word32 Temp ; … … 1432 1437 |___________________________________________________________________________| 1433 1438 */ 1434 Word16div_l (Word32 L_num, Word16 den)1439 LIBG7221_DEF(Word16) div_l (Word32 L_num, Word16 den) 1435 1440 { 1436 1441 Word16 var_out = (Word16)0; … … 1520 1525 |___________________________________________________________________________| 1521 1526 */ 1522 Word16i_mult (Word16 a, Word16 b)1527 LIBG7221_DEF(Word16) i_mult (Word16 a, Word16 b) 1523 1528 { 1524 1529 #ifdef ORIGINAL_G7231 … … 1569 1574 |___________________________________________________________________________ 1570 1575 */ 1571 Word32L_mult0 (Word16 var1,Word16 var2)1576 LIBG7221_DEF(Word32) L_mult0 (Word16 var1,Word16 var2) 1572 1577 { 1573 1578 Word32 L_var_out; … … 1613 1618 |___________________________________________________________________________ 1614 1619 */ 1615 Word32L_mac0 (Word32 L_var3, Word16 var1, Word16 var2)1620 LIBG7221_DEF(Word32) L_mac0 (Word32 L_var3, Word16 var1, Word16 var2) 1616 1621 { 1617 1622 Word32 L_var_out; … … 1661 1666 |___________________________________________________________________________ 1662 1667 */ 1663 Word32L_msu0 (Word32 L_var3, Word16 var1, Word16 var2)1668 LIBG7221_DEF(Word32) L_msu0 (Word32 L_var3, Word16 var1, Word16 var2) 1664 1669 { 1665 1670 Word32 L_var_out; … … 1712 1717 |___________________________________________________________________________| 1713 1718 */ 1714 UWord32LU_shl (UWord32 L_var1, Word16 var2)1719 LIBG7221_DEF(UWord32) LU_shl (UWord32 L_var1, Word16 var2) 1715 1720 { 1716 1721 Word16 neg_var2; … … 1743 1748 { 1744 1749 SET_OVERFLOW(1); 1745 L_var_out = MIN_32;1750 L_var_out = (UWord32)MIN_32; 1746 1751 break; 1747 1752 } … … 1792 1797 |___________________________________________________________________________| 1793 1798 */ 1794 UWord32LU_shr (UWord32 L_var1, Word16 var2)1799 LIBG7221_DEF(UWord32) LU_shr (UWord32 L_var1, Word16 var2) 1795 1800 { 1796 1801 Word16 neg_var2; … … 1826 1831 /* ------------------------- End of LU_shr() ------------------------- */ 1827 1832 1833 #endif /* PJMEDIA_LIBG7221_FUNCS_INLINED */ 1828 1834 1829 1835 /* ************************** END OF BASOP32.C ************************** */
Note: See TracChangeset
for help on using the changeset viewer.