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.sml
ViewVC logotype

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

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

revision 1008, Fri Dec 14 21:01:29 2001 UTC revision 1009, Wed Jan 9 19:44:22 2002 UTC
# Line 167  Line 167 
167          | fsize _  = error "fsize"          | fsize _  = error "fsize"
168    
169        (* mark an expression with a list of annotations *)        (* mark an expression with a list of annotations *)
170        fun mark'(i,[]) = i        fun mark'(i,[]) = emitInstruction(i)
171          | mark'(i,a::an) = mark'(I.ANNOTATION{i=i,a=a},an)          | mark'(i,a::an) = mark'(I.ANNOTATION{i=i,a=a},an)
172    
173        (* annotate an expression and emit it *)        (* annotate an expression and emit it *)
174        fun mark(i,an) = emitInstruction(mark'(I.INSTR i,an))        fun mark(i,an) = mark'(I.INSTR i,an)
175    
176        val emits = app emitInstruction        val emits = app emitInstruction
177    
# Line 189  Line 189 
189                    end                    end
190                  | mvInstr{dst=I.Direct rd, src=I.Direct rs} =                  | mvInstr{dst=I.Direct rd, src=I.Direct rs} =
191                      if CB.sameColor(rd,rs) then []                      if CB.sameColor(rd,rs) then []
192                      else [I.copy{dst=[rd], src=[rs], tmp=NONE}]                      else [I.COPY{k=CB.GP, sz=32, dst=[rd], src=[rs], tmp=NONE}]
193                  | mvInstr{dst, src} = [I.move{mvOp=I.MOVL, src=src, dst=dst}]                  | mvInstr{dst, src} = [I.move{mvOp=I.MOVL, src=src, dst=dst}]
194            in            in
195               emits (Shuffle.shuffle{mvInstr=mvInstr, ea=IntReg}               emits (Shuffle.shuffle{mvInstr=mvInstr, ea=IntReg}
# Line 251  Line 251 
251         *)         *)
252        fun fcopy'(fty, [], [], _) = ()        fun fcopy'(fty, [], [], _) = ()
253          | fcopy'(fty, dst as [_], src as [_], an) =          | fcopy'(fty, dst as [_], src as [_], an) =
254              mark(I.FCOPY{dst=dst,src=src,tmp=NONE}, an)              mark'(I.COPY{k=CB.FP, sz=fty, dst=dst,src=src,tmp=NONE}, an)
255          | fcopy'(fty, dst, src, an) =          | fcopy'(fty, dst, src, an) =
256              mark(I.FCOPY{dst=dst,src=src,tmp=SOME(I.FDirect(newFreg()))}, an)              mark'(I.COPY{k=CB.FP, sz=fty, dst=dst,src=src,tmp=SOME(I.FDirect(newFreg()))}, an)
257    
258        (* emit parallel copies for floating point.        (* emit parallel copies for floating point.
259         * Fast version.         * Fast version.
# Line 274  Line 274 
274                   dst=dst, src=src})                   dst=dst, src=src})
275            end            end
276            else            else
277              mark(I.FCOPY{dst=dst,src=src,tmp=              mark'(I.COPY{k=CB.FP, sz=fty, dst=dst,
278                            src=src,tmp=
279                           case dst of                           case dst of
280                             [_] => NONE                             [_] => NONE
281                           | _   => SOME(I.FPR(newFreg()))}, an)                           | _   => SOME(I.FPR(newFreg()))}, an)
# Line 294  Line 295 
295        (* Move and annotate *)        (* Move and annotate *)
296        fun move'(src as I.Direct s, dst as I.Direct d, an) =        fun move'(src as I.Direct s, dst as I.Direct d, an) =
297            if CB.sameColor(s,d) then ()            if CB.sameColor(s,d) then ()
298            else mark(I.COPY{dst=[d], src=[s], tmp=NONE}, an)            else mark'(I.COPY{k=CB.GP, sz=32, dst=[d], src=[s], tmp=NONE}, an)
299          | move'(I.Immed 0, dst as I.Direct d, an) =          | move'(I.Immed 0, dst as I.Direct d, an) =
300              mark(I.BINARY{binOp=I.XORL, src=dst, dst=dst}, an)              mark(I.BINARY{binOp=I.XORL, src=dst, dst=dst}, an)
301          | move'(src, dst, an) = mark(I.MOVE{mvOp=I.MOVL, src=src, dst=dst}, an)          | move'(src, dst, an) = mark(I.MOVE{mvOp=I.MOVL, src=src, dst=dst}, an)
# Line 1258  Line 1259 
1259            (* generate floating point expression and put the result in fd *)            (* generate floating point expression and put the result in fd *)
1260        and doFexpr'(fty, T.FREG(_, fs), fd, an) =        and doFexpr'(fty, T.FREG(_, fs), fd, an) =
1261              (if CB.sameColor(fs,fd) then ()              (if CB.sameColor(fs,fd) then ()
1262               else mark(I.FCOPY{dst=[fd], src=[fs], tmp=NONE}, an)               else mark'(I.COPY{k=CB.FP, sz=64, dst=[fd], src=[fs], tmp=NONE}, an)
1263              )              )
1264          | doFexpr'(_, T.FLOAD(fty, ea, mem), fd, an) =          | doFexpr'(_, T.FLOAD(fty, ea, mem), fd, an) =
1265              fload'(fty, ea, mem, fd, an)              fload'(fty, ea, mem, fd, an)
# Line 1764  Line 1765 
1765                      operand       = operand,                      operand       = operand,
1766                      reduceOperand = reduceOpnd,                      reduceOperand = reduceOpnd,
1767                      addressOf     = fn e => address(e, I.Region.memory), (*XXX*)                      addressOf     = fn e => address(e, I.Region.memory), (*XXX*)
1768                      emit          = emitInstruction o mark',                      emit          = mark',
1769                      instrStream   = instrStream,                      instrStream   = instrStream,
1770                      mltreeStream  = self()                      mltreeStream  = self()
1771                     }                     }

Legend:
Removed from v.1008  
changed lines
  Added in v.1009

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