in x86, there is no int multiply, so implement it naive
| 517 | } |
| 518 | //! in x86, there is no int multiply, so implement it naive |
| 519 | GI_FORCEINLINE |
| 520 | GI_INT8_t GiMultiplyInt8(GI_INT8_t Vector1, GI_INT8_t Vector2) { |
| 521 | #if defined(GI_NEON_INTRINSICS) |
| 522 | return vmulq_s8(Vector1, Vector2); |
| 523 | #elif defined(GI_SSE2_INTRINSICS) |
| 524 | int8_t v1[16], v2[16], res[16]; |
| 525 | _mm_storeu_si128((__m128i*)v1, Vector1); |
| 526 | _mm_storeu_si128((__m128i*)v2, Vector2); |
| 527 | for (size_t id = 0; id < 16; id++) { |
| 528 | res[id] = v1[id] * v2[id]; |
| 529 | } |
| 530 | return _mm_loadu_si128((__m128i*)res); |
| 531 | #elif defined(GI_RVV_INTRINSICS) |
| 532 | return vmul_vv_i8m1(Vector1, Vector2, GI_SIMD_LEN_BYTE / sizeof(int8_t)); |
| 533 | #else |
| 534 | return Vector1 * Vector2; |
| 535 | #endif |
| 536 | } |
| 537 | |
| 538 | GI_FORCEINLINE |
| 539 | GI_INT32_t GiMultiplyAddInt32( |