From 6103e1e2daf6aceb1a827723a1a2379ec655e946 Mon Sep 17 00:00:00 2001 From: "andy@galois.com" Date: Tue, 10 Jul 2007 07:17:13 +0000 Subject: [PATCH] FIX rts build failure for powerPC build The rts was failing with ../compiler/ghc-inplace -H64m -Onot -fasm -optc-O2 -static -I../gmp/gmpbuild -I. -#include HCIncludes.h -dcmm-lint -hisuf thr_p_hi -hcsuf thr_p_hc -osuf thr_p_o -optc-DTHREADED_RTS -prof -#include posix/Itimer.h -c PrimOps.cmm -o PrimOps.thr_p_o ghc-6.7.20070709: panic! (the 'impossible' happened) (GHC version 6.7.20070709 for powerpc-apple-darwin): iselExpr64(powerpc) %MO_U_Conv_I32_I64(16 / 4 - 2) There was a special case for x86; so it has been transliterated to the PPC, and the output code looks plausable. --- compiler/nativeGen/MachCodeGen.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/nativeGen/MachCodeGen.hs b/compiler/nativeGen/MachCodeGen.hs index b29b59e..2c07016 100644 --- a/compiler/nativeGen/MachCodeGen.hs +++ b/compiler/nativeGen/MachCodeGen.hs @@ -433,6 +433,13 @@ iselExpr64 (CmmMachOp (MO_Add _) [e1,e2]) = do -- in return (ChildCode64 code rlo) +iselExpr64 (CmmMachOp (MO_U_Conv I32 I64) [expr]) = do + (expr_reg,expr_code) <- getSomeReg expr + (rlo, rhi) <- getNewRegPairNat I32 + let mov_hi = LI rhi (ImmInt 0) + mov_lo = MR rlo expr_reg + return $ ChildCode64 (expr_code `snocOL` mov_lo `snocOL` mov_hi) + rlo iselExpr64 expr = pprPanic "iselExpr64(powerpc)" (ppr expr) -- 1.7.10.4