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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 412 - (view) (download)

1 : monnier 247 functor X86MemRegs(X86Instr:X86INSTR) = struct
2 :     structure I = X86Instr
3 :    
4 :     fun error msg = MLRiscErrorMsg.impossible ("X86MemRegs." ^ msg)
5 :    
6 :     val sp = X86Cells.esp
7 :     fun memReg regmap opnd = let
8 :     fun lookup r = regmap r handle _ => r
9 :     (* see X86.prim.asm stack layout *)
10 : monnier 411 fun disp r = Int32.fromInt((lookup r-40) * 8 + X86Runtime.vFpStart)
11 : monnier 247 in
12 :     case opnd
13 : monnier 411 of I.FDirect f => I.Displace{base=sp, disp=I.Immed(disp f),
14 :     mem=I.Region.stack}
15 : monnier 247 | _ => error "memReg"
16 :     end
17 :     end

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