Fix #3182: 64 bit FP value returned by C calls was getting trashed
authorBen.Lippmeier@anu.edu.au <unknown>
Fri, 24 Apr 2009 06:50:53 +0000 (06:50 +0000)
committerBen.Lippmeier@anu.edu.au <unknown>
Fri, 24 Apr 2009 06:50:53 +0000 (06:50 +0000)
   movss instruction was being used to move the result into the
   destination register instead of movsd

compiler/nativeGen/X86/CodeGen.hs

index 135ac36..4cfeacc 100644 (file)
@@ -1779,7 +1779,7 @@ genCCall target dest_regs args = do
        assign_code [CmmHinted dest _hint] = 
          case typeWidth rep of
                W32 | isFloatType rep -> unitOL (MOV (floatSize W32) (OpReg xmm0) (OpReg r_dest))
        assign_code [CmmHinted dest _hint] = 
          case typeWidth rep of
                W32 | isFloatType rep -> unitOL (MOV (floatSize W32) (OpReg xmm0) (OpReg r_dest))
-               W64 | isFloatType rep -> unitOL (MOV (floatSize W32) (OpReg xmm0) (OpReg r_dest))
+               W64 | isFloatType rep -> unitOL (MOV (floatSize W64) (OpReg xmm0) (OpReg r_dest))
                _ -> unitOL (MOV (cmmTypeSize rep) (OpReg rax) (OpReg r_dest))
          where 
                rep = localRegType dest
                _ -> unitOL (MOV (cmmTypeSize rep) (OpReg rax) (OpReg r_dest))
          where 
                rep = localRegType dest