Lines Matching refs:s

182 static void calc_carry_chain(int bits, u32 d, u32 s, u32 res, int set_carry)  in calc_carry_chain()  argument
186 cc = (s & d) | ((~res) & (s | d)); in calc_carry_chain()
194 static void calc_borrow_chain(int bits, u32 d, u32 s, u32 res, int set_carry) in calc_borrow_chain() argument
198 bc = (res & (~d | s)) | (~d & s); in calc_borrow_chain()
285 u8 adc_byte(u8 d, u8 s) in adc_byte() argument
289 res = d + s; in adc_byte()
293 calc_carry_chain(8,s,d,res,1); in adc_byte()
302 u16 adc_word(u16 d, u16 s) in adc_word() argument
306 res = d + s; in adc_word()
311 calc_carry_chain(16,s,d,res,1); in adc_word()
320 u32 adc_long(u32 d, u32 s) in adc_long() argument
326 lo = (d & 0xFFFF) + (s & 0xFFFF); in adc_long()
327 res = d + s; in adc_long()
334 hi = (lo >> 16) + (d >> 16) + (s >> 16); in adc_long()
337 calc_carry_chain(32,s,d,res,0); in adc_long()
348 u8 add_byte(u8 d, u8 s) in add_byte() argument
352 res = d + s; in add_byte()
354 calc_carry_chain(8,s,d,res,1); in add_byte()
363 u16 add_word(u16 d, u16 s) in add_word() argument
367 res = d + s; in add_word()
369 calc_carry_chain(16,s,d,res,1); in add_word()
378 u32 add_long(u32 d, u32 s) in add_long() argument
382 res = d + s; in add_long()
384 calc_carry_chain(32,s,d,res,0); in add_long()
386 CONDITIONAL_SET_FLAG(res < d || res < s, F_CF); in add_long()
395 u8 and_byte(u8 d, u8 s) in and_byte() argument
399 res = d & s; in and_byte()
409 u16 and_word(u16 d, u16 s) in and_word() argument
413 res = d & s; in and_word()
423 u32 and_long(u32 d, u32 s) in and_long() argument
427 res = d & s; in and_long()
436 u8 cmp_byte(u8 d, u8 s) in cmp_byte() argument
440 res = d - s; in cmp_byte()
442 calc_borrow_chain(8, d, s, res, 1); in cmp_byte()
451 u16 cmp_word(u16 d, u16 s) in cmp_word() argument
455 res = d - s; in cmp_word()
457 calc_borrow_chain(16, d, s, res, 1); in cmp_word()
466 u32 cmp_long(u32 d, u32 s) in cmp_long() argument
470 res = d - s; in cmp_long()
472 calc_borrow_chain(32, d, s, res, 1); in cmp_long()
609 u8 or_byte(u8 d, u8 s) in or_byte() argument
613 res = d | s; in or_byte()
623 u16 or_word(u16 d, u16 s) in or_word() argument
627 res = d | s; in or_word()
636 u32 or_long(u32 d, u32 s) in or_long() argument
640 res = d | s; in or_long()
649 u8 neg_byte(u8 s) in neg_byte() argument
653 CONDITIONAL_SET_FLAG(s != 0, F_CF); in neg_byte()
654 res = (u8)-s; in neg_byte()
656 calc_borrow_chain(8, 0, s, res, 0); in neg_byte()
665 u16 neg_word(u16 s) in neg_word() argument
669 CONDITIONAL_SET_FLAG(s != 0, F_CF); in neg_word()
670 res = (u16)-s; in neg_word()
672 calc_borrow_chain(16, 0, s, res, 0); in neg_word()
681 u32 neg_long(u32 s) in neg_long() argument
685 CONDITIONAL_SET_FLAG(s != 0, F_CF); in neg_long()
686 res = (u32)-s; in neg_long()
688 calc_borrow_chain(32, 0, s, res, 0); in neg_long()
697 u8 not_byte(u8 s) in not_byte() argument
699 return ~s; in not_byte()
706 u16 not_word(u16 s) in not_word() argument
708 return ~s; in not_word()
715 u32 not_long(u32 s) in not_long() argument
717 return ~s; in not_long()
724 u8 rcl_byte(u8 d, u8 s) in rcl_byte() argument
755 if ((cnt = s % 9) != 0) { in rcl_byte()
797 u16 rcl_word(u16 d, u8 s) in rcl_word() argument
802 if ((cnt = s % 17) != 0) { in rcl_word()
821 u32 rcl_long(u32 d, u8 s) in rcl_long() argument
826 if ((cnt = s % 33) != 0) { in rcl_long()
845 u8 rcr_byte(u8 d, u8 s) in rcr_byte() argument
873 if ((cnt = s % 9) != 0) { in rcr_byte()
929 u16 rcr_word(u16 d, u8 s) in rcr_word() argument
936 if ((cnt = s % 17) != 0) { in rcr_word()
961 u32 rcr_long(u32 d, u8 s) in rcr_long() argument
968 if ((cnt = s % 33) != 0) { in rcr_long()
994 u8 rol_byte(u8 d, u8 s) in rol_byte() argument
1015 if ((cnt = s % 8) != 0) { in rol_byte()
1028 CONDITIONAL_SET_FLAG(s == 1 && in rol_byte()
1031 } if (s != 0) { in rol_byte()
1043 u16 rol_word(u16 d, u8 s) in rol_word() argument
1048 if ((cnt = s % 16) != 0) { in rol_word()
1053 CONDITIONAL_SET_FLAG(s == 1 && in rol_word()
1056 } if (s != 0) { in rol_word()
1068 u32 rol_long(u32 d, u8 s) in rol_long() argument
1073 if ((cnt = s % 32) != 0) { in rol_long()
1078 CONDITIONAL_SET_FLAG(s == 1 && in rol_long()
1081 } if (s != 0) { in rol_long()
1093 u8 ror_byte(u8 d, u8 s) in ror_byte() argument
1113 if ((cnt = s % 8) != 0) { /* not a typo, do nada if cnt==0 */ in ror_byte()
1126 CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF); in ror_byte()
1127 } else if (s != 0) { in ror_byte()
1139 u16 ror_word(u16 d, u8 s) in ror_word() argument
1144 if ((cnt = s % 16) != 0) { in ror_word()
1149 CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF); in ror_word()
1150 } else if (s != 0) { in ror_word()
1162 u32 ror_long(u32 d, u8 s) in ror_long() argument
1167 if ((cnt = s % 32) != 0) { in ror_long()
1172 CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF); in ror_long()
1173 } else if (s != 0) { in ror_long()
1185 u8 shl_byte(u8 d, u8 s) in shl_byte() argument
1189 if (s < 8) { in shl_byte()
1190 cnt = s % 8; in shl_byte()
1214 CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80, F_CF); in shl_byte()
1227 u16 shl_word(u16 d, u8 s) in shl_word() argument
1231 if (s < 16) { in shl_word()
1232 cnt = s % 16; in shl_word()
1252 CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF); in shl_word()
1265 u32 shl_long(u32 d, u8 s) in shl_long() argument
1269 if (s < 32) { in shl_long()
1270 cnt = s % 32; in shl_long()
1287 CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF); in shl_long()
1300 u8 shr_byte(u8 d, u8 s) in shr_byte() argument
1304 if (s < 8) { in shr_byte()
1305 cnt = s % 8; in shr_byte()
1322 CONDITIONAL_SET_FLAG((d >> (s-1)) & 0x1, F_CF); in shr_byte()
1335 u16 shr_word(u16 d, u8 s) in shr_word() argument
1339 if (s < 16) { in shr_word()
1340 cnt = s % 16; in shr_word()
1370 u32 shr_long(u32 d, u8 s) in shr_long() argument
1374 if (s < 32) { in shr_long()
1375 cnt = s % 32; in shr_long()
1404 u8 sar_byte(u8 d, u8 s) in sar_byte() argument
1410 cnt = s % 8; in sar_byte()
1442 u16 sar_word(u16 d, u8 s) in sar_word() argument
1447 cnt = s % 16; in sar_word()
1480 u32 sar_long(u32 d, u8 s) in sar_long() argument
1485 cnt = s % 32; in sar_long()
1518 u16 shld_word (u16 d, u16 fill, u8 s) in shld_word() argument
1522 if (s < 16) { in shld_word()
1523 cnt = s % 16; in shld_word()
1540 CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF); in shld_word()
1553 u32 shld_long (u32 d, u32 fill, u8 s) in shld_long() argument
1557 if (s < 32) { in shld_long()
1558 cnt = s % 32; in shld_long()
1575 CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF); in shld_long()
1588 u16 shrd_word (u16 d, u16 fill, u8 s) in shrd_word() argument
1592 if (s < 16) { in shrd_word()
1593 cnt = s % 16; in shrd_word()
1623 u32 shrd_long (u32 d, u32 fill, u8 s) in shrd_long() argument
1627 if (s < 32) { in shrd_long()
1628 cnt = s % 32; in shrd_long()
1657 u8 sbb_byte(u8 d, u8 s) in sbb_byte() argument
1663 res = d - s - 1; in sbb_byte()
1665 res = d - s; in sbb_byte()
1669 bc = (res & (~d | s)) | (~d & s); in sbb_byte()
1680 u16 sbb_word(u16 d, u16 s) in sbb_word() argument
1686 res = d - s - 1; in sbb_word()
1688 res = d - s; in sbb_word()
1692 bc = (res & (~d | s)) | (~d & s); in sbb_word()
1703 u32 sbb_long(u32 d, u32 s) in sbb_long() argument
1709 res = d - s - 1; in sbb_long()
1711 res = d - s; in sbb_long()
1716 bc = (res & (~d | s)) | (~d & s); in sbb_long()
1727 u8 sub_byte(u8 d, u8 s) in sub_byte() argument
1732 res = d - s; in sub_byte()
1736 bc = (res & (~d | s)) | (~d & s); in sub_byte()
1747 u16 sub_word(u16 d, u16 s) in sub_word() argument
1752 res = d - s; in sub_word()
1756 bc = (res & (~d | s)) | (~d & s); in sub_word()
1767 u32 sub_long(u32 d, u32 s) in sub_long() argument
1772 res = d - s; in sub_long()
1776 bc = (res & (~d | s)) | (~d & s); in sub_long()
1787 void test_byte(u8 d, u8 s) in test_byte() argument
1791 res = d & s; in test_byte()
1803 void test_word(u16 d, u16 s) in test_word() argument
1807 res = d & s; in test_word()
1819 void test_long(u32 d, u32 s) in test_long() argument
1823 res = d & s; in test_long()
1835 u8 xor_byte(u8 d, u8 s) in xor_byte() argument
1839 res = d ^ s; in xor_byte()
1848 u16 xor_word(u16 d, u16 s) in xor_word() argument
1852 res = d ^ s; in xor_word()
1861 u32 xor_long(u32 d, u32 s) in xor_long() argument
1865 res = d ^ s; in xor_long()
1874 void imul_byte(u8 s) in imul_byte() argument
1876 s16 res = (s16)((s8)M.x86.R_AL * (s8)s); in imul_byte()
1893 void imul_word(u16 s) in imul_word() argument
1895 s32 res = (s16)M.x86.R_AX * (s16)s; in imul_word()
1913 void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s) in imul_long_direct() argument
1916 s64 res = (s32)d * (s32)s; in imul_long_direct()
1929 if ((s_sign = s & 0x80000000) != 0) in imul_long_direct()
1930 s = -s; in imul_long_direct()
1931 s_lo = s & 0xFFFF; in imul_long_direct()
1932 s_hi = s >> 16; in imul_long_direct()
1940 s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16); in imul_long_direct()
1942 *res_hi = ~*res_hi+(s >> 16); in imul_long_direct()
1951 void imul_long(u32 s) in imul_long() argument
1953 imul_long_direct(&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s); in imul_long()
1968 void mul_byte(u8 s) in mul_byte() argument
1970 u16 res = (u16)(M.x86.R_AL * s); in mul_byte()
1986 void mul_word(u16 s) in mul_word() argument
1988 u32 res = M.x86.R_AX * s; in mul_word()
2005 void mul_long(u32 s) in mul_long() argument
2008 u64 res = (u32)M.x86.R_EAX * (u32)s; in mul_long()
2020 s_lo = s & 0xFFFF; in mul_long()
2021 s_hi = s >> 16; in mul_long()
2041 void idiv_byte(u8 s) in idiv_byte() argument
2046 if (s == 0) { in idiv_byte()
2050 div = dvd / (s8)s; in idiv_byte()
2051 mod = dvd % (s8)s; in idiv_byte()
2064 void idiv_word(u16 s) in idiv_word() argument
2069 if (s == 0) { in idiv_word()
2073 div = dvd / (s16)s; in idiv_word()
2074 mod = dvd % (s16)s; in idiv_word()
2092 void idiv_long(u32 s) in idiv_long() argument
2098 if (s == 0) { in idiv_long()
2102 div = dvd / (s32)s; in idiv_long()
2103 mod = dvd % (s32)s; in idiv_long()
2112 u32 abs_s = s & 0x7FFFFFFF; in idiv_long()
2119 if (s == 0) { in idiv_long()
2148 div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000)); in idiv_long()
2166 void div_byte(u8 s) in div_byte() argument
2171 if (s == 0) { in div_byte()
2175 div = dvd / (u8)s; in div_byte()
2176 mod = dvd % (u8)s; in div_byte()
2189 void div_word(u16 s) in div_word() argument
2194 if (s == 0) { in div_word()
2198 div = dvd / (u16)s; in div_word()
2199 mod = dvd % (u16)s; in div_word()
2217 void div_long(u32 s) in div_long() argument
2223 if (s == 0) { in div_long()
2227 div = dvd / (u32)s; in div_long()
2228 mod = dvd % (u32)s; in div_long()
2238 u32 h_s = s; in div_long()
2243 if (s == 0) { in div_long()
2253 l_s = s << (--counter); in div_long()
2260 l_s = s << (--counter); in div_long()
2267 if (h_dvd || (l_dvd > s)) { in div_long()