Пример #1
0
        // TODO: Need to figure out how to implement this with Vector pointers, as these don't seem to be available in .NET standard yet, but maybe in Core?
        static unsafe bool BySimdUnrolled(byte[] data)
        {
            fixed(byte *bytes = data)
            {
                int        len  = data.Length;
                int        rem  = len % (16 * 16);
                Vector16b *b    = (Vector16b *)bytes;
                Vector16b *e    = (Vector16b *)(bytes + len - rem);
                Vector16b  zero = Vector16b.Zero;

                while (b < e)
                {
                    if ((*(b) | *(b + 1) | *(b + 2) | *(b + 3) | *(b + 4) |
                         *(b + 5) | *(b + 6) | *(b + 7) | *(b + 8) |
                         *(b + 9) | *(b + 10) | *(b + 11) | *(b + 12) |
                         *(b + 13) | *(b + 14) | *(b + 15)) != zero)
                    {
                        return(false);
                    }
                    b += 16;
                }

                for (int i = 0; i < rem; i++)
                {
                    if (data[len - 1 - i] != 0)
                    {
                        return(false);
                    }
                }

                return(true);
            }
        }
Пример #2
0
 public static unsafe void PrefetchNonTemporal(Vector16b *res)
 {
 }
Пример #3
0
 public static unsafe void PrefetchTemporal2ndLevelCache(Vector16b *res)
 {
 }
Пример #4
0
 public static unsafe void PrefetchTemporalAllCacheLevels(Vector16b *res)
 {
 }
Пример #5
0
 public static unsafe void StoreAligned(Vector16b *res, Vector16b val)
 {
     *res = val;
 }
Пример #6
0
 public static unsafe Vector16b LoadAligned(Vector16b *v)
 {
     return(*v);
 }