Merge pull request #5841 from OFFTKP/blsmsk

unittests/ASM: Test BLSR/BLSMSK CF flag
This commit is contained in:
LC authored and GitHub committed 2026-08-22 23:13:27 -04:00
commit af9b438eec
5 files changed
+38 -6

No files matched your search

@@ -1774,7 +1774,7 @@ void OpDispatchBuilder::BLSMSKBMIOp(OpcodeArgs) {
InvalidatePF_AF();
// CF set according to the Src
auto CFInv = To01(OpSize::i64Bit, Src);
auto CFInv = To01(Size, Src);
// The output of BLSMSK is always nonzero, so TST will clear Z (along with C
// and O) while setting S.
@@ -1792,7 +1792,7 @@ void OpDispatchBuilder::BLSRBMIOp(OpcodeArgs) {
StoreResultGPR(Op, Result);
auto CFInv = To01(OpSize::i64Bit, Src);
auto CFInv = To01(Size, Src);
SetNZ_ZeroCV(Size, Result);
SetCFInverted(CFInv);
+16
View File
@@ -0,0 +1,16 @@
%ifdef CONFIG
{
"RegData": {
"RAX": "0xFFFFFFFF",
"RCX": "1"
},
"HostFeatures": ["BMI1"]
}
%endif
mov rbx, 0xFFFFFFFF00000000
blsmsk eax, ebx
setc cl
movzx rcx, cl
hlt
+16
View File
@@ -0,0 +1,16 @@
%ifdef CONFIG
{
"RegData": {
"RAX": "0",
"RCX": "1"
},
"HostFeatures": ["BMI1"]
}
%endif
mov rbx, 0xFFFFFFFF00000000
blsr eax, ebx
setc cl
movzx rcx, cl
hlt
@@ -19,7 +19,7 @@
"ExpectedArm64ASM": [
"sub w20, w6, #0x1 (1)",
"and w4, w20, w6",
"cmp x6, #0x0 (0)",
"cmp w6, #0x0 (0)",
"cset x20, ne",
"cmp w4, #0x0 (0)",
"rmif x20, #63, #nzCv"
@@ -47,7 +47,7 @@
"ExpectedArm64ASM": [
"sub w20, w6, #0x1 (1)",
"eor w4, w20, w6",
"cmp x6, #0x0 (0)",
"cmp w6, #0x0 (0)",
"cset x20, ne",
"cmp w4, #0x0 (0)",
"rmif x20, #63, #nzCv"
@@ -605,7 +605,7 @@
"ExpectedArm64ASM": [
"sub w20, w6, #0x1 (1)",
"and w4, w20, w6",
"cmp x6, #0x0 (0)",
"cmp w6, #0x0 (0)",
"cset x20, ne",
"cmp w4, #0x0 (0)",
"mrs x21, nzcv",
@@ -637,7 +637,7 @@
"ExpectedArm64ASM": [
"sub w20, w6, #0x1 (1)",
"eor w4, w20, w6",
"cmp x6, #0x0 (0)",
"cmp w6, #0x0 (0)",
"cset x20, ne",
"cmp w4, #0x0 (0)",
"mrs x21, nzcv",