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

Diff of /sml/trunk/src/MLRISC/hppa/emit/hppaMC.sml

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

revision 1202, Sat May 18 01:05:18 2002 UTC revision 1203, Sat May 18 18:21:53 2002 UTC
# Line 396  Line 396 
396     and FloatMultiOp {rm1, rm2, ta, ra, f, tm} = eWord32 ((rm1 << 0wx15) + ((rm2 << 0wx10) + ((ta << 0wxb) + ((ra << 0wx6) + ((f << 0wx5) + (tm + 0wx38000000))))))     and FloatMultiOp {rm1, rm2, ta, ra, f, tm} = eWord32 ((rm1 << 0wx15) + ((rm2 << 0wx10) + ((ta << 0wxb) + ((ra << 0wx6) + ((f << 0wx5) + (tm + 0wx38000000))))))
397     and FTest {} = eWord32 0wx30002420     and FTest {} = eWord32 0wx30002420
398    
399  (*#line 644.7 "hppa/hppa.mdl"*)  (*#line 656.7 "hppa/hppa.mdl"*)
400     val zeroR = Option.valOf (C.zeroReg CellsBasis.GP)     val zeroR = Option.valOf (C.zeroReg CellsBasis.GP)
401    
402  (*#line 645.7 "hppa/hppa.mdl"*)  (*#line 657.7 "hppa/hppa.mdl"*)
403     fun opn opnd =     fun opn opnd =
404         let         let
405  (*#line 646.11 "hppa/hppa.mdl"*)  (*#line 658.11 "hppa/hppa.mdl"*)
406             fun hi21 n = (itow n) >> 0wxb             fun hi21 n = (itow n) >> 0wxb
407    
408  (*#line 647.11 "hppa/hppa.mdl"*)  (*#line 659.11 "hppa/hppa.mdl"*)
409             fun hi21X n = (itow n) ~>> 0wxb             fun hi21X n = (itow n) ~>> 0wxb
410    
411  (*#line 648.11 "hppa/hppa.mdl"*)  (*#line 660.11 "hppa/hppa.mdl"*)
412             fun lo11 n = (itow n) && 0wx7ff             fun lo11 n = (itow n) && 0wx7ff
413         in         in
414            (case opnd of            (case opnd of
# Line 420  Line 420 
420            )            )
421         end         end
422    
423  (*#line 659.6 "hppa/hppa.mdl"*)  (*#line 671.6 "hppa/hppa.mdl"*)
424     fun disp lab = (itow (((Label.addrOf lab) - ( ! loc)) - 8)) ~>> 0wx2     fun disp lab = (itow (((Label.addrOf lab) - ( ! loc)) - 8)) ~>> 0wx2
425    
426  (*#line 660.6 "hppa/hppa.mdl"*)  (*#line 672.6 "hppa/hppa.mdl"*)
427     fun low_sign_ext_im14 n = ((n && 0wx1fff) << 0wx1) || ((n && 0wx2000) >> 0wxd)     fun low_sign_ext_im14 n = ((n && 0wx1fff) << 0wx1) || ((n && 0wx2000) >> 0wxd)
428    
429  (*#line 661.6 "hppa/hppa.mdl"*)  (*#line 673.6 "hppa/hppa.mdl"*)
430     fun low_sign_ext_im11 n = ((n && 0wx3ff) << 0wx1) || ((n && 0wx400) >> 0wxa)     fun low_sign_ext_im11 n = ((n && 0wx3ff) << 0wx1) || ((n && 0wx400) >> 0wxa)
431    
432  (*#line 662.6 "hppa/hppa.mdl"*)  (*#line 674.6 "hppa/hppa.mdl"*)
433     fun low_sign_ext_im5 n = ((n && 0wxf) << 0wx1) || ((n && 0wx10) >> 0wx4)     fun low_sign_ext_im5 n = ((n && 0wxf) << 0wx1) || ((n && 0wx10) >> 0wx4)
434    
435  (*#line 664.6 "hppa/hppa.mdl"*)  (*#line 676.6 "hppa/hppa.mdl"*)
436     fun assemble_3 n =     fun assemble_3 n =
437         let         let
438  (*#line 665.10 "hppa/hppa.mdl"*)  (*#line 677.10 "hppa/hppa.mdl"*)
439             val w1 = (n && 0wx4) >> 0wx2             val w1 = (n && 0wx4) >> 0wx2
440    
441  (*#line 666.10 "hppa/hppa.mdl"*)  (*#line 678.10 "hppa/hppa.mdl"*)
442             val w2 = (n && 0wx3) << 0wx1             val w2 = (n && 0wx3) << 0wx1
443         in w1 || w2         in w1 || w2
444         end         end
445    
446  (*#line 669.6 "hppa/hppa.mdl"*)  (*#line 681.6 "hppa/hppa.mdl"*)
447     fun assemble_12 n =     fun assemble_12 n =
448         let         let
449  (*#line 670.10 "hppa/hppa.mdl"*)  (*#line 682.10 "hppa/hppa.mdl"*)
450             val w = (n && 0wx800) >> 0wxb             val w = (n && 0wx800) >> 0wxb
451    
452  (*#line 671.10 "hppa/hppa.mdl"*)  (*#line 683.10 "hppa/hppa.mdl"*)
453             val w1 = ((n && 0wx3ff) << 0wx1) || ((n && 0wx400) >> 0wxa)             val w1 = ((n && 0wx3ff) << 0wx1) || ((n && 0wx400) >> 0wxa)
454         in (w1, w)         in (w1, w)
455         end         end
456    
457  (*#line 674.6 "hppa/hppa.mdl"*)  (*#line 686.6 "hppa/hppa.mdl"*)
458     fun assemble_17 n =     fun assemble_17 n =
459         let         let
460  (*#line 675.10 "hppa/hppa.mdl"*)  (*#line 687.10 "hppa/hppa.mdl"*)
461             val w = (n && 0wx10000) >> 0wx10             val w = (n && 0wx10000) >> 0wx10
462    
463  (*#line 676.10 "hppa/hppa.mdl"*)  (*#line 688.10 "hppa/hppa.mdl"*)
464             val w1 = (n && 0wxf800) >> 0wxb             val w1 = (n && 0wxf800) >> 0wxb
465    
466  (*#line 677.10 "hppa/hppa.mdl"*)  (*#line 689.10 "hppa/hppa.mdl"*)
467             val w2 = ((n && 0wx3ff) << 0wx1) || ((n && 0wx400) >> 0wxa)             val w2 = ((n && 0wx3ff) << 0wx1) || ((n && 0wx400) >> 0wxa)
468         in (w, w1, w2)         in (w, w1, w2)
469         end         end
470    
471  (*#line 680.6 "hppa/hppa.mdl"*)  (*#line 692.6 "hppa/hppa.mdl"*)
472     fun assemble_21 disp =     fun assemble_21 disp =
473         let         let
474  (*#line 681.10 "hppa/hppa.mdl"*)  (*#line 693.10 "hppa/hppa.mdl"*)
475             val w = (((((disp && 0wx3) << 0wxc) || ((disp && 0wx7c) << 0wxe)) || ((disp && 0wx180) << 0wx7)) || ((disp && 0wxffe00) >> 0wx8)) || ((disp && 0wx100000) >> 0wx14)             val w = (((((disp && 0wx3) << 0wxc) || ((disp && 0wx7c) << 0wxe)) || ((disp && 0wx180) << 0wx7)) || ((disp && 0wxffe00) >> 0wx8)) || ((disp && 0wx100000) >> 0wx14)
476         in w         in w
477         end         end
478    
479  (*#line 689.6 "hppa/hppa.mdl"*)  (*#line 701.6 "hppa/hppa.mdl"*)
480     fun branchLink (Op, t, lab, ext3, n) =     fun branchLink (Op, t, lab, ext3, n) =
481         let         let
482  (*#line 690.10 "hppa/hppa.mdl"*)  (*#line 702.10 "hppa/hppa.mdl"*)
483             val (w, w1, w2) = assemble_17 (disp lab)             val (w, w1, w2) = assemble_17 (disp lab)
484         in BranchAndLink {Op=Op, t=t, w1=w1, w2=w2, w=w, ext3=ext3, n=n}         in BranchAndLink {Op=Op, t=t, w1=w1, w2=w2, w=w, ext3=ext3, n=n}
485         end         end
486    
487  (*#line 693.6 "hppa/hppa.mdl"*)  (*#line 705.6 "hppa/hppa.mdl"*)
488     fun bcond (cmp, bc, r1, r2, n, t, nop) =     fun bcond (cmp, bc, r1, r2, n, t, nop) =
489         let         let
490  (*#line 694.10 "hppa/hppa.mdl"*)  (*#line 706.10 "hppa/hppa.mdl"*)
491             val (w1, w) = assemble_12 (disp t)             val (w1, w) = assemble_12 (disp t)
492         in ConditionalBranch {Op=emit_cmp cmp, c=bc, r1=r1, r2=r2, n=n, w=w,         in ConditionalBranch {Op=emit_cmp cmp, c=bc, r1=r1, r2=r2, n=n, w=w,
493               w1=w1};               w1=w1};
494            Nop {nop=nop}            Nop {nop=nop}
495         end         end
496    
497  (*#line 697.6 "hppa/hppa.mdl"*)  (*#line 709.6 "hppa/hppa.mdl"*)
498     fun bcondi (cmpi, bc, i, r2, n, t, nop) =     fun bcondi (cmpi, bc, i, r2, n, t, nop) =
499         let         let
500  (*#line 698.10 "hppa/hppa.mdl"*)  (*#line 710.10 "hppa/hppa.mdl"*)
501             val (w1, w) = assemble_12 (disp t)             val (w1, w) = assemble_12 (disp t)
502         in ConditionalBranchi {Op=emit_cmpi cmpi, c=bc, im5=low_sign_ext_im5 (itow i),         in ConditionalBranchi {Op=emit_cmpi cmpi, c=bc, im5=low_sign_ext_im5 (itow i),
503               r2=r2, n=n, w=w, w1=w1};               r2=r2, n=n, w=w, w1=w1};
504            Nop {nop=nop}            Nop {nop=nop}
505         end         end
506    
507  (*#line 702.6 "hppa/hppa.mdl"*)  (*#line 714.6 "hppa/hppa.mdl"*)
508     fun branchOnBit (bc, r, p, n, t, nop) =     fun branchOnBit (bc, r, p, n, t, nop) =
509         let         let
510  (*#line 703.10 "hppa/hppa.mdl"*)  (*#line 715.10 "hppa/hppa.mdl"*)
511             val (w1, w) = assemble_12 (disp t)             val (w1, w) = assemble_12 (disp t)
512         in BranchOnBit {p=p, r=r, c=emit_bitcond bc, w1=w1, n=n, w=w};         in BranchOnBit {p=p, r=r, c=emit_bitcond bc, w1=w1, n=n, w=w};
513            Nop {nop=nop}            Nop {nop=nop}
514         end         end
515    
516  (*#line 707.6 "hppa/hppa.mdl"*)  (*#line 719.6 "hppa/hppa.mdl"*)
517     fun cmpCond cond =     fun cmpCond cond =
518         (case cond of         (case cond of
519           I.EQ => (0wx1, 0wx0)           I.EQ => (0wx1, 0wx0)
# Line 533  Line 533 
533            im14=low_sign_ext_im14 (opn i), t=t}            im14=low_sign_ext_im14 (opn i), t=t}
534       | emitInstr (I.LOAD{l, r1, r2, t, mem}) =       | emitInstr (I.LOAD{l, r1, r2, t, mem}) =
535         let         let
536  (*#line 807.18 "hppa/hppa.mdl"*)  (*#line 819.18 "hppa/hppa.mdl"*)
537             val (ext4, u, m) = emit_load l             val (ext4, u, m) = emit_load l
538         in IndexedLoad {Op=0wx3, b=r1, x=r2, ext4=ext4, u=u, t=t, m=m}         in IndexedLoad {Op=0wx3, b=r1, x=r2, ext4=ext4, u=u, t=t, m=m}
539         end         end
# Line 545  Line 545 
545           I.ADDIL => LongImmed {Op=0wxa, r=r, im21=assemble_21 (opn i)}           I.ADDIL => LongImmed {Op=0wxa, r=r, im21=assemble_21 (opn i)}
546         | _ =>         | _ =>
547           let           let
548  (*#line 831.26 "hppa/hppa.mdl"*)  (*#line 843.26 "hppa/hppa.mdl"*)
549               val (Op, e) = emit_arithi ai               val (Op, e) = emit_arithi ai
550           in Arithi {Op=Op, r=r, t=t, im11=low_sign_ext_im11 (opn i), e=e}           in Arithi {Op=Op, r=r, t=t, im11=low_sign_ext_im11 (opn i), e=e}
551           end           end
552         )         )
553       | emitInstr (I.COMCLR_LDO{cc, r1, r2, t1, i, b, t2}) =       | emitInstr (I.COMCLR_LDO{cc, r1, r2, t1, i, b, t2}) =
554         let         let
555  (*#line 850.17 "hppa/hppa.mdl"*)  (*#line 862.17 "hppa/hppa.mdl"*)
556             val (c, f) = cmpCond cc             val (c, f) = cmpCond cc
557         in CompareClear {r1=r1, r2=r2, t=t1, c=c, f=f, ext=0wx22};         in CompareClear {r1=r1, r2=r2, t=t1, c=c, f=f, ext=0wx22};
558            Load {Op=0wxd, b=b, im14=low_sign_ext_im14 (itow i), t=t2}            Load {Op=0wxd, b=b, im14=low_sign_ext_im14 (itow i), t=t2}
559         end         end
560       | emitInstr (I.COMICLR_LDO{cc, i1, r2, t1, i2, b, t2}) =       | emitInstr (I.COMICLR_LDO{cc, i1, r2, t1, i2, b, t2}) =
561         let         let
562  (*#line 865.17 "hppa/hppa.mdl"*)  (*#line 877.17 "hppa/hppa.mdl"*)
563             val (c, f) = cmpCond cc             val (c, f) = cmpCond cc
564         in CompareImmClear {r=r2, t=t1, c=c, f=f, im11=low_sign_ext_im11 (opn i1)};         in CompareImmClear {r=r2, t=t1, c=c, f=f, im11=low_sign_ext_im11 (opn i1)};
565            Load {Op=0wxd, b=b, im14=low_sign_ext_im14 (itow i2), t=t2}            Load {Op=0wxd, b=b, im14=low_sign_ext_im14 (itow i2), t=t2}
# Line 585  Line 585 
585       | emitInstr (I.B{lab, n}) = branchLink (0wx3a, zeroR, lab, 0wx0, n)       | emitInstr (I.B{lab, n}) = branchLink (0wx3a, zeroR, lab, 0wx0, n)
586       | emitInstr (I.LONGJUMP{lab, n, tmp, tmpLab}) =       | emitInstr (I.LONGJUMP{lab, n, tmp, tmpLab}) =
587         let         let
588  (*#line 963.18 "hppa/hppa.mdl"*)  (*#line 975.18 "hppa/hppa.mdl"*)
589             val offset = T.SUB (32, T.LABEL lab, T.ADD (32, T.LABEL tmpLab,             val offset = T.SUB (32, T.LABEL lab, T.ADD (32, T.LABEL tmpLab,
590                    T.LI (IntInf.fromInt 4)))                    T.LI (IntInf.fromInt 4)))
591         in Label.setAddr (tmpLab, ( ! loc) + 4);         in Label.setAddr (tmpLab, ( ! loc) + 4);
# Line 595  Line 595 
595         end         end
596       | emitInstr (I.BE{b, d, sr, n, labs}) =       | emitInstr (I.BE{b, d, sr, n, labs}) =
597         let         let
598  (*#line 980.18 "hppa/hppa.mdl"*)  (*#line 992.18 "hppa/hppa.mdl"*)
599             val (w, w1, w2) = assemble_17 (opn d)             val (w, w1, w2) = assemble_17 (opn d)
600         in BranchExternal {Op=0wx38, b=b, w1=w1, s=assemble_3 (itow sr), w2=w2,         in BranchExternal {Op=0wx38, b=b, w1=w1, s=assemble_3 (itow sr), w2=w2,
601               n=n, w=w}               n=n, w=w}
# Line 626  Line 626 
626         )         )
627       | emitInstr (I.FSTOREX{fstx, b, x, r, mem}) =       | emitInstr (I.FSTOREX{fstx, b, x, r, mem}) =
628         let         let
629  (*#line 1064.18 "hppa/hppa.mdl"*)  (*#line 1076.18 "hppa/hppa.mdl"*)
630             val (Op, uid, u, m) = emit_fstorex fstx             val (Op, uid, u, m) = emit_fstorex fstx
631         in CoProcIndexed {Op=Op, b=b, x=x, s=0wx0, u=u, m=m, ls=0wx1, uid=uid,         in CoProcIndexed {Op=Op, b=b, x=x, s=0wx0, u=u, m=m, ls=0wx1, uid=uid,
632               rt=r}               rt=r}
# Line 640  Line 640 
640         )         )
641       | emitInstr (I.FLOADX{flx, b, x, t, mem}) =       | emitInstr (I.FLOADX{flx, b, x, t, mem}) =
642         let         let
643  (*#line 1084.18 "hppa/hppa.mdl"*)  (*#line 1096.18 "hppa/hppa.mdl"*)
644             val (Op, uid, u, m) = emit_floadx flx             val (Op, uid, u, m) = emit_floadx flx
645         in CoProcIndexed {Op=Op, b=b, x=x, s=0wx0, u=u, m=m, ls=0wx0, uid=uid,         in CoProcIndexed {Op=Op, b=b, x=x, s=0wx0, u=u, m=m, ls=0wx0, uid=uid,
646               rt=t}               rt=t}
# Line 651  Line 651 
651              r22=0wx0}              r22=0wx0}
652         | _ =>         | _ =>
653           let           let
654  (*#line 1095.25 "hppa/hppa.mdl"*)  (*#line 1107.25 "hppa/hppa.mdl"*)
655               val (sop, fmt) = emit_farith fa               val (sop, fmt) = emit_farith fa
656           in FloatOp3Maj0C {sop=sop, r1=r1, r2=r2, t=t, n=0wx0, fmt=fmt}           in FloatOp3Maj0C {sop=sop, r1=r1, r2=r2, t=t, n=0wx0, fmt=fmt}
657           end           end
658         )         )
659       | emitInstr (I.FUNARY{fu, f, t}) =       | emitInstr (I.FUNARY{fu, f, t}) =
660         let         let
661  (*#line 1112.18 "hppa/hppa.mdl"*)  (*#line 1124.18 "hppa/hppa.mdl"*)
662             val (sop, fmt) = emit_funary fu             val (sop, fmt) = emit_funary fu
663         in FloatOp0Maj0C {r=f, t=t, sop=sop, fmt=fmt}         in FloatOp0Maj0C {r=f, t=t, sop=sop, fmt=fmt}
664         end         end
665       | emitInstr (I.FCNV{fcnv, f, t}) =       | emitInstr (I.FCNV{fcnv, f, t}) =
666         let         let
667  (*#line 1121.18 "hppa/hppa.mdl"*)  (*#line 1133.18 "hppa/hppa.mdl"*)
668             val (sop, sf, df) = emit_fcnv fcnv             val (sop, sf, df) = emit_fcnv fcnv
669         in FloatOp1Maj0E {r=f, t=t, sop=sop, sf=sf, df=df, r2=0wx1, t2=0wx0}         in FloatOp1Maj0E {r=f, t=t, sop=sop, sf=sf, df=df, r2=0wx1, t2=0wx0}
670         end         end

Legend:
Removed from v.1202  
changed lines
  Added in v.1203

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