Skip to content

Commit 3cee637

Browse files
committed
Also run bench functions in release
1 parent 175b45d commit 3cee637

11 files changed

+87
-89
lines changed

ci/run.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ else
2626
run="cargo test --manifest-path testcrate/Cargo.toml --no-fail-fast --target $target"
2727
$run
2828
$run --release
29-
$run --benches
3029
$run --features c
3130
$run --features c --release
3231
$run --features no-asm
3332
$run --features no-asm --release
3433
$run --features no-f16-f128
3534
$run --features no-f16-f128 --release
35+
$run --benches
36+
$run --benches --release
3637
fi
3738

3839
if [ "${TEST_VERBATIM:-}" = "1" ]; then

testcrate/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ default-features = false
2222
features = ["public-test-deps"]
2323

2424
[dev-dependencies]
25-
criterion = { version = "0.5.1", default-features = false }
25+
criterion = { version = "0.5.1", default-features = false, features = ["cargo_bench_support"] }
2626
paste = "1.0.15"
2727

2828
[target.'cfg(all(target_arch = "arm", not(any(target_env = "gnu", target_env = "musl")), target_os = "linux"))'.dev-dependencies]

testcrate/benches/float_add.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ float_bench! {
1616
"addss {a}, {b}",
1717
a = inout(xmm_reg) a,
1818
b = in(xmm_reg) b,
19-
options(nomem, nostack)
19+
options(nomem, nostack, pure)
2020
);
2121

2222
a
@@ -27,7 +27,7 @@ float_bench! {
2727
"fadd {a:s}, {a:s}, {b:s}",
2828
a = inout(vreg) a,
2929
b = in(vreg) b,
30-
options(nomem, nostack)
30+
options(nomem, nostack, pure)
3131
);
3232

3333
a
@@ -47,7 +47,7 @@ float_bench! {
4747
"addsd {a}, {b}",
4848
a = inout(xmm_reg) a,
4949
b = in(xmm_reg) b,
50-
options(nomem, nostack)
50+
options(nomem, nostack, pure)
5151
);
5252

5353
a
@@ -58,7 +58,7 @@ float_bench! {
5858
"fadd {a:d}, {a:d}, {b:d}",
5959
a = inout(vreg) a,
6060
b = in(vreg) b,
61-
options(nomem, nostack)
61+
options(nomem, nostack, pure)
6262
);
6363

6464
a

testcrate/benches/float_cmp.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ float_bench! {
3030
a = in(xmm_reg) a,
3131
b = in(xmm_reg) b,
3232
ret = out(reg) ret,
33-
options(nomem, nostack)
33+
options(nomem, nostack, pure)
3434
);
3535

3636
ret
@@ -68,7 +68,7 @@ float_bench! {
6868
a = in(xmm_reg) a,
6969
b = in(xmm_reg) b,
7070
ret = out(reg) ret,
71-
options(nomem, nostack)
71+
options(nomem, nostack, pure)
7272
);
7373

7474
ret
@@ -82,7 +82,7 @@ float_bench! {
8282
a = in(vreg) a,
8383
b = in(vreg) b,
8484
ret = out(reg) ret,
85-
options(nomem, nostack)
85+
options(nomem, nostack, pure)
8686
);
8787

8888
ret
@@ -107,7 +107,7 @@ float_bench! {
107107
a = in(xmm_reg) a,
108108
b = in(xmm_reg) b,
109109
ret = out(reg) ret,
110-
options(nomem, nostack)
110+
options(nomem, nostack, pure)
111111
);
112112

113113
ret
@@ -121,7 +121,7 @@ float_bench! {
121121
a = in(vreg) a,
122122
b = in(vreg) b,
123123
ret = out(reg) ret,
124-
options(nomem, nostack)
124+
options(nomem, nostack, pure)
125125
);
126126

127127
ret
@@ -145,7 +145,7 @@ float_bench! {
145145
a = in(xmm_reg) a,
146146
b = in(xmm_reg) b,
147147
ret = out(reg) ret,
148-
options(nomem, nostack)
148+
options(nomem, nostack, pure)
149149
);
150150

151151
ret
@@ -159,7 +159,7 @@ float_bench! {
159159
a = in(vreg) a,
160160
b = in(vreg) b,
161161
ret = out(reg) ret,
162-
options(nomem, nostack)
162+
options(nomem, nostack, pure)
163163
);
164164

165165
ret

testcrate/benches/float_conv.rs

+22-22
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ float_bench! {
2222
a = in(reg) a,
2323
tmp = out(reg) _,
2424
ret = lateout(xmm_reg) ret,
25-
options(nomem, nostack),
25+
options(nomem, nostack, pure),
2626
);
2727

2828
ret
@@ -34,7 +34,7 @@ float_bench! {
3434
"ucvtf {ret:s}, {a:w}",
3535
a = in(reg) a,
3636
ret = lateout(vreg) ret,
37-
options(nomem, nostack),
37+
options(nomem, nostack, pure),
3838
);
3939

4040
ret
@@ -57,7 +57,7 @@ float_bench! {
5757
a = in(reg) a,
5858
tmp = out(reg) _,
5959
ret = lateout(xmm_reg) ret,
60-
options(nomem, nostack),
60+
options(nomem, nostack, pure),
6161
);
6262

6363
ret
@@ -69,7 +69,7 @@ float_bench! {
6969
"ucvtf {ret:d}, {a:w}",
7070
a = in(reg) a,
7171
ret = lateout(vreg) ret,
72-
options(nomem, nostack),
72+
options(nomem, nostack, pure),
7373
);
7474

7575
ret
@@ -90,7 +90,7 @@ float_bench! {
9090
"ucvtf {ret:s}, {a:x}",
9191
a = in(reg) a,
9292
ret = lateout(vreg) ret,
93-
options(nomem, nostack),
93+
options(nomem, nostack, pure),
9494
);
9595

9696
ret
@@ -111,7 +111,7 @@ float_bench! {
111111
"ucvtf {ret:d}, {a:x}",
112112
a = in(reg) a,
113113
ret = lateout(vreg) ret,
114-
options(nomem, nostack),
114+
options(nomem, nostack, pure),
115115
);
116116

117117
ret
@@ -152,7 +152,7 @@ float_bench! {
152152
"cvtsi2ss {ret}, {a:e}",
153153
a = in(reg) a,
154154
ret = lateout(xmm_reg) ret,
155-
options(nomem, nostack),
155+
options(nomem, nostack, pure),
156156
);
157157

158158
ret
@@ -164,7 +164,7 @@ float_bench! {
164164
"scvtf {ret:s}, {a:w}",
165165
a = in(reg) a,
166166
ret = lateout(vreg) ret,
167-
options(nomem, nostack),
167+
options(nomem, nostack, pure),
168168
);
169169

170170
ret
@@ -185,7 +185,7 @@ float_bench! {
185185
"cvtsi2sd {ret}, {a:e}",
186186
a = in(reg) a,
187187
ret = lateout(xmm_reg) ret,
188-
options(nomem, nostack),
188+
options(nomem, nostack, pure),
189189
);
190190

191191
ret
@@ -198,7 +198,7 @@ float_bench! {
198198
"scvtf {ret:d}, {a:w}",
199199
a = in(reg) a,
200200
ret = lateout(vreg) ret,
201-
options(nomem, nostack),
201+
options(nomem, nostack, pure),
202202
);
203203

204204
ret
@@ -219,7 +219,7 @@ float_bench! {
219219
"cvtsi2ss {ret}, {a:r}",
220220
a = in(reg) a,
221221
ret = lateout(xmm_reg) ret,
222-
options(nomem, nostack),
222+
options(nomem, nostack, pure),
223223
);
224224

225225
ret
@@ -231,7 +231,7 @@ float_bench! {
231231
"scvtf {ret:s}, {a:x}",
232232
a = in(reg) a,
233233
ret = lateout(vreg) ret,
234-
options(nomem, nostack),
234+
options(nomem, nostack, pure),
235235
);
236236

237237
ret
@@ -252,7 +252,7 @@ float_bench! {
252252
"cvtsi2sd {ret}, {a:r}",
253253
a = in(reg) a,
254254
ret = lateout(xmm_reg) ret,
255-
options(nomem, nostack),
255+
options(nomem, nostack, pure),
256256
);
257257

258258
ret
@@ -265,7 +265,7 @@ float_bench! {
265265
"scvtf {ret:d}, {a:x}",
266266
a = in(reg) a,
267267
ret = lateout(vreg) ret,
268-
options(nomem, nostack),
268+
options(nomem, nostack, pure),
269269
);
270270

271271
ret
@@ -307,7 +307,7 @@ float_bench! {
307307
"fcvtzu {ret:w}, {a:s}",
308308
a = in(vreg) a,
309309
ret = lateout(reg) ret,
310-
options(nomem, nostack),
310+
options(nomem, nostack, pure),
311311
);
312312

313313
ret
@@ -329,7 +329,7 @@ float_bench! {
329329
"fcvtzu {ret:x}, {a:s}",
330330
a = in(vreg) a,
331331
ret = lateout(reg) ret,
332-
options(nomem, nostack),
332+
options(nomem, nostack, pure),
333333
);
334334

335335
ret
@@ -360,7 +360,7 @@ float_bench! {
360360
"fcvtzu {ret:w}, {a:d}",
361361
a = in(vreg) a,
362362
ret = lateout(reg) ret,
363-
options(nomem, nostack),
363+
options(nomem, nostack, pure),
364364
);
365365

366366
ret
@@ -381,7 +381,7 @@ float_bench! {
381381
"fcvtzu {ret:x}, {a:d}",
382382
a = in(vreg) a,
383383
ret = lateout(reg) ret,
384-
options(nomem, nostack),
384+
options(nomem, nostack, pure),
385385
);
386386

387387
ret
@@ -414,7 +414,7 @@ float_bench! {
414414
"fcvtzs {ret:w}, {a:s}",
415415
a = in(vreg) a,
416416
ret = lateout(reg) ret,
417-
options(nomem, nostack),
417+
options(nomem, nostack, pure),
418418
);
419419

420420
ret
@@ -436,7 +436,7 @@ float_bench! {
436436
"fcvtzs {ret:x}, {a:s}",
437437
a = in(vreg) a,
438438
ret = lateout(reg) ret,
439-
options(nomem, nostack),
439+
options(nomem, nostack, pure),
440440
);
441441

442442
ret
@@ -467,7 +467,7 @@ float_bench! {
467467
"fcvtzs {ret:w}, {a:d}",
468468
a = in(vreg) a,
469469
ret = lateout(reg) ret,
470-
options(nomem, nostack),
470+
options(nomem, nostack, pure),
471471
);
472472

473473
ret
@@ -488,7 +488,7 @@ float_bench! {
488488
"fcvtzs {ret:x}, {a:d}",
489489
a = in(vreg) a,
490490
ret = lateout(reg) ret,
491-
options(nomem, nostack),
491+
options(nomem, nostack, pure),
492492
);
493493

494494
ret

testcrate/benches/float_div.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ float_bench! {
1616
"divss {a}, {b}",
1717
a = inout(xmm_reg) a,
1818
b = in(xmm_reg) b,
19-
options(nomem, nostack)
19+
options(nomem, nostack, pure)
2020
);
2121

2222
a
@@ -27,7 +27,7 @@ float_bench! {
2727
"fdiv {a:s}, {a:s}, {b:s}",
2828
a = inout(vreg) a,
2929
b = in(vreg) b,
30-
options(nomem, nostack)
30+
options(nomem, nostack, pure)
3131
);
3232

3333
a
@@ -47,7 +47,7 @@ float_bench! {
4747
"divsd {a}, {b}",
4848
a = inout(xmm_reg) a,
4949
b = in(xmm_reg) b,
50-
options(nomem, nostack)
50+
options(nomem, nostack, pure)
5151
);
5252

5353
a
@@ -58,7 +58,7 @@ float_bench! {
5858
"fdiv {a:d}, {a:d}, {b:d}",
5959
a = inout(vreg) a,
6060
b = in(vreg) b,
61-
options(nomem, nostack)
61+
options(nomem, nostack, pure)
6262
);
6363

6464
a

testcrate/benches/float_extend.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ float_bench! {
1414
sys_available: not(feature = "no-sys-f16"),
1515
asm: [
1616
#[cfg(target_arch = "aarch64")] {
17-
// FIXME(f16_f128): use `f16` assembly once support is added (rust-lang/rust/#116909)
17+
// FIXME(f16_f128): remove `to_bits()` after f16 asm support (rust-lang/rust/#116909)
1818
let ret: f32;
1919
asm!(
20-
"fcvt {ret:s}, h0",
21-
// a = in(vreg) a,
20+
"fcvt {ret:s}, {a:h}",
21+
a = in(vreg) a.to_bits(),
2222
ret = lateout(vreg) ret,
23-
options(nomem, nostack),
23+
options(nomem, nostack, pure),
2424
);
2525

2626
ret
@@ -52,7 +52,7 @@ float_bench! {
5252
"fcvt {ret:d}, {a:s}",
5353
a = in(vreg) a,
5454
ret = lateout(vreg) ret,
55-
options(nomem, nostack),
55+
options(nomem, nostack, pure),
5656
);
5757

5858
ret

0 commit comments

Comments
 (0)