@@ -1567,11 +1567,11 @@ do { \
1567
1567
1568
1568
// F16 arithmetic is not supported by AVX, so we use F32 instead
1569
1569
1570
- #define GGML_F32Cx8 __m256
1570
+ #define GGML_F32Cx8 __m256
1571
1571
#define GGML_F32Cx8_ZERO (__m256)__lasx_xvldi(0)
1572
1572
#define GGML_F32Cx8_SET1(x) (__m256)__lasx_xvreplgr2vr_w((x))
1573
1573
1574
- static inline __m256 __lasx_f32cx8_load(ggml_fp16_t *x) {
1574
+ static inline __m256 __lasx_f32cx8_load(const ggml_fp16_t * x) {
1575
1575
float tmp[8];
1576
1576
1577
1577
for (int i = 0; i < 8; i++) {
@@ -1580,13 +1580,14 @@ static inline __m256 __lasx_f32cx8_load(ggml_fp16_t *x) {
1580
1580
1581
1581
return (__m256)__lasx_xvld(tmp, 0);
1582
1582
}
1583
- static inline void __lasx_f32cx8_store(ggml_fp16_t *x, __m256 y) {
1583
+ static inline void __lasx_f32cx8_store(ggml_fp16_t * x, __m256 y) {
1584
1584
float arr[8];
1585
1585
1586
1586
__lasx_xvst(y, arr, 0);
1587
1587
1588
- for (int i = 0; i < 8; i++)
1588
+ for (int i = 0; i < 8; i++) {
1589
1589
x[i] = GGML_FP32_TO_FP16(arr[i]);
1590
+ }
1590
1591
}
1591
1592
#define GGML_F32Cx8_LOAD(x) __lasx_f32cx8_load(x)
1592
1593
#define GGML_F32Cx8_STORE(x, y) __lasx_f32cx8_store(x, y)
@@ -1662,7 +1663,7 @@ static inline void __lasx_f32cx8_store(ggml_fp16_t *x, __m256 y) {
1662
1663
#define GGML_F16_STEP 32
1663
1664
#define GGML_F16_EPR 4
1664
1665
1665
- static inline __m128 __lsx_f16x4_load(ggml_fp16_t *x) {
1666
+ static inline __m128 __lsx_f16x4_load(const ggml_fp16_t * x) {
1666
1667
float tmp[4];
1667
1668
1668
1669
tmp[0] = GGML_FP16_TO_FP32(x[0]);
@@ -1673,7 +1674,7 @@ static inline __m128 __lsx_f16x4_load(ggml_fp16_t *x) {
1673
1674
return __lsx_vld(tmp, 0);
1674
1675
}
1675
1676
1676
- static inline void __lsx_f16x4_store(ggml_fp16_t *x, __m128 y) {
1677
+ static inline void __lsx_f16x4_store(ggml_fp16_t * x, __m128 y) {
1677
1678
float arr[4];
1678
1679
1679
1680
__lsx_vst(y, arr, 0);
0 commit comments