use values inside of the loop as soon as we have them.

This commit is contained in:
Julia Longtin 2024-05-10 19:33:58 +00:00
parent 21a1e740c2
commit 806472787d

View file

@ -67,10 +67,12 @@ inline static void GGML_F32x16_VEC_FMA(const float32x16_t *mvec1, const float32x
"vmovaps\t\t(%%r12),\t%%zmm2\n\t" "vmovaps\t\t(%%r12),\t%%zmm2\n\t"
"vprefetchnta\t192(%%r10)\n\t" // prefetch the next float32x16_t block (192 bytes ahead) "vprefetchnta\t192(%%r10)\n\t" // prefetch the next float32x16_t block (192 bytes ahead)
"vprefetchnta\t192(%%r12)\n\t" "vprefetchnta\t192(%%r12)\n\t"
"vfmadd231ps\t%%zmm1,\t%%zmm2,\t%%zmm0\n\t" // Perform a fused multiply add
"vmovaps\t\t64(%%r10),\t%%zmm3\n\t" // Load two vectors. "vmovaps\t\t64(%%r10),\t%%zmm3\n\t" // Load two vectors.
"vmovaps\t\t64(%%r12),\t%%zmm4\n\t" "vmovaps\t\t64(%%r12),\t%%zmm4\n\t"
"vprefetch1\t320(%%r10)\n\t" // prefetch the block after the block after the next float32x16_t block (320 bytes ahead) "vprefetch1\t320(%%r10)\n\t" // prefetch the block after the block after the next float32x16_t block (320 bytes ahead)
"vprefetch1\t320(%%r12)\n\t" "vprefetch1\t320(%%r12)\n\t"
"vfmadd231ps\t%%zmm3,\t%%zmm4,\t%%zmm0\n\t" // Perform a fused multiply add
"vmovaps\t\t128(%%r10),\t%%zmm5\n\t" // Load two vectors. "vmovaps\t\t128(%%r10),\t%%zmm5\n\t" // Load two vectors.
"vmovaps\t\t128(%%r12),\t%%zmm6\n\t" "vmovaps\t\t128(%%r12),\t%%zmm6\n\t"
"vprefetch1\t576(%%r10)\n\t" "vprefetch1\t576(%%r10)\n\t"
@ -79,8 +81,6 @@ inline static void GGML_F32x16_VEC_FMA(const float32x16_t *mvec1, const float32x
"vprefetch1\t704(%%r12)\n\t" "vprefetch1\t704(%%r12)\n\t"
"add\t$192,\t%%r10\n\t" // Move to the next float32x16_t block (192 bytes ahead) "add\t$192,\t%%r10\n\t" // Move to the next float32x16_t block (192 bytes ahead)
"add\t$192,\t%%r12\n\t" "add\t$192,\t%%r12\n\t"
"vfmadd231ps\t%%zmm1,\t%%zmm2,\t%%zmm0\n\t" // Perform a fused multiply add
"vfmadd231ps\t%%zmm3,\t%%zmm4,\t%%zmm0\n\t" // Perform a fused multiply add
"vfmadd231ps\t%%zmm5,\t%%zmm6,\t%%zmm0\n\t" // Perform a fused multiply add "vfmadd231ps\t%%zmm5,\t%%zmm6,\t%%zmm0\n\t" // Perform a fused multiply add
"cmp\t$3,\t%%r8\n\t" // Compare iterations to three. "cmp\t$3,\t%%r8\n\t" // Compare iterations to three.
"jge\t1b\n\t" // If there still three or more iterations left, loop. "jge\t1b\n\t" // If there still three or more iterations left, loop.