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/hppa/hppa.mdl
ViewVC logotype

Diff of /sml/trunk/src/MLRISC/hppa/hppa.mdl

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

revision 775, Fri Jan 12 01:17:51 2001 UTC revision 1156, Thu Mar 21 22:01:11 2002 UTC
# Line 70  Line 70 
70        fun %% l = (l : #32 bits)        fun %% l = (l : #32 bits)
71    
72        rtl NOP{} = ()        rtl NOP{} = ()
       (* rtl COPY{dst,src} = $r[forall dst] := $r[forall src]  
       rtl FCOPY{dst,src} = $f[forall dst] := $f[forall src] *)  
73    
74        (* Integer loads *)        (* Integer loads *)
75        (* On the HP, addressing modes can be scaled and/or autoincrement *)        (* On the HP, addressing modes can be scaled and/or autoincrement *)
# Line 334  Line 332 
332        fun FBRANCH cmp {f1,f2,t} =        fun FBRANCH cmp {f1,f2,t} =
333            if cmp($f[f1],$f[f2]) then Jmp(%%t) else ()            if cmp($f[f1],$f[f2]) then Jmp(%%t) else ()
334    
335          (*
336        rtl FBRANCH_ ^^        rtl FBRANCH_ ^^
337            [?, !<=>, ==, ?=, !<>, !?>=, <, ?<,            [?, !<=>, ==, ?=, !<>, !?>=, <, ?<,
338             !>=, !?>, <=, ?<=, !>, !?<=, >, ?>,             !>=, !?>, <=, ?<=, !>, !?<=, >, ?>,
# Line 344  Line 343 
343             |!>=|, |!?>|, |<=|, |?<=|, |!>|, |!?<=|, |>|, |?>|,             |!>=|, |!?>|, |<=|, |?<=|, |!>|, |!?<=|, |>|, |?>|,
344             |!<=|, |!?<|, |>=|, |?>=|, |!<|, |!?=|, |<>|, |!=|,             |!<=|, |!?<|, |>=|, |?>=|, |!<|, |!?=|, |<>|, |!=|,
345             |!?|, |<=>|, |?<>|]             |!?|, |<=>|, |?<>|]
346           *)
347          rtl FBRANCH_ ^^
348              [?, ==, ?=, <, ?<,
349               <=, ?<=, >, ?>,
350               >=, ?>=, <>,
351               <=>, ?<>] =
352              map FBRANCH
353              [|?|, |==|, |?=|, |<|, |?<|,
354               |<=|, |?<=|, |>|, |?>|,
355               |>=|, |?>=|, |<>|,
356               |<=>|, |?<>|]
357    
358     end (* RTL *)     end (* RTL *)
359    
# Line 544  Line 554 
554        datatype ea =        datatype ea =
555            Direct of $GP            Direct of $GP
556          | FDirect of $GP          | FDirect of $GP
557          | Displace of {base: $GP, disp:int}          | Displace of {base: $GP, disp: T.labexp, mem: Region.region}
558    
559        datatype operand =        datatype operand =
560            (* this is used only during instruction selection *)            (* this is used only during instruction selection *)
# Line 555  Line 565 
565          | LOLabExp of T.labexp * field_selector ``<labexp>''          | LOLabExp of T.labexp * field_selector ``<labexp>''
566    
567        datatype addressing_mode =        datatype addressing_mode =
568          DISPea of C.cell * operand    (* displacement *)          DISPea of CellsBasis.cell * operand               (* displacement *)
569        | INDXea of C.cell * C.cell       (* indexed *)        | INDXea of CellsBasis.cell * CellsBasis.cell       (* indexed *)
570        | INDXSCALEDea of C.cell * C.cell (* indexed with scaling (b,x) *)        | INDXSCALEDea of CellsBasis.cell * CellsBasis.cell (* indexed with scaling (b,x) *)
571    
572     end  (* Instruction *)     end  (* Instruction *)
573    
# Line 643  Line 653 
653      *========================================================================*)      *========================================================================*)
654     structure MC =     structure MC =
655     struct     struct
656        val zeroR = Option.valOf(C.zeroReg C.GP)        val zeroR = Option.valOf(C.zeroReg CellsBasis.GP)
657        fun opn opnd =        fun opn opnd =
658        let fun hi21 n  = (itow n) >> 0w11        let fun hi21 n  = (itow n) >> 0w11
659            fun hi21X n = (itow n) ~>> 0w11            fun hi21X n = (itow n) ~>> 0w11
660            fun lo11 n  = (itow n) && 0wx7ff            fun lo11 n  = (itow n) && 0wx7ff
661            (* BUG: should respect the field selectors instead of ignoring them *)            (* BUG: should respect the field selectors instead of ignoring them *)
662        in  case opnd of        in  case opnd of
663              I.HILabExp(lexp, _) => hi21X(LabelExp.valueOf lexp)              I.HILabExp(lexp, _) => hi21X(MLTreeEval.valueOf lexp)
664            | I.LOLabExp(lexp, _) => lo11(LabelExp.valueOf lexp)            | I.LOLabExp(lexp, _) => lo11(MLTreeEval.valueOf lexp)
665            | I.LabExp(lexp, _)   => itow(LabelExp.valueOf lexp)            | I.LabExp(lexp, _)   => itow(MLTreeEval.valueOf lexp)
666            | I.IMMED i           => itow i            | I.IMMED i           => itow i
667            | I.REG _             => error "REG"            | I.REG _             => error "REG"
668        end        end
# Line 969  Line 979 
979                   Label.setAddr(tmpLab, !loc+4);                   Label.setAddr(tmpLab, !loc+4);
980                   branchLink(0wx3a,tmp,tmpLab,0w0,n);                   branchLink(0wx3a,tmp,tmpLab,0w0,n);
981                   LongImmed{Op=0wxa,r=tmp,                   LongImmed{Op=0wxa,r=tmp,
982                             im21=assemble_21(itow(LabelExp.valueOf offset))};                             im21=assemble_21(itow(MLTreeEval.valueOf offset))};
983                   BranchVectored{Op=0wx3a,t=tmp,x=zeroR,ext3=0w6,n=n}                   BranchVectored{Op=0wx3a,t=tmp,x=zeroR,ext3=0w6,n=n}
984               end               end
985          rtl: ``B''          rtl: ``B''
# Line 1003  Line 1013 
1013          pipeline: BRANCH          pipeline: BRANCH
1014    
1015      | BL of {lab:Label.label ,t: $GP, defs: $cellset, uses: $cellset,      | BL of {lab:Label.label ,t: $GP, defs: $cellset, uses: $cellset,
1016               mem:Region.region, n:bool}               cutsTo: Label.label list, mem:Region.region, n:bool}
1017          asm: ``bl<n>\t<lab>, <t><mem><emit_defs(defs)><emit_uses(uses)>''          asm: ``bl<n>\t<lab>, <t><mem><emit_defs(defs)><emit_uses(uses)><emit_cutsTo cutsTo>''
1018          mc:  branchLink(0wx3a,t,lab,0w0,n)          mc:  branchLink(0wx3a,t,lab,0w0,n)
1019          nullified: n = true          nullified: n = true
1020          delayslot candidate: false          delayslot candidate: false
1021          pipeline: BRANCH          pipeline: BRANCH
1022    
1023      | BLE of {d:operand,b: $GP, sr:int, t: $GP,      | BLE of {d:operand,b: $GP, sr:int, t: $GP,
1024                defs: $cellset, uses: $cellset, mem:Region.region}                defs: $cellset, uses: $cellset, cutsTo: Label.label list,
1025                  mem:Region.region}
1026          asm: ``ble\t<d>(<emit_int sr>,<b>)<mem><          asm: ``ble\t<d>(<emit_int sr>,<b>)<mem><
1027                 emit_defs(defs)><emit_uses(uses)>''                 emit_defs(defs)><emit_uses(uses)><emit_cutsTo cutsTo>''
1028          mc:  (case (d,C.registerId t) of          mc:  (case (d,CellsBasis.registerId t) of
1029                 (I.IMMED 0,31) =>                 (I.IMMED 0,31) =>
1030                   BranchExternal{Op=0wx39,b=b,w1=0w0,s=assemble_3(itow sr),                   BranchExternal{Op=0wx39,b=b,w1=0w0,s=assemble_3(itow sr),
1031                                  w2=0w0,n=true,w=0w0}                                  w2=0w0,n=true,w=0w0}
# Line 1159  Line 1170 
1170          rtl: ``NOP''          rtl: ``NOP''
1171          pipeline: NOP          pipeline: NOP
1172    
     | COPY of {dst: $GP list, src: $GP list,  
                impl:instruction list option ref, tmp: ea option}  
         asm: emitInstrs (Shuffle.shuffle{tmp,src,dst})  
         rtl: ``COPY''  
         pipeline: ARITH  
   
     | FCOPY of {dst: $FP list, src: $FP list,  
                 impl:instruction list option ref, tmp: ea option}  
         asm: emitInstrs (Shuffle.shufflefp{tmp,src,dst})  
         rtl: ``FCOPY''  
         pipeline: ARITH  
   
     | ANNOTATION of {i:instruction, a:Annotations.annotation}  
         asm: (comment(Annotations.toString a); nl(); emitInstr i)  
         mc:  emitInstr i  
         (* rtl: [[ #i ]] *)  
   
1173      | SOURCE of {}      | SOURCE of {}
1174          asm: ``source''          asm: ``source''
1175          mc:  ()          mc:  ()

Legend:
Removed from v.775  
changed lines
  Added in v.1156

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