@@ -1911,8 +1911,8 @@ static void dequantize_row_q5_0(const void * restrict vx, float * restrict y, in
1911
1911
const uint8_t vi = pp [l /2 ];
1912
1912
1913
1913
// extract the 5-th bit from qh
1914
- const uint8_t vh0 = ((qh & (1 << (l + 0 ))) >> (l + 0 )) << 4 ;
1915
- const uint8_t vh1 = ((qh & (1 << (l + 1 ))) >> (l + 1 )) << 4 ;
1914
+ const uint8_t vh0 = ((qh & (1u << (l + 0 ))) >> (l + 0 )) << 4 ;
1915
+ const uint8_t vh1 = ((qh & (1u << (l + 1 ))) >> (l + 1 )) << 4 ;
1916
1916
1917
1917
const int8_t vi0 = (vi & 0x0F ) | vh0 ;
1918
1918
const int8_t vi1 = (vi >> 4 ) | vh1 ;
@@ -1948,8 +1948,8 @@ static void dequantize_row_q5_1(const void * restrict vx, float * restrict y, in
1948
1948
const uint8_t vi = pp [l /2 ];
1949
1949
1950
1950
// extract the 5-th bit from qh
1951
- const uint8_t vh0 = ((qh & (1 << (l + 0 ))) >> (l + 0 )) << 4 ;
1952
- const uint8_t vh1 = ((qh & (1 << (l + 1 ))) >> (l + 1 )) << 4 ;
1951
+ const uint8_t vh0 = ((qh & (1u << (l + 0 ))) >> (l + 0 )) << 4 ;
1952
+ const uint8_t vh1 = ((qh & (1u << (l + 1 ))) >> (l + 1 )) << 4 ;
1953
1953
1954
1954
const uint8_t vi0 = (vi & 0x0F ) | vh0 ;
1955
1955
const uint8_t vi1 = (vi >> 4 ) | vh1 ;
@@ -3286,8 +3286,8 @@ static void ggml_vec_dot_q5_0_q8_0(const int n, float * restrict s, const void *
3286
3286
for (int j = 0 ; j < QK8_0 /2 ; j ++ ) {
3287
3287
const uint8_t v0 = x0 [j ];
3288
3288
3289
- const int x0_0h = ((qh & (1 << (2 * j + 0 ))) >> (2 * j + 0 )) << 4 ;
3290
- const int x1_0h = ((qh & (1 << (2 * j + 1 ))) >> (2 * j + 1 )) << 4 ;
3289
+ const int x0_0h = ((qh & (1u << (2 * j + 0 ))) >> (2 * j + 0 )) << 4 ;
3290
+ const int x1_0h = ((qh & (1u << (2 * j + 1 ))) >> (2 * j + 1 )) << 4 ;
3291
3291
3292
3292
const int x0_0 = ((v0 & 0x0F ) | x0_0h ) - 16 ;
3293
3293
const int x1_0 = ((v0 >> 4 ) | x1_0h ) - 16 ;
@@ -3491,8 +3491,8 @@ static void ggml_vec_dot_q5_1_q8_1(const int n, float * restrict s, const void *
3491
3491
for (int j = 0 ; j < QK8_1 /2 ; j ++ ) {
3492
3492
const uint8_t v0 = x0 [j ];
3493
3493
3494
- const int x0_0h = ((qh & (1 << (2 * j + 0 ))) >> (2 * j + 0 )) << 4 ;
3495
- const int x1_0h = ((qh & (1 << (2 * j + 1 ))) >> (2 * j + 1 )) << 4 ;
3494
+ const int x0_0h = ((qh & (1u << (2 * j + 0 ))) >> (2 * j + 0 )) << 4 ;
3495
+ const int x1_0h = ((qh & (1u << (2 * j + 1 ))) >> (2 * j + 1 )) << 4 ;
3496
3496
3497
3497
const int x0_0 = (v0 & 0x0F ) | x0_0h ;
3498
3498
const int x1_0 = (v0 >> 4 ) | x1_0h ;
@@ -13057,8 +13057,8 @@ size_t ggml_quantize_q5_0(const float * src, void * dst, int n, int k, int64_t *
13057
13057
memcpy (& qh , & y [i ].qh , sizeof (qh ));
13058
13058
13059
13059
for (int l = 0 ; l < QK5_0 ; l += 2 ) {
13060
- const uint8_t vh0 = ((qh & (1 << (l + 0 ))) >> (l + 0 )) << 4 ;
13061
- const uint8_t vh1 = ((qh & (1 << (l + 1 ))) >> (l + 1 )) << 4 ;
13060
+ const uint8_t vh0 = ((qh & (1u << (l + 0 ))) >> (l + 0 )) << 4 ;
13061
+ const uint8_t vh1 = ((qh & (1u << (l + 1 ))) >> (l + 1 )) << 4 ;
13062
13062
13063
13063
// cast to 16 bins
13064
13064
const uint8_t vi0 = ((y [i ].qs [l /2 ] & 0x0F ) | vh0 ) / 2 ;
@@ -13087,8 +13087,8 @@ size_t ggml_quantize_q5_1(const float * src, void * dst, int n, int k, int64_t *
13087
13087
memcpy (& qh , & y [i ].qh , sizeof (qh ));
13088
13088
13089
13089
for (int l = 0 ; l < QK5_1 ; l += 2 ) {
13090
- const uint8_t vh0 = ((qh & (1 << (l + 0 ))) >> (l + 0 )) << 4 ;
13091
- const uint8_t vh1 = ((qh & (1 << (l + 1 ))) >> (l + 1 )) << 4 ;
13090
+ const uint8_t vh0 = ((qh & (1u << (l + 0 ))) >> (l + 0 )) << 4 ;
13091
+ const uint8_t vh1 = ((qh & (1u << (l + 1 ))) >> (l + 1 )) << 4 ;
13092
13092
13093
13093
// cast to 16 bins
13094
13094
const uint8_t vi0 = ((y [i ].qs [l /2 ] & 0x0F ) | vh0 ) / 2 ;
0 commit comments