Skip to content

Commit

Permalink
feat: Merge PolyEvaluator and FourierEvaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
sp301415 committed Sep 6, 2024
1 parent 07ac4e5 commit 7f4e619
Show file tree
Hide file tree
Showing 31 changed files with 981 additions and 1,064 deletions.
11 changes: 0 additions & 11 deletions math/poly/asm_vec_cmplx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@

package poly

import (
"math"
)

// roundCmplxAssign computes vOut = round(v0).
func roundCmplxAssign(v0, vOut []float64) {
for i := range vOut {
vOut[i] = math.Round(v0[i])
}
}

// addCmplxAssign computes vOut = v0 + v1.
func addCmplxAssign(v0, v1, vOut []float64) {
for i := range vOut {
Expand Down
16 changes: 0 additions & 16 deletions math/poly/asm_vec_cmplx_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,9 @@
package poly

import (
"math"

"golang.org/x/sys/cpu"
)

func roundCmplxAssignAVX2(v0, vOut []float64)

// roundCmplxAssign computes vOut = round(v0).
func roundCmplxAssign(v0, vOut []float64) {
if cpu.X86.HasAVX2 {
roundCmplxAssignAVX2(v0, vOut)
return
}

for i := range vOut {
vOut[i] = math.Round(v0[i])
}
}

func addCmplxAssignAVX2(v0, v1, vOut []float64)

// addCmplxAssign computes vOut = v0 + v1.
Expand Down
24 changes: 0 additions & 24 deletions math/poly/asm_vec_cmplx_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,6 @@

#include "textflag.h"

TEXT ·roundCmplxAssignAVX2(SB), NOSPLIT, $0-48
MOVQ v0_base+0(FP), AX
MOVQ vOut_base+24(FP), CX

MOVQ vOut_len+32(FP), DX

XORQ SI, SI
JMP loop_end

loop_body:
VMOVUPD (AX)(SI*8), Y0

VROUNDPD $0, Y0, Y0

VMOVUPD Y0, (CX)(SI*8)

ADDQ $4, SI

loop_end:
CMPQ SI, DX
JL loop_body

RET

TEXT ·addCmplxAssignAVX2(SB), NOSPLIT, $0-72
MOVQ v0_base+0(FP), AX
MOVQ v1_base+24(FP), BX
Expand Down
197 changes: 0 additions & 197 deletions math/poly/fourier_evaluator.go

This file was deleted.

Loading

0 comments on commit 7f4e619

Please sign in to comment.