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_mult.c (451B)


      1#include<stdio.h>
      2#include<assert.h>
      3
      4int main()
      5{
      6    int rs, rt, ach, acl;
      7    int result, resulth, resultl;
      8
      9    rs  = 0x00FFBBAA;
     10    rt  = 0x4B231000;
     11    resulth = 0x4b0f01;
     12    resultl = 0x71f8a000;
     13    __asm
     14        ("mult $ac1, %2, %3\n\t"
     15         "mfhi %0, $ac1\n\t"
     16         "mflo %1, $ac1\n\t"
     17         : "=r"(ach), "=r"(acl)
     18         : "r"(rs), "r"(rt)
     19        );
     20    assert(ach == resulth);
     21    assert(acl == resultl);
     22
     23    return 0;
     24}