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

SCM Repository

[smlnj] Diff of /sml/trunk/src/MLRISC/x86/instructions/x86Shuffle.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/x86/instructions/x86Shuffle.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1002, Fri Nov 30 17:11:33 2001 UTC revision 1003, Fri Dec 7 02:45:32 2001 UTC
# Line 89  Line 89 
89    exception foo    exception foo
90    val shuffle =    val shuffle =
91      Shuffle.shuffle      Shuffle.shuffle
92          {mvInstr=fn{dst, src} => [I.MOVE{mvOp=I.MOVL, src=src, dst=dst}],          {mvInstr=fn{dst, src} => [I.move{mvOp=I.MOVL, src=src, dst=dst}],
93           ea=I.Direct}           ea=I.Direct}
94    
95    (*    (*
# Line 99  Line 99 
99    (* Note, this only works with double precision floating point *)    (* Note, this only works with double precision floating point *)
100    val shufflefpNormalAndSlow =    val shufflefpNormalAndSlow =
101      Shuffle.shuffle      Shuffle.shuffle
102          {mvInstr=fn{dst, src} => [I.FLDL src, I.FSTPL dst],          {mvInstr=fn{dst, src} => [I.fldl src, I.fstpl dst],
103           ea = I.FDirect}           ea = I.FDirect}
104    
105    (*    (*
106     * This version makes use of the x86 floating point stack for hardware     * This version makes use of the x86 floating point stack for hardware
107     * renaming!     * renaming!
108     *)     *)
109    fun shufflefpNormal{tmp, src, dst} =    fun shufflefpNormal{tmp, src, dst} = let
110    let val n =  length src      val n =  length src
111    in  if n <= 7 then    in
112           let fun gen(s::ss, d::ds, pushes, pops) =      if n <= 7 then let
113            fun gen(s::ss, d::ds, pushes, pops) =
114                   if CB.sameColor(s,d) then gen(ss, ds, pushes, pops)                   if CB.sameColor(s,d) then gen(ss, ds, pushes, pops)
115                   else gen(ss, ds, I.FLDL(I.FDirect s)::pushes,              else
116                                        I.FSTPL(I.FDirect d)::pops)                gen(ss, ds,
117                        I.fldl(I.FDirect s)::pushes,
118                        I.fstpl(I.FDirect d)::pops)
119                 | gen(_, _, pushes, pops) = List.revAppend(pushes, pops)                 | gen(_, _, pushes, pops) = List.revAppend(pushes, pops)
120           in  gen(src, dst, [], []) end        in  gen(src, dst, [], [])
121          end
122        else shufflefpNormalAndSlow{tmp=tmp, src=src, dst=dst}        else shufflefpNormalAndSlow{tmp=tmp, src=src, dst=dst}
123    end    end
124    
# Line 125  Line 129 
129     *)     *)
130    val shufflefpFast =    val shufflefpFast =
131         Shuffle.shuffle         Shuffle.shuffle
132           {mvInstr=fn{dst, src} => [I.FMOVE{fsize=I.FP64,src=src, dst=dst}],           {mvInstr=fn{dst, src} => [I.fmove{fsize=I.FP64,src=src, dst=dst}],
133            ea = I.FPR}            ea = I.FPR}
134    
135    fun shufflefp(x as {tmp=SOME(I.FPR _), ...}) = shufflefpFast x    fun shufflefp(x as {tmp=SOME(I.FPR _), ...}) = shufflefpFast x

Legend:
Removed from v.1002  
changed lines
  Added in v.1003

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