12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #include <linux/raid/pq.h>
- # define NBYTES(x) (__insn_v1addi(0, x))
- # define NSIZE 8
- static inline __attribute_const__ u64 SHLBYTE(u64 v)
- {
-
- return __insn_v1shli(v, 1);
- }
- static inline __attribute_const__ u64 MASK(u64 v)
- {
-
- return __insn_v1shrsi(v, 7);
- }
- void raid6_tilegx$#_gen_syndrome(int disks, size_t bytes, void **ptrs)
- {
- u8 **dptr = (u8 **)ptrs;
- u64 *p, *q;
- int d, z, z0;
- u64 wd$$, wq$$, wp$$, w1$$, w2$$;
- u64 x1d = NBYTES(0x1d);
- u64 * z0ptr;
- z0 = disks - 3;
- p = (u64 *)dptr[z0+1];
- q = (u64 *)dptr[z0+2];
- z0ptr = (u64 *)&dptr[z0][0];
- for ( d = 0 ; d < bytes ; d += NSIZE*$# ) {
- wq$$ = wp$$ = *z0ptr++;
- for ( z = z0-1 ; z >= 0 ; z-- ) {
- wd$$ = *(u64 *)&dptr[z][d+$$*NSIZE];
- wp$$ = wp$$ ^ wd$$;
- w2$$ = MASK(wq$$);
- w1$$ = SHLBYTE(wq$$);
- w2$$ = w2$$ & x1d;
- w1$$ = w1$$ ^ w2$$;
- wq$$ = w1$$ ^ wd$$;
- }
- *p++ = wp$$;
- *q++ = wq$$;
- }
- }
- const struct raid6_calls raid6_tilegx$# = {
- raid6_tilegx$#_gen_syndrome,
- NULL,
- NULL,
- "tilegx$#",
- 0
- };
|