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

SCM Repository

[smlnj] Diff of /MLRISC/trunk/amd64/mltree/amd64-gen.sml
ViewVC logotype

Diff of /MLRISC/trunk/amd64/mltree/amd64-gen.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2807, Mon Oct 22 19:10:27 2007 UTC revision 2808, Tue Oct 23 07:04:33 2007 UTC
# Line 8  Line 8 
8      structure MLTreeUtils : MLTREE_UTILS      structure MLTreeUtils : MLTREE_UTILS
9          where T = I.T          where T = I.T
10      structure ExtensionComp : MLTREE_EXTENSION_COMP      structure ExtensionComp : MLTREE_EXTENSION_COMP
11          where I = I and T = I.T) : MLTREECOMP =          where I = I and T = I.T
12    struct  
13        val floatNegate : int -> Label.label
14       ) : MLTREECOMP = struct
15    
16      structure TS = ExtensionComp.TS      structure TS = ExtensionComp.TS
17      structure T = I.T      structure T = I.T
# Line 31  Line 33 
33              val rep = NEITHER)              val rep = NEITHER)
34      structure W32 = Word32      structure W32 = Word32
35    
   
36      fun error msg = MLRiscErrorMsg.error ("AMD64Gen", msg)      fun error msg = MLRiscErrorMsg.error ("AMD64Gen", msg)
37    
38      type instrStream = (I.instruction,C.cellset,CFG.cfg) TS.stream      type instrStream = (I.instruction,C.cellset,CFG.cfg) TS.stream
# Line 915  Line 916 
916                 | T.FMUL (_, a, b) => fbinop (fty, O.fmulOp fty, a, b, d, an)                 | T.FMUL (_, a, b) => fbinop (fty, O.fmulOp fty, a, b, d, an)
917                 | T.FDIV (_, a, b) => fbinop (fty, O.fdivOp fty, a, b, d, an)                 | T.FDIV (_, a, b) => fbinop (fty, O.fdivOp fty, a, b, d, an)
918                 (* unary operators *)                 (* unary operators *)
919                 | T.FNEG (_, a) => raise Fail "todo"                 | T.FNEG (_, a) => let
920                     val l = floatNegate fty
921                     val fop = (case fty
922                         of 32 => I.XORPS
923                          | 64 => I.XORPD
924                         (* end case *))
925                     val r = newFreg ()
926                     in
927                         fload (fty, T.LABEL l, I.Region.memory, r, an);
928                         mark (fop {dst=I.FDirect r, src=I.FDirect (fexpToReg (fty, a))}, an);
929                         fcopy (fty, [d], [r], an)
930                     end
931                 | T.FABS (_, a) => raise Fail "todo"                 | T.FABS (_, a) => raise Fail "todo"
932                 | T.FSQRT (fty, a) => fsqrt (fty, d, a, an)                 | T.FSQRT (fty, a) => fsqrt (fty, d, a, an)
933                 (* conversions *)                 (* conversions *)

Legend:
Removed from v.2807  
changed lines
  Added in v.2808

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