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/ppc/backpatch/ppcJumps.sml
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/ppc/backpatch/ppcJumps.sml

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

revision 983, Wed Nov 21 18:44:55 2001 UTC revision 984, Wed Nov 21 19:00:08 2001 UTC
# Line 1  Line 1 
1  functor PPCJumps  functor PPCJumps
2    (structure Instr: PPCINSTR    (structure Instr: PPCINSTR
3     structure Shuffle : PPCSHUFFLE where I = Instr     structure Shuffle : PPCSHUFFLE where I = Instr
4       structure MLTreeEval : MLTREE_EVAL where T = Instr.T
5    ) : SDI_JUMPS =    ) : SDI_JUMPS =
6  struct  struct
7    structure I = Instr    structure I = Instr
8    structure C = I.C    structure C = I.C
9    structure Const = I.Constant    structure Const = I.Constant
   structure LE = I.LabelExp  
10    
11    fun error msg = MLRiscErrorMsg.error("PPCJumps",msg)    fun error msg = MLRiscErrorMsg.error("PPCJumps",msg)
12    
# Line 50  Line 50 
50      fun unsigned5 n = 0 <=n andalso n < 32      fun unsigned5 n = 0 <=n andalso n < 32
51    
52      fun operand(I.LabelOp le, inRange, lo, hi) =      fun operand(I.LabelOp le, inRange, lo, hi) =
53           if inRange(LE.valueOf le) then lo else hi           if inRange(MLTreeEval.valueOf le) then lo else hi
54        | operand _ = error "sdiSize:operand"        | operand _ = error "sdiSize:operand"
55    in    in
56      case instr      case instr
# Line 78  Line 78 
78           | I.CMPL => operand(rb, unsigned16, 4, 12)           | I.CMPL => operand(rb, unsigned16, 4, 12)
79         (*esac*))         (*esac*))
80       | I.BC{addr=I.LabelOp lexp, ...} =>       | I.BC{addr=I.LabelOp lexp, ...} =>
81          if signed14((LE.valueOf lexp - loc) div 4) then 4 else 8          if signed14((MLTreeEval.valueOf lexp - loc) div 4) then 4 else 8
82       | I.COPY{impl=ref(SOME l), ...} => 4 * length l       | I.COPY{impl=ref(SOME l), ...} => 4 * length l
83       | I.FCOPY{impl=ref(SOME l), ...} => 4 * length l       | I.FCOPY{impl=ref(SOME l), ...} => 4 * length l
84       | I.COPY{dst, src, impl as ref NONE, tmp} => let       | I.COPY{dst, src, impl as ref NONE, tmp} => let
# Line 94  Line 94 
94    end    end
95    
96    
97    fun valueOf(I.LabelOp lexp) = LE.valueOf lexp    fun valueOf(I.LabelOp lexp) = MLTreeEval.valueOf lexp
98      | valueOf _ = error "valueOf"      | valueOf _ = error "valueOf"
99    
100    fun split opnd = let    fun split opnd = let

Legend:
Removed from v.983  
changed lines
  Added in v.984

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