2 * Copyright (C) 2013 Andrea Mazzoleni
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
19 * GENz (triple parity with powers of 2^-1) 32bit C implementation
21 void raid_genz_int32(int nd, size_t size, void **vv)
23 uint8_t **v = (uint8_t**)vv;
30 uint32_t d0, r0, q0, p0;
31 uint32_t d1, r1, q1, p1;
38 for (i = 0; i < size; i += 8) {
39 r0 = q0 = p0 = v_32(v[l][i]);
40 r1 = q1 = p1 = v_32(v[l][i + 4]);
41 for (d = l - 1; d >= 0; --d) {
43 d1 = v_32(v[d][i + 4]);
70 * GENz (triple parity with powers of 2^-1) 64bit C implementation
72 void raid_genz_int64(int nd, size_t size, void **vv)
74 uint8_t **v = (uint8_t**)vv;
81 uint64_t d0, r0, q0, p0;
82 uint64_t d1, r1, q1, p1;
89 for (i = 0; i < size; i += 16) {
90 r0 = q0 = p0 = v_64(v[l][i]);
91 r1 = q1 = p1 = v_64(v[l][i + 8]);
92 for (d = l - 1; d >= 0; --d) {
94 d1 = v_64(v[d][i + 8]);