home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / emulate / sparc / branch.s < prev    next >
Text File  |  1991-10-30  |  3KB  |  263 lines

  1. !
  2. ! Test branch on integer condition code (bicc) insns
  3. !
  4. ! Set up constants
  5. !
  6.  
  7.     set    0x7fffffff,%o1
  8.     mov    1, %o2
  9.     mov    -1, %o3
  10.     set    0x80000001, %o4
  11. !
  12. ! First, without annulment
  13. !
  14. ! ba
  15. !
  16.     ba    L1
  17.     nop
  18. L2:
  19.     unimp    0
  20. L1:
  21. ! bn
  22.     bn    L2
  23.     nop
  24. ! bne
  25.     subcc    %g0,1,%g0
  26.     bne    .+0xc
  27.     nop
  28.     unimp    0
  29. ! be
  30.     orcc    %g0,%g0,%g0
  31.     be    .+0xc
  32.     nop
  33.     unimp    0
  34. ! bg
  35.     addcc    %o1,%o1,%g0
  36.     bg    .+0xc
  37.     nop
  38.     unimp    0
  39.     add    %o2,%o2,%g0
  40.     bg    .+0xc
  41.     nop
  42.     unimp    0
  43. ! ble
  44.     tst    %g0
  45.     ble    .+0xc
  46.     nop    
  47.     unimp    0
  48.     tst    %o3
  49.     ble    .+0xc
  50.     nop    
  51.     unimp    0
  52.     addcc    %o3,%o3,%g0
  53.     ble    .+0xc
  54.     nop    
  55.     unimp    0
  56. ! bge
  57.     tst    %o2
  58.     bge    .+0xc
  59.     nop    
  60.     unimp    0
  61.     addcc    %o1,%o1,%g0
  62.     bge    .+0xc
  63.     nop    
  64.     unimp    0
  65. ! bl
  66.     orcc    %g0,-1,%g0
  67.     bl    .+0xc
  68.     nop
  69.     unimp    0
  70.     addcc    %o4,%o4,%g0
  71.     bl    .+0xc
  72.     nop
  73.     unimp    0
  74. ! bgu
  75.     orcc    %g0,1,%g0
  76.     bgu    .+0xc
  77.     nop
  78.     unimp    0
  79. ! bleu
  80.     addcc    %o3,%o3,%g0
  81.     bleu    .+0xc
  82.     nop
  83.     unimp    0
  84.     orcc    %g0,%g0,%g0
  85.     bleu    .+0xc
  86.     nop
  87.     unimp    0
  88.     addcc    %o2,-1,%g0
  89.     bleu    .+0xc
  90.     nop
  91.     unimp    0
  92. ! bcc
  93.     orcc    %g0,%g0,%g0
  94.     bcc    .+0xc
  95.     nop
  96.     unimp    0
  97. ! bcs
  98.     addcc    %o2,%o3,%g0
  99.     bcs    .+0xc
  100.     nop
  101.     unimp    0
  102. ! bpos
  103.     tst    %o2
  104.     bpos    .+0xc
  105.     nop
  106.     unimp    0
  107. ! bneg
  108.     tst    %o3
  109.     bneg    .+0xc
  110.     nop
  111.     unimp    0
  112. ! bvc
  113.     orcc    %g0,%g0,%g0
  114.     bvc    .+0xc
  115.     nop
  116.     unimp    0
  117. ! bvs
  118.     addcc    %o1,%o1,%g0
  119.     bvs    .+0xc
  120.     nop
  121.     unimp    0
  122. !
  123. ! Now with annulment
  124. !
  125. ! ba,a
  126.     ba,a    .+0x8
  127.     unimp    0
  128. ! bn,a
  129.     bn,a    .+0x8
  130.     unimp    0
  131. ! be,a
  132.     subcc    %g0,1,%g0
  133.     be,a    .+0x8
  134.     unimp    0
  135. ! bne,a
  136.     orcc    %g0,%g0,%g0
  137.     bne,a    .+0x8
  138.     unimp    0
  139. ! ble,a
  140.     addcc    %o1,%o1,%g0
  141.     ble,a    .+0x8
  142.     unimp    0
  143.     add    %o2,%o2,%g0
  144.     ble,a    .+0x8
  145.     unimp    0
  146. ! bg,a
  147.     tst    %g0
  148.     bg,a    .+0xc
  149.     unimp    0
  150.     tst    %o3
  151.     bg,a    .+0xc
  152.     unimp    0
  153.     addcc    %o3,%o3,%g0
  154.     bg,a    .+0xc
  155.     unimp    0
  156. ! bl,a
  157.     tst    %o2
  158.     bl,a    .+0xc
  159.     unimp    0
  160.     addcc    %o1,%o1,%g0
  161.     bl,a    .+0xc
  162.     unimp    0
  163. ! bge,a
  164.     orcc    %g0,-1,%g0
  165.     bge,a    .+0xc
  166.     unimp    0
  167.     addcc    %o4,%o4,%g0
  168.     bge,a    .+0xc
  169.     unimp    0
  170. ! bleu,a
  171.     orcc    %g0,1,%g0
  172.     bleu,a    .+0xc
  173.     unimp    0
  174. ! bgu,a
  175.     addcc    %o3,%o3,%g0
  176.     bgu,a    .+0xc
  177.     unimp    0
  178.     orcc    %g0,%g0,%g0
  179.     bgu,a    .+0xc
  180.     unimp    0
  181.     addcc    %o2,-1,%g0
  182.     bgu,a    .+0xc
  183.     unimp    0
  184. ! bcs,a
  185.     orcc    %g0,%g0,%g0
  186.     bcs,a    .+0xc
  187.     unimp    0
  188. ! bcc,a
  189.     addcc    %o2,%o3,%g0
  190.     bcc,a    .+0xc
  191.     unimp    0
  192. ! bneg,a
  193.     tst    %o2
  194.     bneg,a    .+0xc
  195.     unimp    0
  196. ! bpos,a
  197.     tst    %o3
  198.     bpos,a    .+0xc
  199.     unimp    0
  200. ! bvs,a
  201.     orcc    %g0,%g0,%g0
  202.     bvs,a    .+0xc
  203.     unimp    0
  204. ! bvc,a
  205.     addcc    %o1,%o1,%g0
  206.     bvc,a    .+0xc
  207.     unimp    0
  208. !
  209. ! back-to-back branch tests
  210. !
  211. ! case 1
  212.     ba    .+0xc
  213.     ba    .+0x10
  214.     unimp    0
  215.     tst    %g0
  216.     unimp    1
  217. ! case 2
  218.     ba    .+0x10
  219.     bne    .+0x8
  220.     unimp    2
  221.     unimp    3
  222. ! case 3
  223.     ba    .+0x10
  224.     bne,a    .+0x8
  225.     unimp    4
  226.     unimp    5
  227.     unimp    6
  228. ! case 4
  229.     ba    .+0xc
  230.     ba,a    .+0x10
  231.     unimp    7
  232.     unimp    8
  233.     unimp    9
  234. ! case 5
  235.     ba,a    .+0x10
  236.     be    .+0x8
  237.     unimp    10
  238.     unimp    11
  239.     ba,a    .+0x10
  240.     ba    .+0x8
  241.     unimp    12
  242.     unimp    13
  243.     ba,a    .+0x10
  244.     ba,a    .+0x8
  245.     unimp    14
  246.     unimp    15
  247. ! case 6 (behaves like case 1)
  248.     be    .+0xc
  249.     ba    .+0x10
  250.     unimp    16
  251.     nop
  252.     unimp    17
  253.     bne    .+0xc
  254.     ba    .+0x10
  255.     nop
  256.     unimp    18
  257.     unimp    19
  258. exit:
  259.     clr    %o0
  260.     mov    1,%g1
  261.     ta    0
  262.  
  263.