OSDN Git Service

[VM][I286_NP21][WIP] Around wait.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 16 Jun 2021 18:31:18 +0000 (03:31 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Wed, 16 Jun 2021 18:31:18 +0000 (03:31 +0900)
source/src/vm/i386_np21.cpp

index 0062c62..aeff1ad 100644 (file)
@@ -289,8 +289,10 @@ void I386::cpu_wait(int clocks)
        int64_t ncount;
        if(wfactor > 65536) {
                wcount += ((wfactor - 65536) * clocks); // Append wait due to be slower clock.
+               wcount += (wfactor * mwait);  // memory wait
+       } else {
+               wcount += (mwait << 16);
        }
-       wcount += (wfactor * mwait);  // memory wait
        if(wcount >= 65536) {
                ncount = wcount >> 16;
                wcount = wcount - (ncount << 16);