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/hppa/hppaShuffle.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/hppa/hppaShuffle.sml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 114 - (download) (annotate)
Fri Jun 5 19:41:21 1998 UTC (22 years, 10 months ago) by monnier
File size: 1314 byte(s)
This commit was generated by cvs2svn to compensate for changes in r113,
which included commits to RCS files with non-trunk default branches.
functor HppaShuffle(I:HPPAINSTR) = struct
  structure I = I
  structure Shuffle = Shuffle(I)
  type t = {regMap:int->int, temp:I.ea option, dst:int list, src:int list}

  fun error msg = MLRiscErrorMsg.impossible ("HppaShuffle." ^ msg)
  val mem = I.Region.memory

  fun move{src=I.Direct rs, dst=I.Direct rt} = [I.ARITH{a=I.OR, r1=rs, r2=0, t=rt}]
    | move{src=I.Displace{base, disp}, dst=I.Direct rt} =
       [I.LOADI{li=I.LDW, r=base, i=I.IMMED disp, t=rt, mem=mem}]
    | move{src=I.Direct rs, dst=I.Displace{base, disp}} = 
       [I.STORE{st=I.STW, b=base, d=I.IMMED disp, r=rs, mem=mem}]
    | move _ = error "move"

  fun fmove{src=I.FDirect fs, dst=I.FDirect fd} = [I.FUNARY{fu=I.FCPY, f=fs, t=fd}]
    | fmove{src=I.Displace{base, disp}, dst=I.FDirect ft} = let
        val tmp = I.C.newCell I.C.GP ()
	[I.LDO{i=I.IMMED disp, b=base, t=tmp},
	 I.FLOADX{flx=I.FLDDX, b=tmp, x=0, t=ft, mem=mem}]
    | fmove{src=I.FDirect fs, dst=I.Displace{base, disp}} = let
	val tmp = I.C.newCell I.C.GP ()
	[I.LDO{i=I.IMMED disp, b=base, t=tmp},
	 I.FSTOREX{fstx=I.FSTDX, b=tmp, x=0, r=fs, mem=mem}]
    | fmove _ = error "move"

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

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

 * $Log$

ViewVC Help
Powered by ViewVC 1.0.0