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_dsp_r1_shrl_qb.c (448B)


      1#include<stdio.h>
      2#include<assert.h>
      3
      4int main()
      5{
      6    int rd, rt;
      7    int result;
      8
      9    rt     = 0x12345678;
     10    result = 0x00010203;
     11
     12    __asm
     13        ("shrl.qb %0, %1, 0x05\n\t"
     14         : "=r"(rd)
     15         : "r"(rt)
     16        );
     17    assert(rd == result);
     18
     19    rt     = 0x12345678;
     20    result = 0x12345678;
     21
     22    __asm
     23        ("shrl.qb %0, %1, 0x0\n\t"
     24         : "=r"(rd)
     25         : "r"(rt)
     26        );
     27
     28    assert(rd == result);
     29
     30    return 0;
     31}