• Michael Ellerman's avatar
    selftests/powerpc: Generate better bit patterns for FPU tests · 2ba107f6
    Michael Ellerman authored
    The fpu_preempt test randomly initialises an array of doubles to try and
    detect FPU register corruption.
    
    However the values it generates do not occupy the full range of values
    possible in the 64-bit double, meaning some partial register corruption
    could go undetected.
    
    Without getting too carried away, add some better initialisation to
    generate values that occupy more bits.
    
    Sample values before:
    
      f0             902677510               (raw 0x41cae6e203000000)
      f1             325217596               (raw 0x41b3626d3c000000)
      f2             1856578300              (raw 0x41dbaa48bf000000)
      f3             1247189984              (raw 0x41d295a6f8000000)
    
    And after:
    
      f0             1.1078153481413311e-09  (raw 0x3e13083932805cc2)
      f1             1.0576648474801922e+17  (raw 0x43777c20eb88c261)
      f2             -6.6245033413594075e-10 (raw 0xbe06c2f989facae9)
      f3             3.0085988827156291e+18  (raw 0x43c4e0585f2df37b)
    Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
    Link: https://msgid.link/20231128132748.1990179-3-mpe@ellerman.id.au
    2ba107f6
fpu.h 451 Bytes