cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

test_b.S (3282B)


      1#include "macros.inc"
      2
      3test_suite b
      4
      5test bnone
      6    movi    a2, 0xa5a5ff00
      7    movi    a3, 0x5a5a00ff
      8    bnone   a2, a3, 1f
      9    test_fail
     101:
     11    movi    a2, 0xa5a5ff01
     12    bnone   a2, a3, 1f
     13    j       2f
     141:
     15    test_fail
     162:
     17test_end
     18
     19test beq
     20    movi    a2, 0
     21    movi    a3, 0
     22    beq     a2, a3, 1f
     23    test_fail
     241:
     25    movi    a2, 1
     26    beq     a2, a3, 1f
     27    j       2f
     281:
     29    test_fail
     302:
     31test_end
     32
     33test blt
     34    movi    a2, 6
     35    movi    a3, 7
     36    blt     a2, a3, 1f
     37    test_fail
     381:
     39    movi    a2, 0xffffffff
     40    blt     a2, a3, 1f
     41    test_fail
     421:
     43    movi    a2, 7
     44    blt     a2, a3, 1f
     45    j       2f
     461:
     47    test_fail
     482:
     49test_end
     50
     51test bltu
     52    movi    a2, 6
     53    movi    a3, 7
     54    bltu    a2, a3, 1f
     55    test_fail
     561:
     57    movi    a2, 7
     58    bltu    a2, a3, 1f
     59    j       2f
     601:
     61    test_fail
     622:
     63    movi    a2, 0xffffffff
     64    bltu    a2, a3, 1f
     65    j       2f
     661:
     67    test_fail
     682:
     69test_end
     70
     71test ball
     72    movi    a2, 0xa5a5ffa5
     73    movi    a3, 0xa5a5ff00
     74    ball    a2, a3, 1f
     75    test_fail
     761:
     77    movi    a2, 0xa5a5a5a5
     78    ball    a2, a3, 1f
     79    j       2f
     801:
     81    test_fail
     822:
     83test_end
     84
     85test bbc
     86    movi    a2, 0xfffffffd
     87#undef BIT
     88#if XCHAL_HAVE_BE
     89#define BIT 0xfffffffe
     90#else
     91#define BIT 0xffffff01
     92#endif
     93    movi    a3, BIT
     94    bbc     a2, a3, 1f
     95    test_fail
     961:
     97    movi    a2, 8
     98#undef BIT
     99#if XCHAL_HAVE_BE
    100#define BIT 0xfffffffc
    101#else
    102#define BIT 0xffffff03
    103#endif
    104    movi    a3, BIT
    105    bbc     a2, a3, 1f
    106    j       2f
    1071:
    108    test_fail
    1092:
    110test_end
    111
    112test bbci
    113    movi    a2, 0xfffdffff
    114    bbci.l  a2, 17, 1f
    115    test_fail
    1161:
    117    movi    a2, 0x00020000
    118    bbci.l  a2, 17, 1f
    119    j       2f
    1201:
    121    test_fail
    1222:
    123test_end
    124
    125test bany
    126    movi    a2, 0xa5a5ff01
    127    movi    a3, 0x5a5a00ff
    128    bany    a2, a3, 1f
    129    test_fail
    1301:
    131    movi    a2, 0xa5a5ff00
    132    bany    a2, a3, 1f
    133    j       2f
    1341:
    135    test_fail
    1362:
    137test_end
    138
    139test bne
    140    movi    a2, 1
    141    movi    a3, 0
    142    bne     a2, a3, 1f
    143    test_fail
    1441:
    145    movi    a2, 0
    146    bne     a2, a3, 1f
    147    j       2f
    1481:
    149    test_fail
    1502:
    151test_end
    152
    153test bge
    154    movi    a2, 7
    155    movi    a3, 7
    156    bge     a2, a3, 1f
    157    test_fail
    1581:
    159    movi    a2, 6
    160    bge     a2, a3, 1f
    161    j       2f
    1621:
    163    test_fail
    1642:
    165    movi    a2, 0xffffffff
    166    bge     a2, a3, 1f
    167    j       2f
    1681:
    169    test_fail
    1702:
    171test_end
    172
    173test bgeu
    174    movi    a2, 7
    175    movi    a3, 7
    176    bgeu    a2, a3, 1f
    177    test_fail
    1781:
    179    movi    a2, 0xffffffff
    180    bgeu    a2, a3, 1f
    181    test_fail
    1821:
    183    movi    a2, 6
    184    bgeu    a2, a3, 1f
    185    j       2f
    1861:
    187    test_fail
    1882:
    189test_end
    190
    191test bnall
    192    movi    a2, 0xa5a5a5a5
    193    movi    a3, 0xa5a5ff00
    194    bnall   a2, a3, 1f
    195    test_fail
    1961:
    197    movi    a2, 0xa5a5ffa5
    198    bnall   a2, a3, 1f
    199    j       2f
    2001:
    201    test_fail
    2022:
    203test_end
    204
    205test bbs
    206    movi    a2, 8
    207#undef BIT
    208#if XCHAL_HAVE_BE
    209#define BIT 0xfffffffc
    210#else
    211#define BIT 0xffffff03
    212#endif
    213    movi    a3, BIT
    214    bbs     a2, a3, 1f
    215    test_fail
    2161:
    217    movi    a2, 0xfffffffd
    218#undef BIT
    219#if XCHAL_HAVE_BE
    220#define BIT 0xfffffffe
    221#else
    222#define BIT 0xffffff01
    223#endif
    224    movi    a3, BIT
    225    bbs     a2, a3, 1f
    226    j       2f
    2271:
    228    test_fail
    2292:
    230test_end
    231
    232test bbsi
    233    movi    a2, 0x00020000
    234    bbsi.l  a2, 17, 1f
    235    test_fail
    2361:
    237    movi    a2, 0xfffdffff
    238    bbsi.l  a2, 17, 1f
    239    j       2f
    2401:
    241    test_fail
    2422:
    243test_end
    244
    245test_suite_end