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/mltree/x86-fp.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/x86/mltree/x86-fp.sml

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

revision 1024, Thu Jan 17 19:30:59 2002 UTC revision 1025, Thu Jan 17 20:31:51 2002 UTC
# Line 56  Line 56 
56   *)   *)
57    
58  local  local
59     val debug = true         (* set this to true to debug this module     val debug = false         (* set this to true to debug this module
60                                * set this to false for production use.                                * set this to false for production use.
61                                *)                                *)
62     val debugLiveness = true (* debug liveness analysis *)     val debugLiveness = true (* debug liveness analysis *)
# Line 1336  Line 1336 
1336             let (* Call this continuation when done with code generation *)             let (* Call this continuation when done with code generation *)
1337                 fun FINISH code = loop(stamp+1, rest, lastUses, code)                 fun FINISH code = loop(stamp+1, rest, lastUses, code)
1338    
1339                 (* Call this continuation when done with floating point                 fun KILL_THE_DEAD(dead, code) =
                 * code generation.  Remove all dead code first.  
                 *)  
                fun DONE code =  
1340                 let fun kill([], code) = FINISH code                 let fun kill([], code) = FINISH code
1341                       | kill(f::fs, code) =                       | kill(f::fs, code) =
1342                         let val fx = CB.registerNum f                         let val fx = CB.registerNum f
# Line 1367  Line 1364 
1364                 in  kill(dead, code)                 in  kill(dead, code)
1365                 end                 end
1366    
1367                   (* Call this continuation when done with floating point
1368                    * code generation.  Remove all dead code first.
1369                    *)
1370                   fun DONE code = KILL_THE_DEAD(dead, code)
1371    
1372                 (* Is this the last use of register f? *)                 (* Is this the last use of register f? *)
1373                 fun isLastUse f = A.sub(lastUseTbl, f) = stamp                 fun isLastUse f = A.sub(lastUseTbl, f) = stamp
1374    
# Line 1798  Line 1800 
1800                     | [r] => ST.push(stack, CB.registerNum r)                     | [r] => ST.push(stack, CB.registerNum r)
1801                     | _   =>                     | _   =>
1802                       error "can't return more than one fp argument (yet)";                       error "can't return more than one fp argument (yet)";
1803                     FINISH code                   KILL_THE_DEAD(List.filter isDead returnSet, code)
1804                 end                 end
1805                 fun x86trans instr =                 fun x86trans instr =
1806                  (case instr                  (case instr
# Line 1871  Line 1873 
1873                   | scan(I.INSTR(I.FILD mem)) = push()                   | scan(I.INSTR(I.FILD mem)) = push()
1874                   | scan(I.INSTR(I.FILDL mem)) = push()                   | scan(I.INSTR(I.FILDL mem)) = push()
1875                   | scan(I.INSTR(I.FILDLL mem)) = push()                   | scan(I.INSTR(I.FILDLL mem)) = push()
1876                     | scan(I.INSTR(I.CALL{return, ...})) =
1877                       (n := 0; (* clear the stack *)
1878                        (* Simulate the pushing of arguments *)
1879                        let val returnSet = SL.return(SL.uniq(getCell return))
1880                        in  app (fn _ => push()) returnSet
1881                        end
1882                       )
1883                   | scan _ = ()                   | scan _ = ()
1884                 val _ = app scan (rev insns);                 val _ = app scan (rev insns);
1885                 val n = !n                 val n = !n

Legend:
Removed from v.1024  
changed lines
  Added in v.1025

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