Squashed 'external/xbyak/' content from commit 431abd86

git-subtree-dir: external/xbyak
git-subtree-split: 431abd865e70a46d56f5aa0e1f87572decb60169
This commit is contained in:
2026-05-12 14:03:16 +02:00
commit 2201a02272
146 changed files with 108693 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
#include <stdio.h>
#include <xbyak/xbyak.h>
struct Code : Xbyak::CodeGenerator {
Code(bool 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
ret();
}
};
int main() {
for (int i = 0; i < 2; i++) {
Code c(i);
printf("i=%d ret=%d\n", i, c.getCode<int(*)()>()());
}
}