Support MO_WriteBarrier in PowerPC NCG (lwsync instruction)
authorwolfgang.thaller@gmx.net <unknown>
Mon, 11 Dec 2006 22:25:34 +0000 (22:25 +0000)
committerwolfgang.thaller@gmx.net <unknown>
Mon, 11 Dec 2006 22:25:34 +0000 (22:25 +0000)
compiler/nativeGen/MachCodeGen.hs
compiler/nativeGen/MachInstrs.hs
compiler/nativeGen/PprMach.hs

index 85292d8..3d7296d 100644 (file)
@@ -3552,6 +3552,10 @@ outOfLineFloatOp mop =
     frame just before ccalling.
 -}
 
+
+genCCall (CmmPrim MO_WriteBarrier) _ _ _
+ = return $ unitOL LWSYNC
+
 genCCall target dest_regs argsAndHints vols
   = ASSERT (not $ any (`elem` [I8,I16]) argReps)
         -- we rely on argument promotion in the codeGen
index baac1cd..9c0e71c 100644 (file)
@@ -719,4 +719,5 @@ fPair other = pprPanic "fPair(sparc NCG)" (ppr other)
              | FETCHPC Reg            -- pseudo-instruction:
                                       -- bcl to next insn, mflr reg
              
+             | LWSYNC -- memory barrier
 #endif /* powerpc_TARGET_ARCH */
index f1e0240..6965bbf 100644 (file)
@@ -2322,6 +2322,8 @@ pprInstr (FETCHPC reg) = vcat [
         hcat [ ptext SLIT("1:\tmflr\t"), pprReg reg ]
     ]
 
+pprInstr LWSYNC = ptext SLIT("\tlwsync")
+
 pprInstr _ = panic "pprInstr (ppc)"
 
 pprLogic op reg1 reg2 ri = hcat [