qemu

FORK: QEMU emulator
git clone https://git.neptards.moe/neptards/qemu.git
Log | Files | Refs | Submodules | LICENSE

test_fcsr.c (279B)


      1 #include <assert.h>
      2 
      3 int main()
      4 {
      5     unsigned fcsr;
      6 
      7     asm("movgr2fcsr $r0,$r0\n\t"
      8         "movgr2fr.d $f0,$r0\n\t"
      9         "fdiv.d     $f0,$f0,$f0\n\t"
     10         "movfcsr2gr %0,$r0"
     11         : "=r"(fcsr) : : "f0");
     12 
     13     assert(fcsr & (16 << 16)); /* Invalid */
     14     return 0;
     15 }