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

  1. !
  2. ! Test load/store instructions
  3. !
  4.     .seg    "data"
  5.     .align    8
  6. in:
  7.     .word    0x12345678, 0x9abcdef0
  8. out:
  9.     .skip    8
  10.     .seg    "text"
  11.     set    in,%o0
  12. ! ld
  13.     ld    [%o0],%o1
  14.     set    0x12345678,%l0
  15.     cmp    %o1,%l0
  16.     bne,a    .+0x8
  17.     unimp    0
  18.     ld    [%o0],%g0
  19.     tst    %g0
  20.     bne,a    .+0x8
  21.     unimp    0
  22. ! ldd
  23.     ldd    [%o0],%o2
  24.     set    0x9abcdef0,%l1
  25.     cmp    %o2,%l0
  26.     bne,a    .+0x8
  27.     unimp    0
  28.     cmp    %o3,%l1
  29.     bne,a    .+0x8
  30.     unimp    0
  31. ! ldub
  32.     ldub    [%o0+7],%o1
  33.     cmp    %o1,0xf0
  34.     bne,a    .+0x8
  35.     unimp    0
  36. ! ldsb
  37.     ldsb    [%o0+7],%o1
  38.     cmp    %o1,0xfffffff0
  39.     bne,a    .+0x8
  40.     unimp    0
  41. ! lduh
  42.     lduh    [%o0+6],%o1
  43.     set    0xdef0,%g1
  44.     cmp    %o1,%g1
  45.     bne,a    .+0x8
  46.     unimp    0
  47. ! ldsh
  48.     ldsh    [%o0+6],%o1
  49.     set    0xffffdef0,%g1
  50.     cmp    %o1,%g1
  51.     bne,a    .+0x8
  52.     unimp    0
  53. ! st
  54.     set    out,%o0
  55.     st    %l1,[%o0]
  56.     ld    [%o0],%o1
  57.     cmp    %o1,%l1
  58.     bne,a    .+0x8
  59.     unimp    0
  60. ! std
  61.     std    %l0,[%o0]
  62.     ldd    [%o0],%l2
  63.     cmp    %l0,%l2
  64.     bne,a    .+0x8
  65.     unimp    0
  66.     cmp    %l1,%l3
  67.     bne,a    .+0x8
  68.     unimp    0
  69. ! sth
  70.     sth    %l0,[%o0]
  71.     lduh    [%o0],%l2
  72.     set    0x5678,%l3
  73.     cmp    %l2,%l3
  74.     bne,a    .+0x8
  75.     unimp    0
  76. ! stb
  77.     stb    %l0,[%o0]
  78.     ldub    [%o0],%l2
  79.     cmp    %l2,0x78
  80.     bne,a    .+0x8
  81.     unimp    0
  82. ! ldstub
  83.     ldstub    [%o0],%l2
  84.     cmp    %l2,0x78
  85.     bne,a    .+0x8
  86.     unimp    0
  87.     ldub    [%o0],%l2
  88.     cmp    %l2,0xff
  89.     bne,a    .+0x8
  90.     unimp    0
  91. ! swap
  92.     swap    [%o0+4],%l2
  93.     cmp    %l2,%l1
  94.     bne,a    .+0x8
  95.     unimp    0
  96.     ld    [%o0+4],%l2
  97.     cmp    %l2,0xff
  98.     bne,a    .+0x8
  99.     unimp    0
  100. ! floating point load/store
  101.     set    d1,%o0
  102.     set    d2,%o1
  103.     ldd    [%o0],%l0
  104.     ld    [%o0],%f3
  105.     ldd    [%o0],%f4
  106. !
  107. ! the following fsr test is implementation
  108. ! dependent and hence commented out...
  109. !
  110. /*
  111.     ld    [%o0],%fsr
  112.     st    %fsr,[%o1]
  113.     ld    [%o1],%i0
  114.     set    0xcfc40fff,%l2
  115.     and    %l0,%l2,%l3
  116.     set    0x40000,%l2
  117.     or    %l3,%l2,%l2
  118.     cmp    %i0,%l2
  119.     bne,a    .+0x8
  120.     unimp    0
  121. */
  122.     st    %f3,[%o1]
  123.     ld    [%o1],%i0
  124.     cmp    %i0,%l0
  125.     bne,a    .+0x8
  126.     unimp    0
  127.     std    %f4,[%o1]
  128.     ldd    [%o1],%i0
  129.     cmp    %i0,%l0
  130.     bne,a    .+0x8
  131.     unimp    0
  132.     cmp    %i1,%l1
  133.     bne,a    .+0x8
  134.     unimp    0
  135.  
  136. exit:
  137.     mov    1,%g1
  138.     clr    %o0
  139.     ta    0
  140.     nop
  141.  
  142.     .seg    "data"
  143.     .align 8
  144. d1:
  145.     .word 0x12345678, 0x9abcdef0
  146. d2:
  147.     .skip 8
  148.