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

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

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

revision 582, Thu Mar 23 01:04:32 2000 UTC revision 583, Thu Mar 23 21:52:30 2000 UTC
# Line 137  Line 137 
137        | eImmedExt(_, I.Relative _) = error "eImmedExt: Relative"        | eImmedExt(_, I.Relative _) = error "eImmedExt: Relative"
138        | eImmedExt(_, I.LabelEA _) = error "eImmedExt: LabelEA"        | eImmedExt(_, I.LabelEA _) = error "eImmedExt: LabelEA"
139    
140        fun condCode cond =
141            (case cond
142              of I.EQ => 0w4      | I.NE => 0w5
143               | I.LT => 0w12     | I.LE => 0w14
144               | I.GT => 0w15     | I.GE => 0w13
145               | I.A  => 0w7      | I.AE => 0w3
146               | I.B  => 0w2      | I.BE => 0w6
147               | I.C  => 0w2      | I.NC => 0w3
148               | I.P  => 0wxa     | I.NP => 0wxb
149               | I.O  => 0w0      | I.NO => 0w1
150            (*esac*))
151    
152      (* arith: only 5 cases need be considered:      (* arith: only 5 cases need be considered:
153       *  dst,   src       *  dst,   src
154       *  -----------       *  -----------
# Line 228  Line 240 
240          (*esac*)          (*esac*)
241         end         end
242         ) handle e => (print "JMP\n"; raise e))         ) handle e => (print "JMP\n"; raise e))
243       | I.JCC{cond, opnd=I.Relative i} => let       | I.JCC{cond, opnd=I.Relative i} =>
244           val code =         let val code = condCode cond
245             (case cond         in  case size (Int32.fromInt(i-2))
             of I.EQ => 0w4      | I.NE => 0w5  
              | I.LT => 0w12     | I.LE => 0w14  
              | I.GT => 0w15     | I.GE => 0w13  
              | I.A  => 0w7      | I.AE => 0w3  
              | I.B  => 0w2      | I.BE => 0w6  
              | I.C  => 0w2      | I.NC => 0w3  
              | I.P  => 0wxa     | I.NP => 0wxb  
              | I.O  => 0w0      | I.NO => 0w1  
             (*esac*))  
        in  
          case size (Int32.fromInt(i-2))  
246           of Bits32 =>           of Bits32 =>
247               eBytes(0wx0f :: Word8.+(0wx80,code) :: eLong(Int32.fromInt(i-6)))               eBytes(0wx0f :: Word8.+(0wx80,code) :: eLong(Int32.fromInt(i-6)))
248            | _ =>            | _ =>
# Line 352  Line 353 
353           | I.NEGL => eBytes(0wxf7 :: eImmedExt(3, opnd))           | I.NEGL => eBytes(0wxf7 :: eImmedExt(3, opnd))
354           | I.NOTL => eBytes(0wxf7 :: eImmedExt(2, opnd))           | I.NOTL => eBytes(0wxf7 :: eImmedExt(2, opnd))
355          (*esac*))          (*esac*))
356       | I.SET _ => error "SETcc"       | I.SET{cond,opnd} =>
357       | I.CMOV _ => error "CMOVcc"           eBytes(0wx0f :: Word8.+(0wx90,condCode cond) :: eImmedExt(0, opnd))
358       | I.PUSHL(I.Immed(i)) =>       | I.PUSHL(I.Immed(i)) =>
359         (case size i         (case size i
360          of Bits32 => eBytes(0wx68 :: eLong(i))          of Bits32 => eBytes(0wx68 :: eLong(i))

Legend:
Removed from v.582  
changed lines
  Added in v.583

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