From 6790702901fcd6ab829b245f0bb08826ebeb0c72 Mon Sep 17 00:00:00 2001 From: losfair Date: Tue, 12 May 2020 03:03:39 +0800 Subject: [PATCH] Add comment to explain the change to I64ExtendI32U. --- lib/singlepass-backend/src/codegen_x64.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/singlepass-backend/src/codegen_x64.rs b/lib/singlepass-backend/src/codegen_x64.rs index de7248db3..c40ada2f1 100644 --- a/lib/singlepass-backend/src/codegen_x64.rs +++ b/lib/singlepass-backend/src/codegen_x64.rs @@ -4052,6 +4052,9 @@ impl FunctionCodeGenerator for X64FunctionCode { loc, ret, ); + + // A 32-bit memory write does not automatically clear the upper 32 bits of a 64-bit word. + // So, we need to explicitly write zero to the upper half here. if let Location::Memory(base, off) = ret { Self::emit_relaxed_binop( a,