From 7f64999233e982b93df03ee7330aabc0dfcd9232 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Thu, 16 Apr 2020 12:08:39 -0700 Subject: [PATCH] Extends cvtsi2ss unit test to ensure 32bit correctness This puts some data in the upper 32bits and makes the number negative to see if the code gets translated incorrectly. The x86 JIT currently hits this --- unittests/ASM/REP/F3_2A.asm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/unittests/ASM/REP/F3_2A.asm b/unittests/ASM/REP/F3_2A.asm index 707574f45..f3b842597 100644 --- a/unittests/ASM/REP/F3_2A.asm +++ b/unittests/ASM/REP/F3_2A.asm @@ -4,7 +4,9 @@ "XMM0": ["0x414243443f800000", "0x5152535455565758"], "XMM1": ["0x4142434440000000", "0x5152535455565758"], "XMM2": ["0x4142434440400000", "0x5152535455565758"], - "XMM3": ["0x4142434440800000", "0x5152535455565758"] + "XMM3": ["0x4142434440800000", "0x5152535455565758"], + "XMM4": ["0x41424344C0800000", "0x5152535455565758"], + "XMM5": ["0x41424344C0800000", "0x5152535455565758"] }, "MemoryRegions": { "0x100000000": "4096" @@ -28,10 +30,16 @@ mov [rdx + 8 * 4], rax mov rax, 0x4 mov [rdx + 8 * 5], rax +; Stick something in the top 32bits to ensure correctness +mov rax, 0x7fc00000FFFFFFFC +mov [rdx + 8 * 6], rax + movapd xmm0, [rdx + 8 * 0] movapd xmm1, [rdx + 8 * 0] movapd xmm2, [rdx + 8 * 0] movapd xmm3, [rdx + 8 * 0] +movapd xmm4, [rdx + 8 * 0] +movapd xmm5, [rdx + 8 * 0] mov rax, [rdx + 8 * 2] mov rbx, [rdx + 8 * 3] @@ -42,4 +50,9 @@ cvtsi2ss xmm1, ebx cvtsi2ss xmm2, dword [rdx + 8 * 4] cvtsi2ss xmm3, qword [rdx + 8 * 5] +mov rbx, [rdx + 8 * 6] + +cvtsi2ss xmm4, ebx +cvtsi2ss xmm5, dword [rdx + 8 * 6] + hlt