aboutsummaryrefslogtreecommitdiffhomepage
path: root/sample
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2023-12-27 09:16:06 +0900
committerMITSUNARI Shigeo <[email protected]>2023-12-27 09:16:06 +0900
commit5c95842bebbd005e0fbfe48692ae066361b18a7b (patch)
treef86ee67364f06633093f328dad5464c2cc67a8e3 /sample
parent8c44467afb480d7d3639965bed79566cafa484ad (diff)
downloadxbyak-5c95842bebbd005e0fbfe48692ae066361b18a7b.tar.gz
xbyak-5c95842bebbd005e0fbfe48692ae066361b18a7b.zip
tweak
Diffstat (limited to 'sample')
-rw-r--r--sample/no_flags.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/sample/no_flags.cpp b/sample/no_flags.cpp
index 8ab08df..52977b4 100644
--- a/sample/no_flags.cpp
+++ b/sample/no_flags.cpp
@@ -3,16 +3,13 @@
struct Code : Xbyak::CodeGenerator {
Code(bool nf) {
- if (nf) {
- puts("no flags (with T_nf)");
- } else {
- puts("change flags (without T_nf)");
- }
xor_(eax, eax); // CF = 0
mov(eax, -1);
if (nf) {
+ puts("no flags (with T_nf)");
add(eax|T_nf, eax, 1); // does not change CF
} else {
+ puts("change flags (without T_nf)");
add(eax, eax, 1); // CF = 1
}
adc(eax, 0); // eax = CF ? 1 : 0