X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FX86%2FInstr.hs;h=0dea1dd66d02b4fb24181b8e2b23eb13be8319ae;hb=efbf8ab4eabc1636417b3ea0ca3f5aa227491d9a;hp=544dc6bf4add6bff6864aa25e1902be11adede08;hpb=a12e845684c10955bc594cdb20d1f13fae14873d;p=ghc-hetmet.git diff --git a/compiler/nativeGen/X86/Instr.hs b/compiler/nativeGen/X86/Instr.hs index 544dc6b..0dea1dd 100644 --- a/compiler/nativeGen/X86/Instr.hs +++ b/compiler/nativeGen/X86/Instr.hs @@ -13,14 +13,13 @@ module X86.Instr where import BlockId -import Regs +import X86.Regs +import RegsBase import Cmm import FastString -#if i386_TARGET_ARCH import CLabel import Panic -#endif data Cond = ALWAYS -- What's really used? ToDo @@ -40,7 +39,7 @@ data Cond | OFLO | PARITY | NOTPARITY - + deriving (Eq) -- ----------------------------------------------------------------------------- @@ -200,9 +199,7 @@ data Instr | BT Size Imm Operand | NOP -#if i386_TARGET_ARCH - -- Float Arithmetic. - + -- x86 Float Arithmetic. -- Note that we cheat by treating G{ABS,MOV,NEG} of doubles -- as single instructions right up until we spit them out. -- all the 3-operand fake fp insns are src1 src2 dst @@ -240,14 +237,11 @@ data Instr | GTAN Size CLabel CLabel Reg Reg -- src, dst | GFREE -- do ffree on all x86 regs; an ugly hack -#endif -#if x86_64_TARGET_ARCH --- SSE2 floating point: we use a restricted set of the available SSE2 --- instructions for floating-point. + -- SSE2 floating point: we use a restricted set of the available SSE2 + -- instructions for floating-point. -- use MOV for moving (either movss or movsd (movlpd better?)) - | CVTSS2SD Reg Reg -- F32 to F64 | CVTSD2SS Reg Reg -- F64 to F32 | CVTTSS2SIQ Operand Reg -- F32 to I32/I64 (with truncation) @@ -265,7 +259,7 @@ data Instr -- compare single/double prec floating point respectively. | SQRT Size Operand Reg -- src, dst -#endif + -- Comparison | TEST Size Operand Operand @@ -306,7 +300,7 @@ data Operand | OpAddr AddrMode -- memory reference -#if i386_TARGET_ARCH + i386_insert_ffrees :: [GenBasicBlock Instr] -> [GenBasicBlock Instr] i386_insert_ffrees blocks | or (map (any is_G_instr) [ instrs | BasicBlock _ instrs <- blocks ]) @@ -349,4 +343,3 @@ is_G_instr instr GTAN{} -> True GFREE -> panic "is_G_instr: GFREE (!)" _ -> False -#endif /* i386_TARGET_ARCH */