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/mips/instructions/mipsShuffle.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/mips/instructions/mipsShuffle.sml

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1326 - (download) (annotate)
Wed May 14 21:20:29 2003 UTC (17 years, 3 months ago) by allenleung
File size: 1035 byte(s)
    Completely non-functional MIPS backend.
functor MIPSShuffle(I:MIPSINSTR) : MIPSSHUFFLE = struct
  structure I = I
  structure Shuffle = Shuffle(I)

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

  val mem=I.Region.memory

  val zeroR = I.Reg I.C.r0 

  fun move{src=I.Direct rs, dst=I.Direct rt} = 
        [I.ARITH{oper=I.ADDU, rs=rs, i=zeroR, rt=rt}]
    | move{src=I.Direct rs, dst=I.Displace{base, disp}} = 
	[I.STORE{s=I.SW, rs=rs, b=base, d=I.Imm disp, mem=mem}]
    | move{src=I.Displace{base, disp}, dst=I.Direct rt} = 
	[I.LOAD{l=I.LW, rt=rt, b=base, d=I.Imm disp, mem=mem}]

  fun fmove{src=I.FDirect fs, dst=I.FDirect ft} =
        [I.FUNARY{oper=I.MOV_D, fs=fs, ft=ft}] 
    | fmove{src=I.FDirect fs, dst=I.Displace{base, disp}} = 
	[I.FSTORE{s=I.SDC1, fs=fs, b=base, d=I.Imm disp, mem=mem}]
    | fmove{src=I.Displace{base, disp}, dst=I.FDirect ft} =
	[I.FLOAD{l=I.LDC1, ft=ft, b=base, d=I.Imm disp, mem=mem}]

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

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

ViewVC Help
Powered by ViewVC 1.0.0