home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / emulate / sparc / float.s < prev    next >
Text File  |  1992-01-29  |  13KB  |  734 lines

  1. !
  2. ! test floating point insns
  3. !
  4. ! fpe trap is a little tricky since the
  5. ! sigcontext sc_pc/sc_npc are unreliable due
  6. ! to FP parallel execution.
  7. !
  8. ! extended-precision instructions are NOT implemented!
  9. !
  10. ! setup SIGFPE signal handler
  11. !
  12.     set    sigtramp,%o1
  13.     set    sv1,%o0
  14.     st    %o1,[%o0] ! init sigvec struct
  15.     mov    %o0,%o1
  16.     clr    %o2
  17.     mov    8,%o0
  18.     mov    0x6c,%g1 ! sigvec system call
  19.     ta    0
  20. !
  21. ! clear tem mask
  22. !
  23.     call    set_tem
  24.     clr    %o0
  25.     set    f1,%o0
  26.     ld    [%o0],%f0
  27.     fitos    %f0,%f1
  28.     ld    [%o0+4],%f0
  29.     fitos    %f0,%f1
  30. !
  31. ! set nxm bit in tem mask
  32. !
  33.     call    set_tem
  34.     mov    0x1,%o0
  35. !
  36. ! now trap on inexact
  37. !
  38.     set    f1,%o0
  39.     ld    [%o0],%f0
  40.     fitos    %f0,%f1
  41.     ld    [%o0+4],%f0
  42.     fitos    %f0,%f1       ! trap #1
  43. ! fitod
  44.     ld    [%o0],%f0
  45.     fitod    %f0,%f2
  46.     std    %f2,[%o0+8]
  47.     ldd    [%o0+16],%l0
  48.     ldd    [%o0+8],%l2
  49.     cmp    %l0,%l2
  50.     bne,a    .+0x8
  51.     unimp    0
  52.     cmp    %l1,%l3
  53.     bne,a    .+0x8
  54.     unimp    0
  55. ! fstoi (in range)
  56.     set    f2,%i0
  57.     ld    [%i0],%f0
  58.     fstoi    %f0,%f0
  59.     st    %f0,[%i0+4]
  60.     ld    [%i0+4],%l0
  61.     ld    [%i0+8],%l1
  62.     cmp    %l0,%l1
  63.     bne,a    .+0x8
  64.     unimp    0
  65. !
  66. ! enable nvc, ofc, nxc, dzc exceptions
  67. !
  68.     call    set_tem
  69.     mov    0x1b,%o0
  70. ! fstoi (out of range, nvc trap)
  71.     ld    [%i0+12],%f0
  72.     fstoi    %f0,%f0       ! trap #2
  73.     nop
  74.     st    %f0,[%i0+16]
  75.     ld    [%i0+16],%i1
  76.     set    0x7fffffff,%g1
  77.     cmp    %i1,%g1
  78.     bne,a    .+0x8
  79.     unimp    0
  80. ! fdtoi (in range)
  81.     set    f3,%i0
  82.     ldd    [%i0],%f0
  83.     fdtoi    %f0,%f0
  84.     st    %f0,[%i0+12]
  85.     ld    [%i0+12],%l0
  86.     ld    [%i0+8],%l1
  87.     cmp    %l0,%l1
  88.     bne,a    .+0x8
  89.     unimp    0
  90. ! fdtoi (out of range, trap nvc)
  91.     ldd    [%i0+16],%f0
  92.     fdtoi    %f0,%f0        ! trap #3
  93.     nop
  94.     st    %f0,[%i0+12]
  95.     ld    [%i0+12],%i1
  96.     set    0x7fffffff,%g1
  97.     cmp    %i1,%g1
  98.     bne,a    .+0x8
  99.     unimp    0
  100. ! fdtoi (in range, but inexact, trap nxc)
  101.     ldd    [%i0+24],%f0
  102.     fdtoi    %f0,%f0        ! trap #4
  103. ! fstod (always in range, cannot trap)
  104.     set    f4,%o0
  105.     ld    [%o0],%f0
  106.     fstod    %f0,%f2
  107.     std    %f2,[%o0+8]
  108.     ldd    [%o0+8],%l0
  109.     ldd    [%o0+16],%l2
  110.     cmp    %l0,%l2
  111.     bne,a    .+0x8
  112.     unimp    0
  113.     cmp    %l1,%l3
  114.     bne,a    .+0x8
  115.     unimp    0
  116. ! fdtos (in range)
  117.     set    f5,%i0
  118.     ldd    [%i0],%f0
  119.     fdtos    %f0,%f0
  120.     st    %f0,[%i0+4]
  121.     ld    [%i0+4],%l0
  122.     set    0x4d91a2b0,%l1
  123.     cmp    %l0,%l1
  124.     bne,a    .+0x8
  125.     unimp    0
  126. ! fdtos (out of range, trap nvc)
  127.     ldd    [%i0+8],%f0
  128.     fdtos    %f0,%f0         ! trap #5
  129.     nop
  130.     st    %f0,[%i0+4]
  131.     ld    [%i0+4],%l0
  132.     set    0x7f800000,%l1
  133.     cmp    %l0,%l1
  134.     bne,a    .+0x8
  135.     unimp    0
  136. !
  137. ! fdtos (in range, but inexact, trap nxc)
  138. !
  139.     ldd    [%i0+16],%f0
  140.     fdtos    %f0,%f0        ! trap #6
  141.     nop
  142. ! fmovs
  143.     set    f4,%o0
  144.     ld    [%o0],%f0
  145.     ld    [%o0+4],%f1  ! s/b 0
  146.     fmovs    %f0,%f1
  147.     st    %f1,[%o0+4]
  148.     ld    [%o0],%l0
  149.     ld    [%o0+4],%l1
  150.     cmp    %l0,%l1
  151.     bne,a    .+0x8
  152.     unimp    0
  153. ! fnegs
  154.     fnegs    %f1,%f2
  155. ! fabss
  156.     fabss    %f2,%f3
  157.     st    %f3,[%o0+4]
  158.     ld    [%o0+4],%l1
  159.     cmp    %l0,%l1
  160.     bne,a    .+0x8
  161.     unimp    0
  162. ! fsqrts (exact, inrange)
  163.     set    f6,%o0
  164.     ld    [%o0],%f0
  165.     fsqrts    %f0,%f1
  166.     st    %f1,[%o0+8]
  167.     ld    [%o0+8],%l0
  168.     ld    [%o0+4],%l1
  169.     cmp    %l0,%l1
  170.     bne,a    .+0x8
  171.     unimp    0
  172. ! fsqrts (negative number, trap nvc)
  173.     fnegs    %f0,%f0
  174.     fsqrts    %f0,%f1        ! trap #7
  175.     st    %f1,[%o0+8]
  176.     ld    [%o0+8],%l0
  177.     mov    -1,%l1
  178.     cmp    %l0,%l1
  179.     bne,a    .+0x8
  180.     unimp    0
  181. ! fsqrts (inrange, inexact, trap nxc)
  182.     ld    [%o0+12],%f0
  183.     fsqrts    %f0,%f0        ! trap #8
  184.     st    %f0,[%o0+16]
  185.     ld    [%o0+16],%l0
  186.     set    0x408f1bbd,%l1
  187.     cmp    %l0,%l1
  188.     bne,a    .+0x8
  189.     unimp    0
  190. ! fsqrtd (exact, inrange)
  191.     set    f7,%o0
  192.     ldd    [%o0],%f0
  193.     fsqrtd    %f0,%f2
  194.     std    %f2,[%o0+8]
  195.     ldd    [%o0+8],%l0
  196.     ldd    [%o0+16],%l2
  197.     cmp    %l0,%l2
  198.     bne,a    .+0x8
  199.     unimp    0
  200.     cmp    %l1,%l3
  201.     bne,a    .+0x8
  202.     unimp    0
  203. ! fsqrtd (negative number, trap nvc)
  204.     fnegs    %f0,%f0
  205.     fsqrtd    %f0,%f2        ! trap #9
  206.     std    %f2,[%o0+8]
  207.     ldd    [%o0+8],%l0
  208.     mov    -1,%l2
  209.     mov    -1,%l3
  210.     cmp    %l0,%l2
  211.     bne,a    .+0x8
  212.     unimp    0
  213.     cmp    %l1,%l3
  214.     bne,a    .+0x8
  215.     unimp    0
  216. ! fsqrtd (inrange, inexact, trap nxc)
  217.     set    f8,%o0
  218.     ldd    [%o0],%f0
  219.     fsqrtd    %f0,%f0        ! trap #10
  220.     std    %f0,[%o0+8]
  221.     ldd    [%o0+8],%l0    ! compare only most significant digs.
  222.     set    0x3ffc5bf8,%l2
  223.     cmp    %l0,%l2
  224.     bne,a    .+0x8
  225.     unimp    0
  226. ! fadds (exact)
  227.     set    f9,%o0
  228.     ldd    [%o0],%f0
  229.     fadds    %f0,%f1,%f2
  230.     st    %f2,[%o0+8]
  231.     ld    [%o0+8],%l0
  232.     set    0x451dcc00,%l1
  233.     cmp    %l1,%l0
  234.     bne,a    .+0x8
  235.     unimp    0
  236. ! fadds (inexact, trap nxc)
  237.     ldd    [%o0+8],%f0
  238.     fadds    %f0,%f1,%f2  ! trap #11
  239.     st    %f2,[%o0+8]
  240.     ld    [%o0+8],%l0
  241.     set    0x45887820,%l1
  242.     cmp    %l1,%l0
  243.     bne,a    .+0x8
  244.     unimp    0
  245. ! fadds (overflow, trap ofc)
  246.     ld    [%o0+20],%f0
  247.     fadds    %f0,%f0,%f0  ! trap #12
  248.     st    %f0,[%o0+24]
  249.     ld    [%o0+24],%l0
  250.     set    0x7f800000,%l1
  251.     cmp    %l0,%l1
  252.     bne,a    .+0x8
  253.     unimp    0
  254. ! faddd (exact)
  255.     set    f10,%o0
  256.     ldd    [%o0],%f0
  257.     ldd    [%o0+8],%f2
  258.     faddd    %f0,%f2,%f4
  259.     std    %f4,[%o0+16]
  260.     ldd    [%o0+16],%l0
  261.     ldd    [%o0+24],%l2
  262.     cmp    %l0,%l2
  263.     bne,a    .+0x8
  264.     unimp    0
  265.     cmp    %l3,%l1
  266.     bne,a    .+0x8
  267.     unimp    0
  268. ! faddd (inexact, trap nxc)
  269.     set    f11,%o0
  270.     ldd    [%o0],%f0
  271.     ldd    [%o0+8],%f2
  272.     faddd    %f0,%f2,%f4   ! trap #13
  273.     std    %f4,[%o0+16]
  274.     ldd    [%o0+16],%l0
  275.     ldd    [%o0+24],%l2
  276.     cmp    %l0,%l2
  277.     bne,a    .+0x8
  278.     unimp    0
  279.     cmp    %l3,%l1
  280.     bne,a    .+0x8
  281.     unimp    0
  282. ! faddd (overflow, trap ofc)
  283.     set    f12,%o0
  284.     ldd    [%o0],%f0
  285.     faddd    %f0,%f0,%f4   ! trap #14
  286.     std    %f4,[%o0+8]
  287.     ldd    [%o0+8],%l0
  288.     set    0x7ff00000,%l2
  289.     clr    %l3
  290.     cmp    %l0,%l2
  291.     bne,a    .+0x8
  292.     unimp    0
  293.     cmp    %l3,%l1
  294.     bne,a    .+0x8
  295.     unimp    0
  296. ! fsubs (exact)
  297.     set    f9,%o0
  298.     ldd    [%o0],%f0
  299.     fnegs    %f1,%f1
  300.     fsubs    %f0,%f1,%f2
  301.     st    %f2,[%o0+8]
  302.     ld    [%o0+8],%l0
  303.     set    0x451dcc00,%l1
  304.     cmp    %l1,%l0
  305.     bne,a    .+0x8
  306.     unimp    0
  307. ! fsubs (inexact, trap nxc)
  308.     ldd    [%o0+8],%f0
  309.     fnegs    %f1,%f1
  310.     fsubs    %f0,%f1,%f2  ! trap #15
  311.     st    %f2,[%o0+8]
  312.     ld    [%o0+8],%l0
  313.     set    0x45887820,%l1
  314.     cmp    %l1,%l0
  315.     bne,a    .+0x8
  316.     unimp    0
  317. ! fsubs (overflow, trap ofc)
  318.     ld    [%o0+20],%f0
  319.     fnegs    %f0,%f1
  320.     fsubs    %f0,%f1,%f0  ! trap #16
  321.     st    %f0,[%o0+24]
  322.     ld    [%o0+24],%l0
  323.     set    0x7f800000,%l1
  324.     cmp    %l0,%l1
  325.     bne,a    .+0x8
  326.     unimp    0
  327. ! fsubd (exact)
  328.     set    f10,%o0
  329.     ldd    [%o0],%f0
  330.     ldd    [%o0+8],%f2
  331.     fnegs    %f2,%f2
  332.     fsubd    %f0,%f2,%f4
  333.     std    %f4,[%o0+16]
  334.     ldd    [%o0+16],%l0
  335.     ldd    [%o0+24],%l2
  336.     cmp    %l0,%l2
  337.     bne,a    .+0x8
  338.     unimp    0
  339.     cmp    %l3,%l1
  340.     bne,a    .+0x8
  341.     unimp    0
  342. ! fsubd (inexact, trap nxc)
  343.     set    f11,%o0
  344.     ldd    [%o0],%f0
  345.     ldd    [%o0+8],%f2
  346.     fnegs    %f2,%f2
  347.     fsubd    %f0,%f2,%f4   ! trap #17
  348.     std    %f4,[%o0+16]
  349.     ldd    [%o0+16],%l0
  350.     ldd    [%o0+24],%l2
  351.     cmp    %l0,%l2
  352.     bne,a    .+0x8
  353.     unimp    0
  354.     cmp    %l3,%l1
  355.     bne,a    .+0x8
  356.     unimp    0
  357. ! fsubd (overflow, trap ofc)
  358.     set    f12,%o0
  359.     ldd    [%o0],%f0
  360.     fnegs    %f0,%f2
  361.     fmovs    %f1,%f3
  362.     fsubd    %f0,%f2,%f4   ! trap #18
  363.     std    %f4,[%o0+8]
  364.     ldd    [%o0+8],%l0
  365.     set    0x7ff00000,%l2
  366.     clr    %l3
  367.     cmp    %l0,%l2
  368.     bne,a    .+0x8
  369.     unimp    0
  370.     cmp    %l3,%l1
  371.     bne,a    .+0x8
  372.     unimp    0
  373. ! fmuls (exact)
  374.     set    f13,%o0
  375.     ld    [%o0],%f0
  376.     ld    [%o0+4],%f1
  377.     fmuls    %f0,%f1,%f2
  378.     st    %f2,[%o0+8]
  379.     ld    [%o0+8],%l0
  380.     set    0x47b89200,%l1
  381.     cmp    %l0,%l1
  382.     bne,a    .+0x8
  383.     unimp    0
  384. ! fmuls (inexact, trap nxc)
  385.     ld    [%o0+12],%f0
  386.     ld    [%o0+16],%f1
  387.     fmuls    %f0,%f1,%f2     ! trap #19
  388.     st    %f2,[%o0+20]
  389.     ld    [%o0+20],%l0
  390.     set    0x40e0367e,%l1
  391.     cmp    %l0,%l1
  392.     bne,a    .+0x8
  393.     unimp    0
  394. ! fmuls (overflow, trap ofc)
  395.     ld    [%o0+24],%f0
  396.     fmuls    %f0,%f0,%f1   ! trap #20
  397.     st    %f1,[%o0+28]
  398.     ld    [%o0+28],%l0
  399.     set    0x7f800000,%l1
  400.     cmp    %l0,%l1
  401.     bne,a    .+0x8
  402.     unimp    0
  403. ! fmuld (exact)
  404.     set    f14,%o0
  405.     ldd    [%o0],%f0
  406.     ldd    [%o0+8],%f2
  407.     fmuld    %f0,%f2,%f4
  408.     std    %f4,[%o0+16]
  409.     ldd    [%o0+16],%l0
  410.     ldd    [%o0+24],%l2
  411.     cmp    %l0,%l2
  412.     bne,a    .+0x8
  413.     unimp    0
  414.     cmp    %l3,%l1
  415.     bne,a    .+0x8
  416.     unimp    0
  417. ! fmuld (inexact, trap nxc)
  418.     fmuld    %f0,%f4,%f4    ! trap #21
  419.     std    %f4,[%o0+8]
  420.     ldd    [%o0+8],%l0
  421.     set    0x43b6cdc7,%l2
  422.     set    0x98c8955e,%l3
  423.     cmp    %l0,%l2
  424.     bne,a    .+0x8
  425.     unimp    0
  426.     cmp    %l3,%l1
  427.     bne,a    .+0x8
  428.     unimp    0
  429. ! fmuld (overflow, trap ofc)
  430.     ldd    [%o0+32],%f0
  431.     fmuld    %f0,%f0,%f0   ! trap #22
  432.     std    %f0,[%o0+40]
  433.     ldd    [%o0+40],%l0
  434.     set    0x7ff00000,%l2
  435.     clr    %l3
  436.     cmp    %l0,%l2
  437.     bne,a    .+0x8
  438.     unimp    0
  439.     cmp    %l3,%l1
  440.     bne,a    .+0x8
  441.     unimp    0
  442. ! fdivs (exact)
  443.     set    f15,%o0
  444.     ldd    [%o0],%f0
  445.     fdivs    %f0,%f1,%f2
  446.     st    %f2,[%o0+8]
  447.     ld    [%o0+8],%l0
  448.     set    0x42f60000,%l1
  449.     cmp    %l0,%l1
  450.     bne,a    .+0x8
  451.     unimp    0
  452. ! fdivs (divide by zero, trap dzc)
  453.     ld    [%o0+12],%f1
  454.     fdivs    %f0,%f1,%f2    ! trap #23    
  455.     st    %f2,[%o0+8]
  456.     ld    [%o0+8],%l0
  457.     set    0x7f800000,%l1
  458.     cmp    %l0,%l1
  459.     bne,a    .+0x8
  460.     unimp    0
  461. ! fdivs (inexact, trap nxc)
  462.     ldd    [%o0+16],%f0
  463.     fdivs    %f0,%f1,%f2   ! trap #24
  464.     st    %f2,[%o0+8]
  465.     ld    [%o0+8],%l0
  466.     set    0x3e21af28,%l1
  467.     cmp    %l0,%l1
  468.     bne,a    .+0x8
  469.     unimp    0
  470. ! fdivd (exact)
  471.     ldd    [%o0+24],%f0
  472.     ldd    [%o0+32],%f2
  473.     fdivd    %f0,%f2,%f4
  474.     std    %f4,[%o0+8]
  475.     ldd    [%o0+8],%l0
  476.     set    0x419196c5,%l2
  477.     set    0x04000000,%l3
  478.     cmp    %l0,%l2
  479.     bne,a    .+0x8
  480.     unimp    0
  481.     cmp    %l3,%l1
  482.     bne,a    .+0x8
  483.     unimp    0
  484. ! fdivd (divide by zero, trap dzc)
  485.     fsubd    %f2,%f2,%f6
  486.     fdivd    %f0,%f6,%f8  ! trap #25
  487.     std    %f8,[%o0+8]
  488.     ldd    [%o0+8],%l0
  489.     set    0x7ff00000,%l2
  490.     clr    %l3
  491.     cmp    %l0,%l2
  492.     bne,a    .+0x8
  493.     unimp    0
  494.     cmp    %l3,%l1
  495.     bne,a    .+0x8
  496.     unimp    0
  497. ! fdivd (inexact, trap nxc)
  498.     fdivd    %f4,%f2,%f0  ! trap #26
  499.     std    %f0,[%o0+8]
  500.     ldd    [%o0+8],%l0
  501.     set    0x404c1637,%l2
  502.     set    0xc8124d8a,%l3
  503.     cmp    %l0,%l2
  504.     bne,a    .+0x8
  505.     unimp    0
  506.     cmp    %l3,%l1
  507.     bne,a    .+0x8
  508.     unimp    0
  509. ! fcmps (greater than, less than, equal)
  510.     set    f16,%o0
  511.     ldd    [%o0],%f0
  512.     fcmps    %f1,%f0
  513.     nop
  514.     fbg,a    .+0x8
  515.     unimp    0
  516.     fcmps    %f0,%f1
  517.     nop
  518.     fbl,a    .+0x8
  519.     unimp    0
  520.     fcmps    %f1,%f1
  521.     nop
  522.     fbne,a    .+0x8
  523.     unimp    0
  524. ! fcmps (unordered)
  525.     ldd    [%o0+8],%f2  ! f2 signalling, f3 quiet NaN
  526.     fcmps    %f0,%f3
  527.     nop
  528.     fbo,a    .+0x8
  529.     unimp    0
  530.     fcmps    %f0,%f2  ! trap #27 nvc
  531.     nop
  532.     fbo,a    .+0x8
  533.     unimp    0
  534. ! fcmpes (greater than, less than, equal)
  535.     ldd    [%o0],%f0
  536.     fcmpes    %f1,%f0
  537.     nop
  538.     fbg,a    .+0x8
  539.     unimp    0
  540.     fcmpes    %f0,%f1
  541.     nop
  542.     fbl,a    .+0x8
  543.     unimp    0
  544.     fcmpes    %f1,%f1
  545.     nop
  546.     fbne,a    .+0x8
  547.     unimp    0
  548. ! fcmpes (unordered)
  549.     ldd    [%o0+8],%f2  ! f2 signalling, f3 quiet NaN
  550.     fcmpes    %f0,%f3  ! trap #28 nvx
  551.     nop
  552.     fbo,a    .+0x8
  553.     unimp    0
  554.     fcmpes    %f0,%f2  ! trap #29 nvc
  555.     nop
  556.     fbo,a    .+0x8
  557.     unimp    0
  558. ! fcmpd (greater than, less than, equal)
  559.     set    f17,%o0
  560.     ldd    [%o0],%f0
  561.     ldd    [%o0+8],%f2
  562.     fcmpd    %f2,%f0
  563.     nop
  564.     fbg,a    .+0x8
  565.     unimp    0
  566.     fcmpd    %f0,%f2
  567.     nop
  568.     fbl,a    .+0x8
  569.     unimp    0
  570.     fcmpd    %f2,%f2
  571.     nop
  572.     fbne,a    .+0x8
  573.     unimp    0
  574. ! fcmpd (unordered)
  575.     ldd    [%o0+16],%f2  ! f2 signalling, f4 quiet NaN
  576.     ldd    [%o0+24],%f4
  577.     fcmpd    %f0,%f4
  578.     nop
  579.     fbo,a    .+0x8
  580.     unimp    0
  581.     fcmpd    %f0,%f2  ! trap #30 nvc
  582.     nop
  583.     fbo,a    .+0x8
  584.     unimp    0
  585. ! fcmped (greater than, less than, equal)
  586.     set    f17,%o0
  587.     ldd    [%o0],%f0
  588.     ldd    [%o0+8],%f2
  589.     fcmped    %f2,%f0
  590.     nop
  591.     fbg,a    .+0x8
  592.     unimp    0
  593.     fcmped    %f0,%f2
  594.     nop
  595.     fbl,a    .+0x8
  596.     unimp    0
  597.     fcmped    %f2,%f2
  598.     nop
  599.     fbne,a    .+0x8
  600.     unimp    0
  601. ! fcmped (unordered)
  602.     ldd    [%o0+16],%f2  ! f2 signalling, f4 quiet NaN
  603.     ldd    [%o0+24],%f4
  604.     fcmped    %f0,%f4  ! trap #31 nvc
  605.     nop
  606.     fbo,a    .+0x8
  607.     unimp    0
  608.     fcmped    %f0,%f2  ! trap #32 nvc
  609.     nop
  610.     fbo,a    .+0x8
  611.     unimp    0
  612.  
  613. end:
  614. ! exit status is expected trap count
  615.     set    trap_count,%o0
  616.     ld    [%o0],%o0
  617.     mov    1,%g1
  618.     ta    0
  619.     nop
  620.  
  621.     .seg "data"
  622. f1:
  623.     .word 0xfedcba,0x12345678,0,0,0x416fdb97,0x40000000
  624. f2:
  625.     .word 0x4ee3c5a7,0,0x71e2d380,0x5ee3c5a7,0,0
  626. f3:
  627.     .word 0x41b23456,0x78000000,0x12345678,0,
  628.               0x6979ce40,0x17fc634f,0x40934a45,0x84f4c6e7
  629. f4:
  630.     .word 0x58cc550b,0,0,0,0x43198aa1,0x60000000
  631. f5:
  632.     .word 0x41b23456,0,0x5529af2b,0x7d0e0bbc,
  633.           0x427a28ed,0xc580e6a3
  634. f6:
  635.     .word 0x43dc8000,0x41a80000,0,0x41a00000,0,0
  636. f7:
  637.     .word 0x407ce400,0,0,0,0x40358000,0
  638. f8:
  639.     .word 0x400921fb,0x54411744,0,0
  640. f9:
  641.     .word 0x44d27000,0x44525000,0x4544597c,0x44e6487e,0
  642.     .word 0x7f61b1e6,0,0
  643. f10:
  644.     .word 0x41a14582,0xde90dc00,0x4110d63a,0xf1000000,
  645.           0,0,0x41a14ded,0xfc095c00
  646. f11:
  647.     .word 0x41a14582,0xde90dc00,0x3fb4e5e0,0xa72f053a,
  648.           0,0,0x41a14582,0xdebaa7c1
  649. f12:
  650.     .word 0x7feab36d,0x48e1acf1,0,0
  651. f13:
  652.     .word 0x40900000,0x46a41000,0,0x3f9df3b6,0x40b5b22d,0
  653.     .word 0x7f61b1e6,0
  654. f14:
  655.     .word 0x411bda05,0,0x415e1a4d,0xe0000000,0,0,
  656.               0x428a3349,0x9ba22b00,0x6ed00000,0,0,0
  657. f15:
  658.     .word 0x4664b400,0x42ee0000,0,0,0x40400000,0x41980000,
  659.               0x42d60796,0x944037c0,0x41340a1f,0x0
  660. f16:
  661.     .word 0x43988fbe,0x41f41931,0x7f800001,0x7fc00001
  662. f17:
  663.     .word 0x407311f7,0xced91687,0x403e8326,0x17c1bda5,
  664.               0x7ff00000,0x00000001,0x7ff80000,0x00000001
  665.  
  666.  
  667.  
  668.  
  669.  
  670. sv1:
  671.     .skip 0xc
  672. trap_count:
  673.     .word 0
  674. !
  675. ! handler increments trap count and returns
  676. !
  677.         .seg "text"
  678. handler:
  679.     set    trap_count,%o0
  680.     ld    [%o0],%o1
  681.     inc    %o1
  682.     st    %o1,[%o0]
  683.         retl
  684.         nop
  685.  
  686. !
  687. ! sigtramp sets up arguments for and calls the user handler,
  688. ! which is assumed not to touch the fp regs
  689. !
  690.     .seg "text"
  691. sigtramp:
  692.     save    %sp,-128,%sp ! protect ins, locals
  693.     mov    %y,%l0
  694.     st    %l0,[%sp+0x60]
  695.     std    %g6,[%sp+0x68]
  696.     std    %g4,[%sp+0x70]
  697.     std    %g2,[%sp+0x78]
  698.     ld    [%fp+0x40],%o0 ! sig
  699.     ld    [%fp+0x44],%o1 ! code
  700.     ld    [%fp+0x48],%o2 ! sigcontext ptr
  701.     set    handler,%g1
  702.     call    %g1            ! user's handler
  703.     ld    [%fp+0x4c],%o3 ! faulty addr
  704.     ld    [%sp+0x60],%l0
  705.     mov    %l0,%y
  706.     ldd    [%sp+0x68],%g6
  707.     ldd    [%sp+0x70],%g4
  708.     ldd    [%sp+0x78],%g2
  709.     ld    [%fp+0x48],%i0 ! will be %o0 after restore
  710.     mov    0x8b,%g1       ! return to sigcontext syscall
  711.     restore                ! regs restored (expect %o0)
  712.     ta    0
  713.  
  714. !
  715. ! (re)set bits in trap enable mask (tem)
  716. !
  717.     .seg    "data"
  718. fsrbits:
  719.     .word    0
  720.     .seg    "text"
  721. set_tem:
  722. L1:
  723.     set    fsrbits,%g1
  724.     st    %fsr,[%g1]
  725.     ld    [%g1],%o1
  726.     set    0xf800000,%o3
  727.     andn    %o1,%o3,%o1  ! turn off all tem bits
  728.     sll    %o0,23,%o0
  729.     or    %o0,%o1,%o1  ! or in new bits
  730.     st    %o1,[%g1]
  731.     ld    [%g1],%fsr
  732.     retl
  733.     nop
  734.