Skip to content

Commit 80c9798

Browse files
committed
fixup! [libc][math] Optimize nearest integer functions using builtins when available
Nit: sort roundeven after round.
1 parent fddf018 commit 80c9798

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

libc/test/src/math/performance_testing/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,10 +391,10 @@ add_perf_binary(
391391
libc.src.math.floorf16
392392
libc.src.math.rintf
393393
libc.src.math.rintf16
394-
libc.src.math.roundevenf
395-
libc.src.math.roundevenf16
396394
libc.src.math.roundf
397395
libc.src.math.roundf16
396+
libc.src.math.roundevenf
397+
libc.src.math.roundevenf16
398398
libc.src.math.truncf
399399
libc.src.math.truncf16
400400
COMPILE_OPTIONS

libc/test/src/math/performance_testing/nearest_integer_funcs_perf.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,21 +152,21 @@ int main() {
152152
FLOAT16_ROUNDS, "ceilf16_perf.log")
153153
NEAREST_INTEGER_PERF(float16, LIBC_NAMESPACE::floorf16, ::placeholderf16,
154154
FLOAT16_ROUNDS, "floorf16_perf.log")
155-
NEAREST_INTEGER_PERF(float16, LIBC_NAMESPACE::roundevenf16, ::placeholderf16,
156-
FLOAT16_ROUNDS, "roundevenf16_perf.log")
157155
NEAREST_INTEGER_PERF(float16, LIBC_NAMESPACE::roundf16, ::placeholderf16,
158156
FLOAT16_ROUNDS, "roundf16_perf.log")
157+
NEAREST_INTEGER_PERF(float16, LIBC_NAMESPACE::roundevenf16, ::placeholderf16,
158+
FLOAT16_ROUNDS, "roundevenf16_perf.log")
159159
NEAREST_INTEGER_PERF(float16, LIBC_NAMESPACE::truncf16, ::placeholderf16,
160160
FLOAT16_ROUNDS, "truncf16_perf.log")
161161

162162
NEAREST_INTEGER_PERF(float, LIBC_NAMESPACE::ceilf, ::ceilf, FLOAT_ROUNDS,
163163
"ceilf_perf.log")
164164
NEAREST_INTEGER_PERF(float, LIBC_NAMESPACE::floorf, ::floorf, FLOAT_ROUNDS,
165165
"floorf_perf.log")
166-
NEAREST_INTEGER_PERF(float, LIBC_NAMESPACE::roundevenf, ::placeholderf,
167-
FLOAT_ROUNDS, "roundevenf_perf.log")
168166
NEAREST_INTEGER_PERF(float, LIBC_NAMESPACE::roundf, ::roundf, FLOAT_ROUNDS,
169167
"roundf_perf.log")
168+
NEAREST_INTEGER_PERF(float, LIBC_NAMESPACE::roundevenf, ::placeholderf,
169+
FLOAT_ROUNDS, "roundevenf_perf.log")
170170
NEAREST_INTEGER_PERF(float, LIBC_NAMESPACE::truncf, ::truncf, FLOAT_ROUNDS,
171171
"truncf_perf.log")
172172

0 commit comments

Comments
 (0)