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_subu_qb.c (441B)


      1#include<stdio.h>
      2#include<assert.h>
      3
      4int main()
      5{
      6    int rd, rs, rt, dsp;
      7    int result, resultdsp;
      8
      9    rs = 0x12345678;
     10    rt = 0x87654321;
     11    result    = 0x8BCF1357;
     12    resultdsp = 0x01;
     13
     14    __asm
     15        ("subu.qb %0, %2, %3\n\t"
     16         "rddsp   %1\n\t"
     17         : "=r"(rd), "=r"(dsp)
     18         : "r"(rs), "r"(rt)
     19        );
     20    dsp = (dsp >> 20) & 0x01;
     21    assert(dsp == resultdsp);
     22    assert(rd  == result);
     23
     24    return 0;
     25}