From 60c3e51dc5059238929e5674901bb288b5b9e870 Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Mon, 25 May 2026 14:04:07 +0900 Subject: [PATCH] test: 953 add #98 XMM-pressure row (myf.g() as 1-of-3 f64 args, MOVSD->X2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Basic x98_nested_arg only spills the imported f64 call-result into the first float slot (X0); a multi-f64-arg call forces the spill into X2 while two more f64 args are live, exercising pushargsrev's float spill under XMM register pressure — a distinct path. Verified .s diverges on master 6f8b658 (integer PUSHQ AX/POPQ DI for the myf.g() arg) and is byte-identical post-fix; cstage run exits 8 (sum3(-7,10.5,4.5)=8.0:i32). (#98) --- test/wcc/953_f64crossmod_run.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/wcc/953_f64crossmod_run.c b/test/wcc/953_f64crossmod_run.c index b05ac28e..eafd5a6c 100644 --- a/test/wcc/953_f64crossmod_run.c +++ b/test/wcc/953_f64crossmod_run.c @@ -80,6 +80,17 @@ static const struct row rows[] = { "import myf;\n" "fn dbl(x: f64) f64 = { return x * 2.0; };\n" "export fn main() i32 = { return dbl(myf.g()): i32; };\n", 242 }, + /* #98 XMM-pressure: myf.g() forwarded as the first of three f64 + * args; pushargsrev must MOVSD-spill the imported call-result into + * X2 while two more f64 args are live — a distinct path from the + * basic single-arg X0 spill above. sum3(-7,10.5,4.5)=8.0 -> i32 8. */ + { "x98_xmm_pressure", + "package myf;\n" + "export fn g() f64 = { return -7.0; };\n" + "package main;\n" + "import myf;\n" + "fn sum3(a: f64, b: f64, c: f64) f64 = { return a + b + c; };\n" + "export fn main() i32 = { return sum3(myf.g(), 10.5, 4.5): i32; };\n", 8 }, { NULL, NULL, 0 } };