X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FnativeGen%2FMachInstrs.hs;h=0f718d3ceacda83eb0f5c37ad133444084b0a505;hb=7f24ae51ed36c5c0308a2d0de23e243f32a0043c;hp=84ff2b2bd061087019e426d99fb1d3bc9c28e656;hpb=af0c406d2a8b8765761b52ddca9c1c0f99dd5cf6;p=ghc-hetmet.git diff --git a/ghc/compiler/nativeGen/MachInstrs.hs b/ghc/compiler/nativeGen/MachInstrs.hs index 84ff2b2..0f718d3 100644 --- a/ghc/compiler/nativeGen/MachInstrs.hs +++ b/ghc/compiler/nativeGen/MachInstrs.hs @@ -41,6 +41,7 @@ import CLabel ( CLabel, pprCLabel ) import Panic ( panic ) import Outputable import FastString +import Constants ( wORD_SIZE ) import GLAEXTS @@ -518,8 +519,8 @@ bit or 64 bit precision. -- pretty-prints as -- call 1f -- 1: popl %reg - - + + data Operand = OpReg Reg -- register | OpImm Imm -- immediate value @@ -611,12 +612,9 @@ is_G_instr instr | BI Cond Bool Imm -- cond, annul?, target | BF Cond Bool Imm -- cond, annul?, target - | JMP DestInfo AddrMode -- target + | JMP AddrMode -- target | CALL (Either Imm Reg) Int Bool -- target, args, terminal -data RI = RIReg Reg - | RIImm Imm - riZero :: RI -> Bool riZero (RIImm (ImmInt 0)) = True @@ -629,12 +627,12 @@ riZero _ = False -- alas -- can't have fpRelEA here because of module dependencies. fpRelEA :: Int -> Reg -> Instr fpRelEA n dst - = ADD False False fp (RIImm (ImmInt (n * BYTES_PER_WORD))) dst + = ADD False False fp (RIImm (ImmInt (n * wORD_SIZE))) dst -- Code to shift the stack pointer by n words. moveSp :: Int -> Instr moveSp n - = ADD False False sp (RIImm (ImmInt (n * BYTES_PER_WORD))) sp + = ADD False False sp (RIImm (ImmInt (n * wORD_SIZE))) sp -- Produce the second-half-of-a-double register given the first half. fPair :: Reg -> Reg