X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2FnativeGen%2FX86%2FCodeGen.hs;h=5941a8cb564425c32be3ceb6b414db701a291ff4;hp=4ca8f1584095a782cdfc74cc50f1dea7a78fa4a6;hb=7854ec4b11e117f8514553890851d14a66690fbb;hpb=9d9eef1f78e25c716e2c0c7559005b730f425231 diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs index 4ca8f15..5941a8c 100644 --- a/compiler/nativeGen/X86/CodeGen.hs +++ b/compiler/nativeGen/X86/CodeGen.hs @@ -27,7 +27,7 @@ where #include "HsVersions.h" #include "nativeGen/NCG.h" -#include "MachDeps.h" +#include "../includes/MachDeps.h" -- NCG stuff: import X86.Instr @@ -1633,7 +1633,7 @@ genCCall target dest_regs args = do w = typeWidth ty r_dest_hi = getHiVRegFromLo r_dest r_dest = getRegisterReg (CmmLocal dest) - assign_code many = panic "genCCall.assign_code many" + assign_code many = pprPanic "genCCall.assign_code - too many return values:" (ppr many) return (push_code `appOL` call `appOL` @@ -1781,9 +1781,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)) -v v v v v v v 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 @@ -1884,7 +1882,10 @@ outOfLineFloatOp mop res args code2 <- stmtToInstrs (CmmAssign (CmmLocal res) (CmmReg (CmmLocal tmp))) return (code1 `appOL` code2) where - lbl = mkForeignLabel fn Nothing False IsFunction + -- Assume we can call these functions directly, and that they're not in a dynamic library. + -- TODO: Why is this ok? Under linux this code will be in libm.so + -- Is is because they're really implemented as a primitive instruction by the assembler?? -- BL 2009/12/31 + lbl = mkForeignLabel fn Nothing ForeignLabelInThisPackage IsFunction fn = case mop of MO_F32_Sqrt -> fsLit "sqrtf"