@@ -1576,11 +1576,11 @@ do { \
1576
1576
1577
1577
// F16 arithmetic is not supported by AVX, so we use F32 instead
1578
1578
1579
- #define GGML_F32Cx8 __m256
1579
+ #define GGML_F32Cx8 __m256
1580
1580
#define GGML_F32Cx8_ZERO (__m256)__lasx_xvldi(0)
1581
1581
#define GGML_F32Cx8_SET1(x) (__m256)__lasx_xvreplgr2vr_w((x))
1582
1582
1583
- static inline __m256 __lasx_f32cx8_load(const ggml_fp16_t *x) {
1583
+ static inline __m256 __lasx_f32cx8_load(const ggml_fp16_t * x) {
1584
1584
float tmp[8];
1585
1585
1586
1586
for (int i = 0; i < 8; i++) {
@@ -1589,13 +1589,14 @@ static inline __m256 __lasx_f32cx8_load(const ggml_fp16_t *x) {
1589
1589
1590
1590
return (__m256)__lasx_xvld(tmp, 0);
1591
1591
}
1592
- static inline void __lasx_f32cx8_store(ggml_fp16_t *x, __m256 y) {
1592
+ static inline void __lasx_f32cx8_store(ggml_fp16_t * x, __m256 y) {
1593
1593
float arr[8];
1594
1594
1595
1595
__lasx_xvst(y, arr, 0);
1596
1596
1597
- for (int i = 0; i < 8; i++)
1597
+ for (int i = 0; i < 8; i++) {
1598
1598
x[i] = GGML_FP32_TO_FP16(arr[i]);
1599
+ }
1599
1600
}
1600
1601
#define GGML_F32Cx8_LOAD(x) __lasx_f32cx8_load(x)
1601
1602
#define GGML_F32Cx8_STORE(x, y) __lasx_f32cx8_store(x, y)
@@ -1671,7 +1672,7 @@ static inline void __lasx_f32cx8_store(ggml_fp16_t *x, __m256 y) {
1671
1672
#define GGML_F16_STEP 32
1672
1673
#define GGML_F16_EPR 4
1673
1674
1674
- static inline __m128 __lsx_f16x4_load(ggml_fp16_t *x) {
1675
+ static inline __m128 __lsx_f16x4_load(const ggml_fp16_t * x) {
1675
1676
float tmp[4];
1676
1677
1677
1678
tmp[0] = GGML_FP16_TO_FP32(x[0]);
@@ -1682,7 +1683,7 @@ static inline __m128 __lsx_f16x4_load(ggml_fp16_t *x) {
1682
1683
return __lsx_vld(tmp, 0);
1683
1684
}
1684
1685
1685
- static inline void __lsx_f16x4_store(ggml_fp16_t *x, __m128 y) {
1686
+ static inline void __lsx_f16x4_store(ggml_fp16_t * x, __m128 y) {
1686
1687
float arr[4];
1687
1688
1688
1689
__lsx_vst(y, arr, 0);
0 commit comments