Changeset 46957 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jul 4, 2013 2:05:41 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllAImpl.asm
r42720 r46957 1322 1322 ; @param 2 The modified flags. 1323 1323 ; @param 3 The undefined flags. 1324 ; @param 4 1 if signed, 0 if unsigned. 1324 1325 ; 1325 1326 ; Makes ASSUMPTIONS about A0, A1, A2, A3, T0 and T1 assignments. 1326 1327 ; 1327 %macro IEMIMPL_DIV_OP 31328 %macro IEMIMPL_DIV_OP 4 1328 1329 BEGINCODE 1329 1330 BEGINPROC_FASTCALL iemAImpl_ %+ %1 %+ _u8, 12 … … 1332 1333 test A1_8, A1_8 1333 1334 jz .div_zero 1334 ;; @todo test for overflow 1335 %if %4 == 0 1336 mov ax, [A0] 1337 cmp ah, A1_8 1338 jae .div_overflow 1339 %else 1340 js .divisor_negative 1341 .divisor_positive: 1342 mov ax, [A0] 1343 test ax, ax 1344 js .divisor_positive_dividend_negative 1345 1346 .both_positive: 1347 shl ax, 1 1348 cmp ah, A1_8 1349 jae .div_overflow 1350 jmp .div_no_overflow 1351 .both_negative: 1352 neg ax 1353 shl ax, 1 1354 mov al, A1_8 1355 neg al 1356 cmp ah, al 1357 jae .div_overflow 1358 jmp .div_no_overflow 1359 1360 .divisor_positive_dividend_negative: 1361 jmp .div_no_overflow 1362 .divisor_negative: 1363 test ax, ax 1364 js .both_negative 1365 .divisor_negative_dividend_positive: 1366 jmp .div_no_overflow 1367 .div_no_overflow: 1368 %endif 1335 1369 1336 1370 IEM_MAYBE_LOAD_FLAGS A2, %2, %3 … … 1345 1379 1346 1380 .div_zero: 1381 .div_overflow: 1347 1382 mov eax, -1 1348 1383 jmp .return … … 1352 1387 PROLOGUE_4_ARGS 1353 1388 1354 test A 1_16, A1_161389 test A2_16, A2_16 1355 1390 jz .div_zero 1356 ;; @todo test for overflow 1391 %if %4 == 0 1392 cmp [A1], A2_16 1393 jae .div_overflow 1394 %else 1395 ;; @todo idiv overflow checking. 1396 %endif 1357 1397 1358 1398 IEM_MAYBE_LOAD_FLAGS A3, %2, %3 … … 1379 1419 1380 1420 .div_zero: 1421 .div_overflow: 1381 1422 mov eax, -1 1382 1423 jmp .return … … 1386 1427 PROLOGUE_4_ARGS 1387 1428 1388 test A 1_32, A1_321429 test A2_32, A2_32 1389 1430 jz .div_zero 1390 ;; @todo test for overflow 1431 %if %4 == 0 1432 cmp [A1], A2_32 1433 jae .div_overflow 1434 %else 1435 ;; @todo idiv overflow checking. 1436 %endif 1391 1437 1392 1438 IEM_MAYBE_LOAD_FLAGS A3, %2, %3 … … 1414 1460 1415 1461 .div_zero: 1462 .div_overflow: 1416 1463 mov eax, -1 1417 1464 jmp .return … … 1422 1469 PROLOGUE_4_ARGS 1423 1470 1424 test A 1, A11471 test A2, A2 1425 1472 jz .div_zero 1426 ;; @todo test for overflow 1473 %if %4 == 0 1474 cmp [A1], A2 1475 jae .div_overflow 1476 %else 1477 ;; @todo idiv overflow checking. 1478 %endif 1427 1479 1428 1480 IEM_MAYBE_LOAD_FLAGS A3, %2, %3 … … 1450 1502 1451 1503 .div_zero: 1504 .div_overflow: 1452 1505 mov eax, -1 1453 1506 jmp .return … … 1462 1515 %endmacro 1463 1516 1464 IEMIMPL_DIV_OP div, 0, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF) 1465 IEMIMPL_DIV_OP idiv, 0, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF) 1517 IEMIMPL_DIV_OP div, 0, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 0 1518 IEMIMPL_DIV_OP idiv, 0, (X86_EFL_OF | X86_EFL_SF | X86_EFL_ZF | X86_EFL_AF | X86_EFL_PF | X86_EFL_CF), 1 1466 1519 1467 1520
Note:
See TracChangeset
for help on using the changeset viewer.