From b8af5698413e465767996ab4e5845c62cbffcb68 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Mon, 30 Dec 2024 17:30:44 -0800 Subject: [PATCH] unittests: Adds a 3DNow! ModRM SIB encoding test This codepath was unttested in our CI. --- .../ASM/FEX_bugs/3DNow_ModRMSIBDecode.asm | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 unittests/ASM/FEX_bugs/3DNow_ModRMSIBDecode.asm diff --git a/unittests/ASM/FEX_bugs/3DNow_ModRMSIBDecode.asm b/unittests/ASM/FEX_bugs/3DNow_ModRMSIBDecode.asm new file mode 100644 index 0000000000..9ead765841 --- /dev/null +++ b/unittests/ASM/FEX_bugs/3DNow_ModRMSIBDecode.asm @@ -0,0 +1,24 @@ +%ifdef CONFIG +{ + "RegData": { + "MM0": "0x3f800000bf800000" + }, + "HostFeatures": ["3DNOW"] +} +%endif + +; FEX-Emu had a bug with 3DNow! ModRM decoding when the source was SIB encoded. +; This would result in a crash in the frontend instruction decoding. +; Generate a 3DNow! instruction that uses SIB encoding to ensure this code path is tested. +lea rax, [rel data1] +mov rbx, 0 +pi2fw mm0, [rbx * 8 + rax + 0] + +hlt + +align 8 +data1: +dw -1 +dw 0xFF +dw 1 +dw 0xFF