Exemplo n.º 1
0
        public static void dsfmt_gen_rand_all(dSfmtPrimitiveState dsfmt)
        {
            int       i;
            FloatW128 lung = new FloatW128();

            lung = dsfmt.status[DSFMT_N];


            do_recursion(ref dsfmt.status[0], ref dsfmt.status[0],
                         ref dsfmt.status[DSFMT_POS1], ref lung);


            for (i = 1; i < DSFMT_N - DSFMT_POS1; i++)
            {
                do_recursion(ref dsfmt.status[i], ref dsfmt.status[i],
                             ref dsfmt.status[i + DSFMT_POS1], ref lung);
            }

            for (; i < DSFMT_N; i++)
            {
                do_recursion(ref dsfmt.status[i], ref dsfmt.status[i],
                             ref dsfmt.status[i + DSFMT_POS1 - DSFMT_N], ref lung);
            }


            dsfmt.status[DSFMT_N] = lung;
        }
Exemplo n.º 2
0
        static void do_recursion(ref FloatW128 r, ref FloatW128 a, ref FloatW128 b, ref FloatW128 u)
        {
            Vector128 <int> v, w, x, y, z;

            x    = a.si;
            z    = Sse2.ShiftLeftLogical(x.AsInt64(), DSFMT_SL1).AsInt32();
            y    = Sse2.Shuffle(u.si, SSE2_SHUFF);
            z    = Sse2.Xor(z, b.si);
            y    = Sse2.Xor(y, z);
            v    = Sse2.ShiftRightLogical(y.AsUInt64(), DSFMT_SR).AsInt32();
            w    = Sse2.And(y, sse2_param_mask.i128);
            v    = Sse2.Xor(v, x);
            v    = Sse2.Xor(v, w);
            r.si = v;
            u.si = y;
        }