Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/compiler/CodeGen/x86/x86MemRegs.sml
ViewVC logotype

View of /sml/trunk/src/compiler/CodeGen/x86/x86MemRegs.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 499 - (download) (annotate)
Tue Dec 7 15:44:50 1999 UTC (20 years, 11 months ago) by monnier
File size: 737 byte(s)
This commit was generated by cvs2svn to compensate for changes in r498,
which included commits to RCS files with non-trunk default branches.
functor X86MemRegs(X86Instr:X86INSTR) = struct
  structure I = X86Instr

  fun error msg = MLRiscErrorMsg.impossible ("X86MemRegs." ^ msg)

  val sp = X86Cells.esp
  fun memReg regmap opnd = let
    (* see X86.prim.asm stack layout *)
    fun fpDisp f = Int32.fromInt((regmap f-40) * 8 + X86Runtime.vFpStart)
    fun gpDisp r = Int32.fromInt(X86Runtime.vregStart +
                                 Word.toIntX(Word.<<(Word.fromInt(r-8),0w2)))

  in
    case opnd
    of I.FDirect f => I.Displace{base=sp, disp=I.Immed(fpDisp f), 
                                 mem=I.Region.stack}
     | I.MemReg r => I.Displace{base=sp, disp=I.Immed(gpDisp r),
                                mem=I.Region.stack}
     | _ => error "memReg"
  end
end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0