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 730, Fri Nov 10 14:04:49 2000 UTC revision 731, Fri Nov 10 22:57:45 2000 UTC
# Line 11  Line 11 
11          {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}],
12           ea=I.Direct}           ea=I.Direct}
13    
14      (*
15       * These assume that the ''registers'' are mapped onto the memory
16       *)
17    
18    (* Note, this only works with double precision floating point *)    (* Note, this only works with double precision floating point *)
19    val shufflefp' =    val shufflefpNormalAndSlow =
20      Shuffle.shuffle      Shuffle.shuffle
21          {mvInstr=fn{dst, src} => [I.FLDL src, I.FSTPL dst],          {mvInstr=fn{dst, src} => [I.FLDL src, I.FSTPL dst],
22           ea = I.FDirect}           ea = I.FDirect}
# Line 21  Line 25 
25     * This version makes use of the x86 floating point stack for hardware     * This version makes use of the x86 floating point stack for hardware
26     * renaming!     * renaming!
27     *)     *)
28    fun shufflefp{regmap, tmp, src, dst} =    fun shufflefpNormal{regmap, tmp, src, dst} =
29    let val n =  length src    let val n =  length src
30    in  if n <= 7 then    in  if n <= 7 then
31           let fun gen(s::ss, d::ds, pushes, pops) =           let fun gen(s::ss, d::ds, pushes, pops) =
# Line 32  Line 36 
36                   end                   end
37                 | gen(_, _, pushes, pops) = List.revAppend(pushes, pops)                 | gen(_, _, pushes, pops) = List.revAppend(pushes, pops)
38           in  gen(src, dst, [], []) end           in  gen(src, dst, [], []) end
39        else shufflefp'{regmap=regmap, tmp=tmp, src=src, dst=dst}        else shufflefpNormalAndSlow{regmap=regmap, tmp=tmp, src=src, dst=dst}
40    end    end
41    
42      (*
43       * These assume that the ''registers'' are mapped onto the pseudo
44       * %fpr register.  Only works with double precision floating point for
45       * now...
46       *)
47      val shufflefpFast =
48           Shuffle.shuffle
49             {mvInstr=fn{dst, src} => [I.FMOVE{fsize=I.FP64,src=src, dst=dst}],
50              ea = I.FPR}
51    
52      fun shufflefp(x as {tmp=SOME(I.FPR _), dst, src, regmap}) = shufflefpFast x
53        | shufflefp x = shufflefpNormal x
54    
55  end  end
56    

Legend:
Removed from v.730  
changed lines
  Added in v.731

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