FIX #1843: Generate different instructions on PPC
authorIan Lynagh <igloo@earth.li>
Mon, 3 Dec 2007 12:32:37 +0000 (12:32 +0000)
committerIan Lynagh <igloo@earth.li>
Mon, 3 Dec 2007 12:32:37 +0000 (12:32 +0000)
The old ones caused lots of
    unknown scattered relocation type 4
errors. Patch from Chris Kuklewicz.

compiler/nativeGen/MachCodeGen.hs

index 7108c48..4692f06 100644 (file)
@@ -1751,8 +1751,8 @@ getRegister (CmmLit lit)
   = let rep = cmmLitRep lit
         imm = litToImm lit
         code dst = toOL [
-              LIS dst (HI imm),
-              OR dst dst (RIImm (LO imm))
+              LIS dst (HA imm),
+              ADD dst dst (RIImm (LO imm))
           ]
     in return (Any rep code)