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/ppc/ppcPseudoInstr.sml
ViewVC logotype

View of /sml/trunk/src/compiler/CodeGen/ppc/ppcPseudoInstr.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 246 - (download) (annotate)
Sat Apr 17 18:47:12 1999 UTC (21 years, 4 months ago) by monnier
File size: 964 byte(s)
This commit was generated by cvs2svn to compensate for changes in r245,
which included commits to RCS files with non-trunk default branches.
functor PPCPseudoInstr
  (structure Instr : PPCINSTR
     where Region = CPSRegions) : PPC_PSEUDO_INSTR = 
struct
  structure I = Instr
  structure C = Instr.C

  val stack = CPSRegions.stack
  val cvti2dTmpOff = 16			(* runtime system dependent *)
  val cvti2dConstOff = 8		(*            ''             *)
  val sp = C.stackptrR

  (* Cute little trick -- go figure *)
  fun cvti2d{reg, fd} = let
    val tmpR = C.newReg()
    val tmpF = C.newFreg()
  in
    [I.ARITHI{oper=I.XORS, rt=tmpR, ra=reg, im=I.ImmedOp 32768},
     I.ST{sz=I.Word, rs=tmpR, ra=sp, d=I.ImmedOp(cvti2dTmpOff+4), mem=stack},
     I.ARITHI{oper=I.ADDS, rt=tmpR, ra=0, im=I.ImmedOp(0x4330)},
     I.ST{sz=I.Word, rs=tmpR, ra=sp, d=I.ImmedOp(cvti2dTmpOff), mem=stack},
     I.L{sz=I.Double, rt=fd, ra=sp, d=I.ImmedOp(cvti2dTmpOff), mem=stack},
     I.L{sz=I.Double, rt=tmpF, ra=sp, d=I.ImmedOp(cvti2dConstOff), mem=stack},
     I.FARITH{oper=I.FSUB, ft=fd, fa=fd, fb=tmpF, Rc=false}]
  end
end

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