import Panic ( panic )
import Outputable
import FastString
+import Constants ( wORD_SIZE )
import GLAEXTS
| JMP Operand
| JXX Cond BlockId -- includes unconditional branches
| JMP_TBL Operand [BlockId] -- table jump
- | CALL (Either Imm Reg)
+ | CALL (Either Imm Reg) [Reg]
-- Other things.
| CLTD MachRep -- sign extend %eax into %edx:%eax
- | FETCHGOT Reg -- pseudo-insn for position-independent code
+ | FETCHGOT Reg -- pseudo-insn for ELF position-independent code
-- pretty-prints as
-- call 1f
-- 1: popl %reg
-- addl __GLOBAL_OFFSET_TABLE__+.-1b, %reg
-
+ | FETCHPC Reg -- pseudo-insn for Darwin position-independent code
+ -- pretty-prints as
+ -- call 1f
+ -- 1: popl %reg
+
+
data Operand
= OpReg Reg -- register
| OpImm Imm -- immediate value
ffree_before_nonlocal_transfers insn
= case insn of
- CALL _ -> [GFREE, insn]
- JMP _ -> [GFREE, insn]
- other -> [insn]
+ CALL _ _ -> [GFREE, insn]
+ JMP _ -> [GFREE, insn]
+ other -> [insn]
-- if you ever add a new FP insn to the fake x86 FP insn set,
| 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
-- 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