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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/hppa/hppaShuffle.sml
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 17 - (view) (download)
Original Path: sml/branches/SMLNJ/src/MLRISC/hppa/hppaShuffle.sml

1 : monnier 16 functor HppaShuffle(I:HPPAINSTR) = struct
2 :     structure I = I
3 :     structure Shuffle = Shuffle(I)
4 :     type t = {regMap:int->int, temp:I.ea option, dst:int list, src:int list}
5 :    
6 :     fun error msg = MLRiscErrorMsg.impossible ("HppaShuffle." ^ msg)
7 :     val mem = I.Region.memory
8 :    
9 :     fun move{src=I.Direct rs, dst=I.Direct rt} = [I.ARITH{a=I.OR, r1=rs, r2=0, t=rt}]
10 :     | move{src=I.Displace{base, disp}, dst=I.Direct rt} =
11 :     [I.LOADI{li=I.LDW, r=base, i=I.IMMED disp, t=rt, mem=mem}]
12 :     | move{src=I.Direct rs, dst=I.Displace{base, disp}} =
13 :     [I.STORE{st=I.STW, b=base, d=I.IMMED disp, r=rs, mem=mem}]
14 :     | move _ = error "move"
15 :    
16 :     fun fmove{src=I.FDirect fs, dst=I.FDirect fd} = [I.FUNARY{fu=I.FCPY, f=fs, t=fd}]
17 :     | fmove{src=I.Displace{base, disp}, dst=I.FDirect ft} = let
18 :     val tmp = I.C.newReg()
19 :     in
20 :     [I.LDO{i=I.IMMED disp, b=base, t=tmp},
21 :     I.FLOADX{flx=I.FLDDX, b=tmp, x=0, t=ft, mem=mem}]
22 :     end
23 :     | fmove{src=I.FDirect fs, dst=I.Displace{base, disp}} = let
24 :     val tmp = I.C.newReg()
25 :     in
26 :     [I.LDO{i=I.IMMED disp, b=base, t=tmp},
27 :     I.FSTOREX{fstx=I.FSTDX, b=tmp, x=0, r=fs, mem=mem}]
28 :     end
29 :     | fmove _ = error "move"
30 :    
31 :     val shuffle = Shuffle.shuffle{mvInstr = move, ea=I.Direct}
32 :    
33 :     val shufflefp = Shuffle.shuffle {mvInstr=fmove, ea=I.FDirect}
34 :     end
35 :    
36 :    
37 :     (*
38 :     * $Log: hppaShuffle.sml,v $
39 :     * Revision 1.1 1998/02/16 14:00:42 george
40 :     * Version 110.2
41 :     *
42 :     *)

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