-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: enable O2 when building solution cause the do-nothing loop be op…
…timized
- Loading branch information
Showing
5 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
wait_until_smaller PROTO | ||
; arguments | ||
; xmm0: REAL4 a REAL4 variable need to be compared | ||
; rdx: SQWORD PTR a SQWORD pointer which value be pointed would increase | ||
; this procedure would block the thread until the condition is fulfilled | ||
; Caution: it may cause the thread is blocked by a infinite loop | ||
.CODE | ||
wait_until_smaller PROC | ||
push rbp | ||
mov rbp, rsp | ||
compare: | ||
cvtsi2ss xmm1, SQWORD PTR [rdx] ; convert rdx to REAL4 type and store it in xmm1 | ||
comiss xmm0,xmm1 ; compare xmm0 with xmm1 | ||
jbe fufilled ; jump to fufilled if xmm0 <= xmm1 | ||
jmp compare ; jump to compare if xmm0 > xmm1 | ||
fufilled: | ||
leave | ||
ret | ||
wait_until_smaller ENDP | ||
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
#include <QThread> | ||
extern "C" void wait_until_smaller(float, qint64*); |