Lines Matching +full:op +full:- +full:mode

2  * fp-bench.c - A collection of simple floating point microbenchmarks.
7 * See the COPYING file in the top-level directory.
29 enum op { enum
126 static enum op operation;
230 * on the compiler to unfold this at compile-time.
232 static void bench(enum precision prec, enum op op, int n_ops, bool no_neg) in bench() argument
251 switch (op) { in bench()
256 res.f = a - b; in bench()
286 switch (op) { in bench()
291 res.d = a - b; in bench()
321 switch (op) { in bench()
356 switch (op) { in bench()
391 switch (op) { in bench()
421 ns_elapsed += get_clock() - t0; in bench()
426 #define GEN_BENCH(name, type, prec, op, n_ops) \ argument
429 bench(prec, op, n_ops, false); \
432 #define GEN_BENCH_NO_NEG(name, type, prec, op, n_ops) \ argument
435 bench(prec, op, n_ops, true); \
438 #define GEN_BENCH_ALL_TYPES(opname, op, n_ops) \ argument
439 GEN_BENCH(bench_ ## opname ## _float, float, PREC_SINGLE, op, n_ops) \
440 GEN_BENCH(bench_ ## opname ## _double, double, PREC_DOUBLE, op, n_ops) \
441 GEN_BENCH(bench_ ## opname ## _float32, float32, PREC_FLOAT32, op, n_ops) \
442 GEN_BENCH(bench_ ## opname ## _float64, float64, PREC_FLOAT64, op, n_ops) \
443 GEN_BENCH(bench_ ## opname ## _float128, float128, PREC_FLOAT128, op, n_ops)
453 #define GEN_BENCH_ALL_TYPES_NO_NEG(name, op, n) \ argument
454 GEN_BENCH_NO_NEG(bench_ ## name ## _float, float, PREC_SINGLE, op, n) \
455 GEN_BENCH_NO_NEG(bench_ ## name ## _double, double, PREC_DOUBLE, op, n) \
456 GEN_BENCH_NO_NEG(bench_ ## name ## _float32, float32, PREC_FLOAT32, op, n) \
457 GEN_BENCH_NO_NEG(bench_ ## name ## _float64, float64, PREC_FLOAT64, op, n) \
458 GEN_BENCH_NO_NEG(bench_ ## name ## _float128, float128, PREC_FLOAT128, op, n)
466 #define GEN_BENCH_FUNCS(opname, op) \ argument
467 [op] = { \
492 * These implementation-defined choices for various things IEEE in run_bench()
506 /* @arr must be NULL-terminated */
516 return -1; in find_name()
526 fprintf(stderr, " -d = duration, in seconds. Default: %d\n", in usage_complete()
528 fprintf(stderr, " -h = show this help message.\n"); in usage_complete()
529 fprintf(stderr, " -o = floating point operation (%s). Default: %s\n", in usage_complete()
531 fprintf(stderr, " -p = floating point precision (single, double, quad[soft only]). " in usage_complete()
533 fprintf(stderr, " -r = rounding mode (even, zero, down, up, tieaway). " in usage_complete()
535 fprintf(stderr, " -t = tester (%s). Default: %s\n", in usage_complete()
537 fprintf(stderr, " -z = flush inputs to zero (soft tester only). " in usage_complete()
539 fprintf(stderr, " -Z = flush output to zero (soft tester only). " in usage_complete()
555 return -1; in round_name_to_mode()
597 signed char mode; in set_soft_precision() local
601 mode = float_round_nearest_even; in set_soft_precision()
604 mode = float_round_to_zero; in set_soft_precision()
607 mode = float_round_down; in set_soft_precision()
610 mode = float_round_up; in set_soft_precision()
613 mode = float_round_ties_away; in set_soft_precision()
618 soft_status.float_rounding_mode = mode; in set_soft_precision()
642 fprintf(stderr, "Unsupported op '%s'\n", optarg); in parse_args()
662 fprintf(stderr, "fatal: invalid rounding mode '%s'\n", optarg); in parse_args()
683 /* set precision and rounding mode based on the tester */ in parse_args()