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/MLRISC/ppc/instructions/ppcShuffle.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/ppc/instructions/ppcShuffle.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 429 - (download) (annotate)
Wed Sep 8 09:47:00 1999 UTC (20 years, 2 months ago) by monnier
Original Path: sml/branches/SMLNJ/src/MLRISC/ppc/instructions/ppcShuffle.sml
File size: 1228 byte(s)
version 110.21
functor PPCShuffle(I:PPCINSTR) = struct
  structure I = I
  structure Shuffle = Shuffle(I)

  val mem=I.Region.memory

  type t = {regmap:I.C.cell->I.C.cell, tmp:I.ea option,
            dst:I.C.cell list, src:I.C.cell list}

  fun error msg = MLRiscErrorMsg.error("PPCShuffle",msg)

  (* WARNING: these move operators assume 32 bit addressing is used! 
   * Allen
   *)
  fun move{src=I.Direct rs, dst=I.Direct rd} = 
        [I.ARITH{oper=I.OR, rt=rd, ra=rs, rb=rs, Rc=false, OE=false}]
    | move{src=I.Direct rs, dst=I.Displace{base, disp}} = 
	[I.ST{st=I.STW, rs=rs, ra=base, d=disp, mem=mem}]
    | move{src=I.Displace{base, disp}, dst=I.Direct rt} = 
	[I.L{ld=I.LWZ, rt=rt, ra=base, d=disp, mem=mem}]
    | move _ = error "move"

  fun fmove{src=I.FDirect fs, dst=I.FDirect fd} = 
        [I.FUNARY{oper=I.FMR, fb=fs, ft=fd, Rc=false}]
    | fmove{src=I.FDirect fs, dst=I.Displace{base, disp}} = 
	[I.STF{st=I.STFD, fs=fs, ra=base, d=disp, mem=mem}]
    | fmove{src=I.Displace{base, disp}, dst=I.FDirect ft} =
	[I.LF{ld=I.LFD, ft=ft, ra=base, d=disp, mem=mem}]
    | fmove _ = error "fmove"

  val shuffle = Shuffle.shuffle {mvInstr=move, ea=I.Direct}

  val shufflefp = Shuffle.shuffle {mvInstr=fmove, ea=I.FDirect}
end

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