From 05ee4e6d7ae5e0a5beac7ae43d657113d467fdd7 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Wed, 30 Dec 2020 10:00:51 -0800 Subject: [PATCH] Adds cvtsi2ss unit test to ensure proper 64bit->float conversion --- unittests/ASM/REP/F3_2A_2.asm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 unittests/ASM/REP/F3_2A_2.asm diff --git a/unittests/ASM/REP/F3_2A_2.asm b/unittests/ASM/REP/F3_2A_2.asm new file mode 100644 index 000000000..4160bcafd --- /dev/null +++ b/unittests/ASM/REP/F3_2A_2.asm @@ -0,0 +1,23 @@ +%ifdef CONFIG +{ + "RegData": { + "XMM0": ["0x414243444F800000", "0x5152535455565758"] + } +} +%endif + +mov rdx, 0xe0000000 + +mov rax, 0x4142434445464748 +mov [rdx + 8 * 0], rax +mov rax, 0x5152535455565758 +mov [rdx + 8 * 1], rax + +movapd xmm0, [rdx + 8 * 0] + +; Ensures that a large "negative" 32bit value converts correctly in cvtsi2ss when treated as a 64bit value +; Upper bits being zero +mov rax, 0xFFFFFFFF +cvtsi2ss xmm0, rax + +hlt