Skip to content

Commit dc933fc

Browse files
committed
ggml : minor formatting
1 parent f9968a5 commit dc933fc

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

ggml.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,8 +1156,8 @@ static void dequantize_row_q4_0(const block_q4_0 * restrict x, float * restrict
11561156
const float d = x[i].d;
11571157

11581158
for (int j = 0; j < qk/2; ++j) {
1159-
const int x0 = (x[i].qs[j] & 0xf) - 8;
1160-
const int x1 = (x[i].qs[j] >> 4) - 8;
1159+
const int x0 = (x[i].qs[j] & 0x0F) - 8;
1160+
const int x1 = (x[i].qs[j] >> 4) - 8;
11611161

11621162
y[i*qk + j + 0 ] = x0*d;
11631163
y[i*qk + j + qk/2] = x1*d;
@@ -1177,8 +1177,8 @@ static void dequantize_row_q4_1(const block_q4_1 * restrict x, float * restrict
11771177
const float m = x[i].m;
11781178

11791179
for (int j = 0; j < qk/2; ++j) {
1180-
const int x0 = (x[i].qs[j] & 0xf);
1181-
const int x1 = (x[i].qs[j] >> 4);
1180+
const int x0 = (x[i].qs[j] & 0x0F);
1181+
const int x1 = (x[i].qs[j] >> 4);
11821182

11831183
y[i*qk + j + 0 ] = x0*d + m;
11841184
y[i*qk + j + qk/2] = x1*d + m;
@@ -1203,8 +1203,8 @@ static void dequantize_row_q5_0(const block_q5_0 * restrict x, float * restrict
12031203
const uint8_t xh_0 = ((qh & (1u << (j + 0 ))) >> (j + 0 )) << 4;
12041204
const uint8_t xh_1 = ((qh & (1u << (j + 16))) >> (j + 12));
12051205

1206-
const int32_t x0 = ((x[i].qs[j] & 0xf) | xh_0) - 16;
1207-
const int32_t x1 = ((x[i].qs[j] >> 4) | xh_1) - 16;
1206+
const int32_t x0 = ((x[i].qs[j] & 0x0F) | xh_0) - 16;
1207+
const int32_t x1 = ((x[i].qs[j] >> 4) | xh_1) - 16;
12081208

12091209
y[i*qk + j + 0 ] = x0*d;
12101210
y[i*qk + j + qk/2] = x1*d;
@@ -1230,8 +1230,8 @@ static void dequantize_row_q5_1(const block_q5_1 * restrict x, float * restrict
12301230
const uint8_t xh_0 = ((qh & (1u << (j + 0 ))) >> (j + 0 )) << 4;
12311231
const uint8_t xh_1 = ((qh & (1u << (j + 16))) >> (j + 12));
12321232

1233-
const int x0 = (x[i].qs[j] & 0xf) | xh_0;
1234-
const int x1 = (x[i].qs[j] >> 4) | xh_1;
1233+
const int x0 = (x[i].qs[j] & 0x0F) | xh_0;
1234+
const int x1 = (x[i].qs[j] >> 4) | xh_1;
12351235

12361236
y[i*qk + j + 0 ] = x0*d + m;
12371237
y[i*qk + j + qk/2] = x1*d + m;
@@ -2057,8 +2057,8 @@ static void ggml_vec_dot_q4_0_q8_0(const int n, float * restrict s, const void *
20572057
int sumi = 0;
20582058

20592059
for (int j = 0; j < qk/2; ++j) {
2060-
const int v0 = (x[i].qs[j] & 0xf) - 8;
2061-
const int v1 = (x[i].qs[j] >> 4) - 8;
2060+
const int v0 = (x[i].qs[j] & 0x0F) - 8;
2061+
const int v1 = (x[i].qs[j] >> 4) - 8;
20622062

20632063
sumi += (v0 * y[i].qs[j]) + (v1 * y[i].qs[j + qk/2]);
20642064
}
@@ -2179,8 +2179,8 @@ static void ggml_vec_dot_q4_1_q8_1(const int n, float * restrict s, const void *
21792179
int sumi = 0;
21802180

21812181
for (int j = 0; j < qk/2; ++j) {
2182-
const int v0 = (x[i].qs[j] & 0xf);
2183-
const int v1 = (x[i].qs[j] >> 4);
2182+
const int v0 = (x[i].qs[j] & 0x0F);
2183+
const int v1 = (x[i].qs[j] >> 4);
21842184

21852185
sumi += (v0 * y[i].qs[j]) + (v1 * y[i].qs[j + qk/2]);
21862186
}
@@ -2360,8 +2360,8 @@ static void ggml_vec_dot_q5_0_q8_0(const int n, float * restrict s, const void *
23602360
const uint8_t xh_0 = ((qh & (1u << (j + 0 ))) >> (j + 0 )) << 4;
23612361
const uint8_t xh_1 = ((qh & (1u << (j + 16))) >> (j + 12));
23622362

2363-
const int32_t x0 = ((x[i].qs[j] & 0xf) | xh_0) - 16;
2364-
const int32_t x1 = ((x[i].qs[j] >> 4) | xh_1) - 16;
2363+
const int32_t x0 = ((x[i].qs[j] & 0x0F) | xh_0) - 16;
2364+
const int32_t x1 = ((x[i].qs[j] >> 4) | xh_1) - 16;
23652365

23662366
sumi += (x0 * y[i].qs[j]) + (x1 * y[i].qs[j + qk/2]);
23672367
}

0 commit comments

Comments
 (0)