2 Replies Latest reply: Mar 27, 2014 3:55 PM by user12615116 RSS

    _rdrand32_step still broken (Solaris Studio 12.4 Beta)

    RaiderOfTheLostSparc

      Hi,

       

      seems like _rdrand32_step is still broken:

       

      #include <sys/immintrin.h>
      #include <assert.h>
      #include <stdio.h>
      #include <unistd.h>
      int
      main(void)
      {
          unsigned short rnd16;
          unsigned int rnd32;
          unsigned long long rnd64;
          for (int i = 0; i < 10; i++) {
              _rdrand16_step(&rnd16);
              printf("%6u\t", rnd16);
              _rdrand32_step(&rnd32);
              printf("%12u\t", rnd32);
              _rdrand64_step(&rnd64);
              printf("%20llu\n", rnd64);
          }
          return 0;
      }
      

       

      Output:

       

      sk@solarized:/tmp $ cc -V

      cc: Sun C 5.13 SunOS_i386 Beta 2014/03/11

      sk@solarized:/tmp $ cc -m64 -O -xarch=avx_i rdrand.c

      sk@solarized:/tmp $ ./a.out

      12006            10    11966608944122748592

      50043            10    15401784444587912477

      45587            10    12333676698644534672

         353            10     8738768282242589182

      62579            10    14938211721136048687

      19951            10    16895153433422027545

        3594            10    17238899631342279824

      13844            10     4983849540809928130

      63383            10     5628099703703756528

      39414            10     3993283163551073983