File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ import ../util/bar
10
10
import ../ resampler
11
11
12
12
# Enable project wide
13
- {.passC: " -fno-signaling-nans -fno-math-errno -fno-trapping-math -freciprocal-math" .}
13
+ when defined(macosx):
14
+ # Apply fast-math for clang: see https://simonbyrne.github.io/notes/fastmath/
15
+ {.passC: " -ffast-math" .}
16
+ else :
17
+ {.passC: " -fno-signaling-nans -fno-math-errno -fno-trapping-math -freciprocal-math" .}
14
18
{.passL: " -flto" .}
15
19
16
20
type
@@ -116,10 +120,6 @@ proc readChunk(iter: AudioIterator): float32 =
116
120
117
121
var maxAbs: float32 = 0.0
118
122
119
- # Apply fast-math locally: see https://simonbyrne.github.io/notes/fastmath/
120
- {.push optimization: speed.}
121
- {.passC: " -ffast-math" .}
122
-
123
123
# SIMD-style loop (unrolled)
124
124
for i in countup(0 , simdSamples - 1 , simdWidth):
125
125
let v0 = abs(samples[i])
@@ -133,8 +133,6 @@ proc readChunk(iter: AudioIterator): float32 =
133
133
for i in simdSamples ..< totalSamples:
134
134
maxAbs = max(maxAbs, abs(samples[i]))
135
135
136
- {.pop.}
137
-
138
136
return maxAbs
139
137
140
138
proc flushResampler(iter: AudioIterator) =
You can’t perform that action at this time.
0 commit comments