diff options
author | Kelvin Nilsen <kelvin@gcc.gnu.org> | 2017-06-09 19:28:56 +0000 |
---|---|---|
committer | Kelvin Nilsen <kelvin@gcc.gnu.org> | 2017-06-09 19:28:56 +0000 |
commit | 6834463dd4d2f04ab4a25036d63605b006ac19ac (patch) | |
tree | 705ab67fa46e81e310269d3a3b570742f1231537 | |
parent | 1fbc31a64ee161647962656b23424ffb39aca4ab (diff) |
lots of new test cases
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/92680e2@249075 138bc75d-0d04-0410-961f-82ee72b054a4
40 files changed, 1483 insertions, 75 deletions
diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def index 554f8dd7dc0..63887d20c13 100644 --- a/gcc/config/rs6000/rs6000-builtin.def +++ b/gcc/config/rs6000/rs6000-builtin.def @@ -2000,7 +2000,7 @@ BU_P9V_OVERLOAD_3 (RLMI, "rlmi") BU_P9V_64BIT_VSX_1 (VSEEDP, "scalar_extract_exp", CONST, xsxexpdp) BU_P9V_64BIT_VSX_1 (VSESDP, "scalar_extract_sig", CONST, xsxsigdp) -BU_P9V_64BIT_VSX_1 (VSEEQP, "scalar_extract_expq", CONST, xsxexpqp); +BU_P9V_64BIT_VSX_1 (VSEEQP, "scalar_extract_expq", CONST, xsxexpqp) BU_P9V_64BIT_VSX_1 (VSESQP, "scalar_extract_sigq", CONST, xsxsigqp) BU_P9V_VSX_1 (VSTDCNQP, "scalar_test_neg_qp", CONST, xststdcnegqp) @@ -2037,6 +2037,7 @@ BU_P9V_OVERLOAD_1 (VSEEDP, "scalar_extract_exp") BU_P9V_OVERLOAD_1 (VSESDP, "scalar_extract_sig") BU_P9V_OVERLOAD_1 (VSTDCN, "scalar_test_neg") +BU_P9V_OVERLOAD_1 (VSTDCNQP, "scalar_test_neg_qp") BU_P9V_OVERLOAD_1 (VSTDCNDP, "scalar_test_neg_dp") BU_P9V_OVERLOAD_1 (VSTDCNSP, "scalar_test_neg_sp") @@ -2046,6 +2047,7 @@ BU_P9V_OVERLOAD_1 (REVB, "revb") BU_P9V_OVERLOAD_2 (VSIEDP, "scalar_insert_exp") BU_P9V_OVERLOAD_2 (VSTDC, "scalar_test_data_class") +BU_P9V_OVERLOAD_2 (VSTDCQP, "scalar_test_data_class_qp") BU_P9V_OVERLOAD_2 (VSTDCDP, "scalar_test_data_class_dp") BU_P9V_OVERLOAD_2 (VSTDCSP, "scalar_test_data_class_sp") diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c index baec2ad0b1f..9375ec533f5 100644 --- a/gcc/config/rs6000/rs6000-c.c +++ b/gcc/config/rs6000/rs6000-c.c @@ -4649,37 +4649,28 @@ const struct altivec_builtin_types altivec_overloaded_builtins[] = { RS6000_BTI_bool_int, RS6000_BTI_float, RS6000_BTI_INTSI, 0 }, { P9V_BUILTIN_VEC_VSTDC, P9V_BUILTIN_VSTDCDP, RS6000_BTI_bool_int, RS6000_BTI_double, RS6000_BTI_INTSI, 0 }, + { P9V_BUILTIN_VEC_VSTDC, P9V_BUILTIN_VSTDCQP, + RS6000_BTI_bool_int, RS6000_BTI_ieee128_float, RS6000_BTI_INTSI, 0 }, { P9V_BUILTIN_VEC_VSTDCSP, P9V_BUILTIN_VSTDCSP, RS6000_BTI_bool_int, RS6000_BTI_float, RS6000_BTI_INTSI, 0 }, { P9V_BUILTIN_VEC_VSTDCDP, P9V_BUILTIN_VSTDCDP, RS6000_BTI_bool_int, RS6000_BTI_double, RS6000_BTI_INTSI, 0 }, + { P9V_BUILTIN_VEC_VSTDCQP, P9V_BUILTIN_VSTDCQP, + RS6000_BTI_bool_int, RS6000_BTI_ieee128_float, RS6000_BTI_INTSI, 0 }, - /* kelvin thinks this old code was wrong. This is apparently - * the representation of scalar_test_data_class overloading. - * we expect to args and a result. this only has one arg. Also, - * as originally implemented this was expanding into the same - * constant that were being used for scalar_test_neg. The reason - * this problem was not detected previously may have been that - * existing dejagnu tests only look for presence of assembly - * instruction, which would be the same for either. but shouldn't - * we see errors because of the extraneous second argument? - * probably not, due to only checking the arguments that are - * explicitly mentioned here, and also because I think this code is - * special cased. - */ - { P9V_BUILTIN_VEC_VSTDCN, P9V_BUILTIN_VSTDCSP, - RS6000_BTI_bool_int, RS6000_BTI_float, RS6000_BTI_UINTSI, 0 }, - { P9V_BUILTIN_VEC_VSTDCN, P9V_BUILTIN_VSTDCDP, - RS6000_BTI_bool_int, RS6000_BTI_double, RS6000_BTI_UINTSI, 0 }, - { P9V_BUILTIN_VEC_VSTDCN, P9V_BUILTIN_VSTDCQP, - RS6000_BTI_bool_int, RS6000_BTI_ieee128_float, RS6000_BTI_UINTSI, 0 }, + { P9V_BUILTIN_VEC_VSTDCN, P9V_BUILTIN_VSTDCNSP, + RS6000_BTI_bool_int, RS6000_BTI_float, 0, 0 }, + { P9V_BUILTIN_VEC_VSTDCN, P9V_BUILTIN_VSTDCNDP, + RS6000_BTI_bool_int, RS6000_BTI_double, 0, 0 }, + { P9V_BUILTIN_VEC_VSTDCN, P9V_BUILTIN_VSTDCNQP, + RS6000_BTI_bool_int, RS6000_BTI_ieee128_float, 0, 0 }, { P9V_BUILTIN_VEC_VSTDCNSP, P9V_BUILTIN_VSTDCNSP, RS6000_BTI_bool_int, RS6000_BTI_float, 0, 0 }, { P9V_BUILTIN_VEC_VSTDCNDP, P9V_BUILTIN_VSTDCNDP, RS6000_BTI_bool_int, RS6000_BTI_double, 0, 0 }, - { P9V_BUILTIN_VEC_VSTDCNDP, P9V_BUILTIN_VSTDCNQP, + { P9V_BUILTIN_VEC_VSTDCNQP, P9V_BUILTIN_VSTDCNQP, RS6000_BTI_bool_int, RS6000_BTI_ieee128_float, 0, 0 }, { P9V_BUILTIN_VEC_VSEEDP, P9V_BUILTIN_VSEEDP, @@ -6537,10 +6528,6 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, int overloaded_code; int arg1_mode = TYPE_MODE (types[0]); -#undef KELVIN_DEBUG -#ifdef KELVIN_DEBUG - fprintf (stderr, "Looking at overloaded P9V_BUILTIN_VEC_VSIEDP\n"); -#endif if (nargs != 2) { error ("scalar_insert_exp only accepts 2 arguments"); @@ -6551,80 +6538,40 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl, 128-bit variant of built-in function. */ if (GET_MODE_PRECISION (arg1_mode) > 64) { -#ifdef KELVIN_DEBUG - fprintf (stderr, " dealing with 128 bits\n"); -#endif /* if first argument is of float variety, choose variant that expects __ieee128 argument. Otherwise, expect __int128 argument. */ if (GET_MODE_CLASS (arg1_mode) == MODE_FLOAT) { -#ifdef KELVIN_DEBUG - fprintf (stderr, " looking for quad_float\n"); -#endif overloaded_code = P9V_BUILTIN_VSIEQPF; } else { -#ifdef KELVIN_DEBUG - fprintf (stderr, " looking for quad int\n"); -#endif overloaded_code = P9V_BUILTIN_VSIEQP; } } else { -#ifdef KELVIN_DEBUG - fprintf (stderr, " dealing with 64 bits\n"); -#endif /* if first argument is of float variety, choose variant that expects double argument. Otherwise, expect long long int argument. */ if (GET_MODE_CLASS (arg1_mode) == MODE_FLOAT) { -#ifdef KELVIN_DEBUG - fprintf (stderr, " looking for double\n"); -#endif overloaded_code = P9V_BUILTIN_VSIEDPF; } else { -#ifdef KELVIN_DEBUG - fprintf (stderr, " looking for long long\n"); -#endif overloaded_code = P9V_BUILTIN_VSIEDP; } } while (desc->code && desc->code == fcode && desc->overloaded_code != overloaded_code) desc++; -#ifdef KELVIN_DEBUG - fprintf (stderr, - "looking for fcode: %d, overloaded_code: %d\n", - fcode, overloaded_code); - fprintf (stderr, - " out of loop, desc->code: %d, desc->overloaded_code: %d\n", - desc->code, desc->overloaded_code); - - fprintf (stderr, "desc->op1: %d, desc->op2: %d\n", - desc->op1, desc->op2); - fprintf (stderr, "types[0] is%s integral\n", - INTEGRAL_TYPE_P (types[0])? "": " not"); - fprintf (stderr, "types[1] is%s integral\n", - INTEGRAL_TYPE_P (types[1])? "": " not"); -#endif if (desc->code && (desc->code == fcode) && rs6000_builtin_type_compatible (types[0], desc->op1) && rs6000_builtin_type_compatible (types[1], desc->op2)) { -#ifdef KELVIN_DEBUG - fprintf (stderr, "builtin_type_compatible tests are happy\n"); -#endif if (rs6000_builtin_decls[desc->overloaded_code] != NULL_TREE) return altivec_build_resolved_builtin (args, n, desc); else unsupported_builtin = true; } -#ifdef KELVIN_DEBUG - fprintf (stderr, "falling through, unsupported_builtin is %s\n", - unsupported_builtin? "true": "false"); -#endif } else { diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md index 2337a587a7a..426ac1bb5bc 100644 --- a/gcc/config/rs6000/vsx.md +++ b/gcc/config/rs6000/vsx.md @@ -3447,7 +3447,7 @@ UNSPEC_VSX_SXEXPDP))] "TARGET_P9_VECTOR && TARGET_64BIT" "xsxexpqp %0,%x1" - [(set_attr "type" "integer")]) + [(set_attr "type" "vecmove")]) ;; VSX Scalar Extract Exponent Double-Precision (define_insn "xsxexpdp" @@ -3465,7 +3465,7 @@ UNSPEC_VSX_SXSIGDP))] "TARGET_P9_VECTOR && TARGET_64BIT" "xsxsigqp %0,%x1" - [(set_attr "type" "integer")]) + [(set_attr "type" "vecmove")]) ;; VSX Scalar Extract Significand Double-Precision (define_insn "xsxsigdp" @@ -3484,7 +3484,7 @@ UNSPEC_VSX_SIEXPQP))] "TARGET_P9_VECTOR && TARGET_64BIT" "xsiexpqp %0,%1,%2" - [(set_attr "type" "fpsimple")]) + [(set_attr "type" "vecmove")]) ;; VSX Scalar Insert Exponent Quad-Precision (define_insn "xsiexpqp" @@ -3494,7 +3494,7 @@ UNSPEC_VSX_SIEXPQP))] "TARGET_P9_VECTOR && TARGET_64BIT" "xsiexpqp %0,%1,%0" - [(set_attr "type" "fpsimple")]) + [(set_attr "type" "vecmove")]) ;; VSX Scalar Insert Exponent Double-Precision (define_insn "xsiexpdp" diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 6e2137dbfc5..005bc53e1b4 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -1,4 +1,4 @@ -@c Copyright (C) 1988-2017 Free Software Foundation, Inc. +c Copyright (C) 1988-2017 Free Software Foundation, Inc. @c This is part of the GCC manual. @c For copying conditions, see the file gcc.texi. @@ -15220,10 +15220,14 @@ functions require a 64-bit environment supporting ISA 3.0 or later. The @code{scalar_extract_exp} and @code{scalar_extract_sig} built-in functions return the significand and the biased exponent value respectively of their @code{source} arguments. -Within the result returned by @code{scalar_extract_sig}, -the @code{0x10000000000000} bit is set if the +When supplied with a 64-bit @code{source} argument, the +result returned by @code{scalar_extract_sig} has +the @code{0x10000000000000} bit set if the function's @code{source} argument is in normalized form. Otherwise, this bit is set to 0. +When supplied with a 128-bit @code{source} argument, the +@code{0x10000000000000000000000000000} bit of the result is +treated similarly. Note that the sign of the significand is not represented in the result returned from the @code{scalar_extract_sig} function. Use the @code{scalar_test_neg} function to test the sign of its @code{double} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-eq-3.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-eq-3.c new file mode 100644 index 00000000000..e069fb49af9 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-eq-3.c @@ -0,0 +1,32 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on 32-bit and 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +int +compare_exponents_eq (double *exponent1_p, double *exponent2_p) +{ + double exponent1 = *exponent1_p; + double exponent2 = *exponent2_p; + + return scalar_cmp_exp_eq (exponent1, exponent2); +} + +int +main () +{ + double x = (double) (0x1100LL << 50); + double y = (double) (0x1101LL << 50); + double z = (double) (0x1101LL << 37); + + if (!compare_exponents_eq (&x, &y)) + abort (); + if (compare_exponents_eq (&x, &z)) + abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-eq-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-eq-4.c new file mode 100644 index 00000000000..800c32c6e07 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-eq-4.c @@ -0,0 +1,34 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on 32-bit and 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +char +compare_exponents_eq (double *exponent1_p, double *exponent2_p) +{ + double exponent1 = *exponent1_p; + double exponent2 = *exponent2_p; + + if (scalar_cmp_exp_eq (exponent1, exponent2)) + return 't'; + else + return 'f'; +} + +int +main () +{ + double x = (double) (0x1100LL << 50); + double y = (double) (0x1101LL << 50); + double z = (double) (0x1101LL << 37); + + if (compare_exponents_eq (&x, &y) == 'f') + abort (); + if (compare_exponents_eq (&x, &z) == 't') + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-gt-3.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-gt-3.c new file mode 100644 index 00000000000..c0cedecaa7f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-gt-3.c @@ -0,0 +1,31 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on 32-bit and 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +int +compare_exponents_gt (double *exponent1_p, double *exponent2_p) +{ + double exponent1 = *exponent1_p; + double exponent2 = *exponent2_p; + + return scalar_cmp_exp_gt (exponent1, exponent2); +} + +int +main () +{ + double x = (double) (0x1100LL << 50); + double y = (double) (0x1101LL << 50); + double z = (double) (0x1101LL << 37); + + if (compare_exponents_gt (&x, &y)) + abort (); + if (!compare_exponents_gt (&x, &z)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-gt-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-gt-4.c new file mode 100644 index 00000000000..1e24355d7f1 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-gt-4.c @@ -0,0 +1,34 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on 32-bit and 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +char +compare_exponents_gt (double *exponent1_p, double *exponent2_p) +{ + double exponent1 = *exponent1_p; + double exponent2 = *exponent2_p; + + if (scalar_cmp_exp_gt (exponent1, exponent2)) + return 't'; + else + return 'f'; +} + +int +main () +{ + double x = (double) (0x1100LL << 50); + double y = (double) (0x1101LL << 50); + double z = (double) (0x1101LL << 37); + + if (compare_exponents_gt (&x, &y) == 't') + abort (); + if (compare_exponents_gt (&x, &z) == 'f') + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-lt-3.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-lt-3.c new file mode 100644 index 00000000000..acc24b5658e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-lt-3.c @@ -0,0 +1,31 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on 32-bit and 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +int +compare_exponents_lt (double *exponent1_p, double *exponent2_p) +{ + double exponent1 = *exponent1_p; + double exponent2 = *exponent2_p; + + return scalar_cmp_exp_lt (exponent1, exponent2); +} + +int +main () +{ + double x = (double) (0x1100LL << 50); + double y = (double) (0x1101LL << 50); + double z = (double) (0x1101LL << 37); + + if (compare_exponents_lt (&x, &y)) + abort (); + if (!compare_exponents_lt (&z, &x)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-lt-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-lt-4.c new file mode 100644 index 00000000000..b8bd278dce5 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-lt-4.c @@ -0,0 +1,34 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on 32-bit and 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +char +compare_exponents_lt (double *exponent1_p, double *exponent2_p) +{ + double exponent1 = *exponent1_p; + double exponent2 = *exponent2_p; + + if (scalar_cmp_exp_lt (exponent1, exponent2)) + return 't'; + else + return 'f'; +} + +int +main () +{ + double x = (double) (0x1100LL << 50); + double y = (double) (0x1101LL << 50); + double z = (double) (0x1101LL << 37); + + if (compare_exponents_lt (&x, &y) == 't') + abort (); + if (compare_exponents_lt (&z, &x) == 'f') + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-3.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-3.c new file mode 100644 index 00000000000..09db88cbbf2 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-3.c @@ -0,0 +1,36 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on 32-bit and 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +int +compare_exponents_unordered (double *exponent1_p, double *exponent2_p) +{ + double exponent1 = *exponent1_p; + double exponent2 = *exponent2_p; + + /* This test succeeds if either exponent1 or exponent2 is NaN. */ + return scalar_cmp_exp_unordered (exponent1, exponent2); +} + +int +main () +{ + /* NaN is denoted by exponent = 2047 and fraction != 0 */ + unsigned long long int nan_image = 0x7ff0_0000_0000_0003LL; + double *nan_ptr = (double *) &nan_image; + + double x = (double) (0x1100LL << 50); + double y = (double) (0x1101LL << 50); + double z = (double) (0x1101LL << 37); + + if (!compare_exponents_unordered (&x, nan_ptr)) + abort (); + if (compare_exponents_unordered (&x, &z)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-4.c new file mode 100644 index 00000000000..61d68a0f088 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-cmp-exp-unordered-4.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed on 32-bit and 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +char +compare_exponents_unordered (double *exponent1_p, double *exponent2_p) +{ + double exponent1 = *exponent1_p; + double exponent2 = *exponent2_p; + + /* This test succeeds if either exponent1 or exponent2 is NaN. */ + if (scalar_cmp_exp_unordered (exponent1, exponent2)) + return 't'; + else + return 'f'; +} + +int +main () +{ + /* NaN is denoted by exponent = 2047 and fraction != 0 */ + unsigned long long int nan_image = 0x7ff0_0000_0000_0003LL; + double *nan_ptr = (double *) &nan_image; + + double x = (double) (0x1100LL << 50); + double y = (double) (0x1101LL << 50); + double z = (double) (0x1101LL << 37); + + if (compare_exponents_unordered (&x, nan_ptr) == 'f') + abort (); + if (compare_exponents_unordered (&x, &z) == 't') + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-4.c index b03d6a57a97..502241581d9 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-4.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-4.c @@ -12,7 +12,7 @@ get_exponent (__ieee128 *p) { __ieee128 source = *p; - return __builtin_vec_scalar_extract_exp (source); /* { dg-error "Builtin function __builtin_vsx_scalar_extract_exp requires" } */ + return __builtin_vec_scalar_extract_exp (source); /* { dg-error "Builtin function __builtin_vsx_scalar_extract_expq requires" } */ } diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c new file mode 100644 index 00000000000..c215c6256bf --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-6.c @@ -0,0 +1,30 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed only on 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +unsigned int +get_exponent (double *p) +{ + double source = *p; + + return scalar_extract_exp (source); +} + +int +main () +{ + double x = (double) (0x1100LL << 50); + double z = (double) (0x1101LL << 37); + + if (get_exponent (&x) != 53) + abort (); + if (get_exponent (&z) != 40) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-7.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-7.c new file mode 100644 index 00000000000..c9e543b71be --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-exp-7.c @@ -0,0 +1,30 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed only on 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +unsigned long long int +get_exponent (__ieee128 *p) +{ + __ieee128 source = *p; + + return scalar_extract_exp (source); +} + +int +main () +{ + __ieee128 x = (__ieee128) (((__int128) 0x1100LL) << 120); + __ieee128 z = (__ieee128) (((__int128) 0x1101LL) << 117); + + if (get_exponent (&x) != 123) + abort (); + if (get_exponent (&z) != 120) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-4.c index 8c6a8e7fd36..0c2ec4739f5 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-4.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-4.c @@ -12,5 +12,5 @@ get_significand (__ieee128 *p) { __ieee128 source = *p; - return __builtin_vec_scalar_extract_sig (source); /* { dg-error "Builtin function __builtin_vsx_scalar_extract_sig requires" } */ + return __builtin_vec_scalar_extract_sig (source); /* { dg-error "Builtin function __builtin_vsx_scalar_extract_sigq requires" } */ } diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c new file mode 100644 index 00000000000..31a020037d0 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-6.c @@ -0,0 +1,30 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed only on 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +unsigned long long int +get_significand (double *p) +{ + double source = *p; + + return scalar_extract_sig (source); +} + +int +main () +{ + double x = (double) (0x1100LL << 50); + double z = (double) (0x1101LL << 37); + + if (get_significand (&x) != 0x18000000000000LL) + abort (); + if (get_significand (&z) != 0x1a000000000000LL) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-7.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-7.c new file mode 100644 index 00000000000..f1a04ef2c44 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-extract-sig-7.c @@ -0,0 +1,33 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target powerpc_p9vector_ok } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed only on 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +unsigned __int128 +get_significand (__ieee128 *p) +{ + __ieee128 source = *p; + + return scalar_extract_sig (source); +} + +int +main () +{ + __ieee128 x = (__ieee128) (((__int128) 0x1100LL) << 120); + __ieee128 z = (__ieee128) (((__int128) 0x1101LL) << 117); + + unsigned __int128 first_anticipated_result = ((__int128) 0x1100LL) << 120; + unsigned __int128 second_anticipated_result = ((__int128) 0x1101LL) << 117; + + if (get_significand (&x) != first_anticipated_result) + abort (); + if (get_significand (&z) != second_anticipated_result) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c new file mode 100644 index 00000000000..71eb1dd7a3d --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-12.c @@ -0,0 +1,38 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed only on 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +double +insert_exponent (unsigned long long int *significand_p, + unsigned long long int *exponent_p) +{ + unsigned long long int significand = *significand_p; + unsigned long long int exponent = *exponent_p; + + return scalar_insert_exp (significand, exponent); +} + +int +main () +{ + unsigned long long int significand_1 = 0x18000000000000LL; + unsigned long long int significand_2 = 0x1a000000000000LL; + unsigned long long int exponent_1 = 53; + unsigned long long int exponent_2 = 40; + + double x = (double) (0x1100LL << 50); + double z = (double) (0x1101LL << 37); + + + if (insert_exponent (&significand_1, &exponent_1) != x) + abort (); + if (insert_exponent (&significand_2, &exponent_2) != z) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c new file mode 100644 index 00000000000..ff11d6450fb --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-13.c @@ -0,0 +1,41 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed only on 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +double +insert_exponent (double *significand_p, + unsigned long long int *exponent_p) +{ + double significand = *significand_p; + unsigned long long int exponent = *exponent_p; + + return scalar_insert_exp (significand, exponent); +} + +int +main () +{ + unsigned long long int significand_1 = 0x18000000000000LL; + unsigned long long int significand_2 = 0x1a000000000000LL; + + double *significand_1_ptr = (double *) &signficand_1; + double *significand_2_ptr = (double *) &signficand_2; + + unsigned long long int exponent_1 = 53; + unsigned long long int exponent_2 = 40; + + double x = (double) (0x1100LL << 50); + double z = (double) (0x1101LL << 37); + + if (insert_exponent (significand_1_ptr, &exponent_1) != x) + abort (); + if (insert_exponent (significand_2_ptr, &exponent_2) != z) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-14.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-14.c new file mode 100644 index 00000000000..5df96413185 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-14.c @@ -0,0 +1,38 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed only on 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +__ieee128 +insert_exponent (unsigned __int128 *significand_p, + unsigned long long int *exponent_p) +{ + unsigned __int128 significand = *significand_p; + unsigned long long int exponent = *exponent_p; + + return scalar_insert_exp (significand, exponent); +} + +int +main () +{ + /* most-significant bit @13, shift it to position 113 */ + unsigned __int128 significand_1 = ((__int 128) 0x1100) << 100; + unsigned __int128 significand_2 = ((__int 128) 0x1101) << 100; + unsigned long long int exponent_1 = 123; + unsigned long long int exponent_2 = 120; + + __ieee128 x = (__ieee128) (((__int128) 0x1100LL) << 120); + __ieee128 z = (__ieee128) (((__int128) 0x1101LL) << 117); + + if (insert_exponent (&significand_1, &exponent_1) != x) + abort (); + if (insert_exponent (&significand_2, &exponent_2) != z) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-15.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-15.c new file mode 100644 index 00000000000..b860942248b --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-insert-exp-15.c @@ -0,0 +1,41 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target lp64 } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +/* This test should succeed only on 64-bit configurations. */ +#include <altivec.h> +#include <stdlib.h> + +__ieee128 +insert_exponent (__ieee128 *significand_p, + unsigned long long int *exponent_p) +{ + __ieee128 significand = *significand_p; + unsigned long long int exponent = *exponent_p; + + return scalar_insert_exp (significand, exponent); +} + +int +main () +{ + /* most-significant bit @13, shift it to position 113 */ + unsigned __int128 significand_1 = ((__int 128) 0x1100) << 100; + unsigned __int128 significand_2 = ((__int 128) 0x1101) << 100; + unsigned long long int exponent_1 = 123; + unsigned long long int exponent_2 = 120; + + double __ieee128 *significand_1_ptr = (double *) &signficand_1; + double __ieee128 *significand_2_ptr = (double *) &signficand_2; + + __ieee128 x = (__ieee128) (((__int128) 0x1100LL) << 120); + __ieee128 z = (__ieee128) (((__int128) 0x1101LL) << 117); + + if (insert_exponent (significand_1_ptr, &exponent_1) != x) + abort (); + if (insert_exponent (significand_2_ptr, &exponent_2) != z) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c index 3efe086b2e1..0065b77746a 100644 --- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c @@ -9,7 +9,7 @@ bool test_data_class (__ieee128 *p) { - double __ieee128 = *p; + __ieee128 source = *p; return __builtin_vec_scalar_test_data_class (source, 3); /* { dg-error "Builtin function __builtin_vsx_scalar_test_data_class_qp requires" } */ } diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-12.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-12.c new file mode 100644 index 00000000000..65f95dd6757 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-12.c @@ -0,0 +1,63 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdbool.h> +#include <stdlib.h> + +bool +test_denormal (double *p) +{ + double source = *p; + + /* + 0x40 Test for NaN + 0x20 Test for +Infinity + 0x10 Test for -Infinity + 0x08 Test for +Zero + 0x04 Test for -Zero + 0x02 Test for +Denormal + 0x01 Test for -Denormal + */ + return scalar_test_data_class (source, 3); +} + +int +main () +{ + /* A normalized number has a biased exponent value: + * (my extrapolations for ieee128) + * 1 to 254 in single format + * 1 to 2046 in double format + * 1 to 32766 in ieee128 format + * Note that unbiased exponent value is: + * biased_value - 127: single format (range: -126 to 127) + * biased_value - 1023: double format (range: -1022 to 1023) + * biased_value - 16,383: ieee128 format (range: -16382 to 16,383) + * + * For normalized numbers, the implied unit bit is 1. Normalized + * numbers are interpreted as follows: + * normalized_number = (-1)^S * s^E * (1.<fraction>) + * (note that the significand is 1 plus the <fraction>) + * + * A Zero value has a biased exponent value of zero and a zero + * fraction value. The sign may be either positive or negative. + * + * A Denormal number has a biased exponent value of zero and a + * non-zero fraction value + */ + double denormal_plus = scalar_insert_exp (0x8000000000000ULL, 0x0ULL); + double denormal_minus = scalar_insert_exp (0x8008000000000000ULL, 0x0ULL); + double not_denormal = scalar_insert_exp (0x80000000000000000ULL, 1023ULL); + + if (!test_denormal (&denormal_plus)) + abort (); + if (!test_denormal (&denormal_minus)) + abort (); + if (test_denormal (¬_denormal)) + abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-13.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-13.c new file mode 100644 index 00000000000..c0178b77c1f --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-13.c @@ -0,0 +1,66 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdbool.h> +#include <stdlib.h> + +bool +test_zero (float *p) +{ + float source = *p; + + /* + 0x40 Test for NaN + 0x20 Test for +Infinity + 0x10 Test for -Infinity + 0x08 Test for +Zero + 0x04 Test for -Zero + 0x02 Test for +Denormal + 0x01 Test for -Denormal + */ + return scalar_test_data_class (source, 12); +} + +int +main () +{ + /* A normalized number has a biased exponent value: + * (my extrapolations for ieee128) + * 1 to 254 in single format + * 1 to 2046 in double format + * 1 to 32766 in ieee128 format + * Note that unbiased exponent value is: + * biased_value - 127: single format (range: -126 to 127) + * biased_value - 1023: double format (range: -1022 to 1023) + * biased_value - 16,383: ieee128 format (range: -16382 to 16,383) + * + * For normalized numbers, the implied unit bit is 1. Normalized + * numbers are interpreted as follows: + * normalized_number = (-1)^S * s^E * (1.<fraction>) + * (note that the significand is 1 plus the <fraction>) + * + * A Zero value has a biased exponent value of zero and a zero + * fraction value. The sign may be either positive or negative. + * + * A Denormal number has a biased exponent value of zero and a + * non-zero fraction value + */ + unsigned int zero_plus_image = 0x0; + unsigned int zero_minus_image = 0x80000000; + unsigned int non_zero_image = 0x60000000; + + float zero_plus_p = (float *) &zero_plus_image; + float zero_minus_p = (float *) &zero_minus_image; + float not_zero_p = (float *) &non_zero_image; + + if (!test_zero (zero_plus_p)) + abort (); + if (!test_zero (zero_minus_p)) + abort (); + if (test_zero (not_zero_p)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-14.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-14.c new file mode 100644 index 00000000000..27d6c785a6e --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-14.c @@ -0,0 +1,85 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdbool.h> +#include <stdlib.h> + +bool +test_nan (__ieee128 *p) +{ + __ieee128 source = *p; + + /* + 0x40 Test for NaN + 0x20 Test for +Infinity + 0x10 Test for -Infinity + 0x08 Test for +Zero + 0x04 Test for -Zero + 0x02 Test for +Denormal + 0x01 Test for -Denormal + */ + return scalar_test_data_class (source, 0x40); +} + +int +main () +{ + /* A normalized number has a biased exponent value: + * (my extrapolations for ieee128) + * 1 to 254 in single format + * 1 to 2046 in double format + * 1 to 32766 in ieee128 format + * Note that unbiased exponent value is: + * biased_value - 127: single format (range: -126 to 127) + * biased_value - 1023: double format (range: -1022 to 1023) + * biased_value - 16,383: ieee128 format (range: -16382 to 16,383) + * + * For normalized numbers, the implied unit bit is 1. Normalized + * numbers are interpreted as follows: + * normalized_number = (-1)^S * s^E * (1.<fraction>) + * (note that the significand is 1 plus the <fraction>) + * + * A Zero value has a biased exponent value of zero and a zero + * fraction value. The sign may be either positive or negative. + * + * A Denormal number has a biased exponent value of zero and a + * non-zero fraction value + * + * Infinity is represented by a biased exponent value of: + * 255 in single format + * 2047 in double format + * 32767 in ieee128 format + * and a zero fraction value. The document doesn't say so, but + * the difference between +infinity and -infinity is the value of + * the sign bit. + * + * NaNs are represented with + * the maximum biased exponent value and a non-zero fraction value. + * The sign bit ignored. + * If the high-order bit of the fraction field is 0, then the Nan + * is a Signaling NaN. Otherwise, it is a Quiet NaN. + */ + __int128 signal_significand = (__int128) 0xffffffff; + __int128 quiet_significand = (((__int128) 0x1) << 111) | 0xffffffff; + __int128 a_number_signficand = (((__int128) 0x1) << 111); + unsigned long long int nan_exponent = 0x7fff; + unsigned long long int a_number_exponent = 16383; + + __ieee128 signaling_nan = + scalar_insert_exp (signal_significand, nan_exponent); + __ieee128 quiet_nan = + scalar_insert_exp (quiet_significand, nan_exponent); + __ieee128 a_number = + scalar_insert_exp (a_number_significand, a_number_exponent); + + if (!test_nan (&signaling_nan)) + abort (); + if (!test_nan (&quiet_nan)) + abort (); + if (test_nan (&a_number)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-15.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-15.c new file mode 100644 index 00000000000..b85b7fe58f4 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-15.c @@ -0,0 +1,86 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdbool.h> +#include <stdlib.h> + +bool +test_infinity (__ieee128 *p) +{ + __ieee128 source = *p; + + /* + 0x40 Test for NaN + 0x20 Test for +Infinity + 0x10 Test for -Infinity + 0x08 Test for +Zero + 0x04 Test for -Zero + 0x02 Test for +Denormal + 0x01 Test for -Denormal + */ + return scalar_test_data_class (source, 0x30); +} + +int +main () +{ + /* A normalized number has a biased exponent value: + * (my extrapolations for ieee128) + * 1 to 254 in single format + * 1 to 2046 in double format + * 1 to 32766 in ieee128 format + * Note that unbiased exponent value is: + * biased_value - 127: single format (range: -126 to 127) + * biased_value - 1023: double format (range: -1022 to 1023) + * biased_value - 16,383: ieee128 format (range: -16382 to 16,383) + * + * For normalized numbers, the implied unit bit is 1. Normalized + * numbers are interpreted as follows: + * normalized_number = (-1)^S * s^E * (1.<fraction>) + * (note that the significand is 1 plus the <fraction>) + * + * A Zero value has a biased exponent value of zero and a zero + * fraction value. The sign may be either positive or negative. + * + * A Denormal number has a biased exponent value of zero and a + * non-zero fraction value + * + * Infinity is represented by a biased exponent value of: + * 255 in single format + * 2047 in double format + * 32767 in ieee128 format + * and a zero fraction value. The document doesn't say so, but + * the difference between +infinity and -infinity is the value of + * the sign bit. + * + * NaNs are represented with + * the maximum biased exponent value and a non-zero fraction value. + * The sign bit ignored. + * If the high-order bit of the fraction field is 0, then the Nan + * is a Signaling NaN. Otherwise, it is a Quiet NaN. + */ + __int128 plus_significand = (__int128) 0; + __int128 minus_significand = ((__int128) 0x1) << 127; + __int128 a_number_signficand = (((__int128) 0x1) << 112); + + unsigned long long int infinite_exponent = 0x7fff; + unsigned long long int a_number_exponent = 16383; + + __ieee128 plus_infinity = + scalar_insert_exp (plus_significand, infinite_exponent); + __ieee128 minus_infinity = + scalar_insert_exp (minus_significand, infinite_exponent); + __ieee128 a_number = + scalar_insert_exp (a_number_significand, a_number_exponent); + + if (!test_infinity (&plus_infinity)) + abort (); + if (!test_infinity (&minus_infinity)) + abort (); + if (test_infinity (&a_number)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-6.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-6.c new file mode 100644 index 00000000000..497ac7b14aa --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-6.c @@ -0,0 +1,30 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdbool.h> +#include <stdlib.h> + +bool +test_neg (double *p) +{ + double source = *p; + + return scalar_test_neg (source); +} + +int +main () +{ + double neg_number = (double) -1; + double plus_number = (double) 1; + + if (!test_neg (&neg_number)) + abort (); + if (test_neg (&plus_number)) + abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-7.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-7.c new file mode 100644 index 00000000000..f7dfb5f9ed6 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-7.c @@ -0,0 +1,29 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdbool.h> +#include <stdlib.h> + +bool +test_neg (float *p) +{ + float source = *p; + + return scalar_test_neg (source); +} + +int +main () +{ + float neg_number = (float) -1; + float plus_number = (float) 1; + + if (!test_neg (&neg_number)) + abort (); + if (test_neg (&plus_number)) + abort (); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-8.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-8.c new file mode 100644 index 00000000000..fff837ace70 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-8.c @@ -0,0 +1,30 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdbool.h> +#include <stdlib.h> + +bool +test_neg (__ieee128 *p) +{ + __ieee128 source = *p; + + return scalar_test_neg (source); +} + +int +main () +{ + __ieee128 neg_number = (__ieee128) -1; + __ieee128 plus_number = (__ieee128) 1; + + if (!test_neg (&neg_number)) + abort (); + if (test_neg (&plus_number)) + abort (); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-4.c new file mode 100644 index 00000000000..59c60123d09 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-4.c @@ -0,0 +1,33 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +__vector unsigned int +get_exponents (__vector float *p) +{ + __vector float source = *p; + + return vec_extract_exp (source); +} + +int +main () +{ + __vector float argument; + __vector unsigned int result; + + argument[0] = (float) (0x1 << 10); + argument[1] = (float) (0x1 << 9); + argument[2] = (float) (0x1 << 8); + argument[3] = (float) (0x1 << 7); + + result = get_exponents (&argument); + if ((result[0] != 10) || + (result[1] != 9) || (result[2] != 8) || (result[3] != 7)) + abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-5.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-5.c new file mode 100644 index 00000000000..5df735ab450 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-exp-5.c @@ -0,0 +1,30 @@ +/* { dg-do compile { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +__vector unsigned long long int +get_exponents (__vector double *p) +{ + __vector double source = *p; + + return vec_extract_exp (source); +} + +int +main () +{ + __vector double argument; + __vector unsigned long long int result; + + argument[0] = (double) (0x1 << 22); + argument[1] = (double) (0x1 << 23); + + result = get_exponents (&argument); + if ((result[0] != 22) || (result[1] != 23)) + abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-4.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-4.c new file mode 100644 index 00000000000..7503c72e397 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-4.c @@ -0,0 +1,33 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +__vector unsigned int +get_significands (__vector float *p) +{ + __vector float source = *p; + + return vec_extract_sig (source); +} + +int +main () +{ + __vector float argument; + __vector unsigned int result; + + argument[0] = (float) (0x1234 << 10); + argument[1] = (float) (0x4321 << 9); + argument[2] = (float) (0xbabe << 8); + argument[3] = (float) (0xcafe << 7); + + result = get_significands (&argument); + if ((result[0] != 0x1234) || + (result[1] != 0x4321) || (result[2] != 0xbabe) || (result[3] != 0xcafe)) + abort(); + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-5.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-5.c new file mode 100644 index 00000000000..3a505ccbe20 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-extract-sig-5.c @@ -0,0 +1,31 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +__vector unsigned long long int +get_significands (__vector double *p) +{ + __vector double source = *p; + + return vec_extract_sig (source); +} + +int +main () +{ + __vector double argument; + __vector unsigned long long int result; + + argument[0] = (double) (0xbabe << 22); + argument[1] = (double) (0xcafe << 23); + + result = get_significands (&argument); + if ((result[0] != 0xbabe) || (result[1] != 0xcafe)) + abort(); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-10.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-10.c new file mode 100644 index 00000000000..eacd2f83fc3 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-10.c @@ -0,0 +1,44 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +__vector float +make_floats (__vector float *significands_p, + __vector unsigned int *exponents_p) +{ + __vector float significands = *significands_p; + __vector unsigned int exponents = *exponents_p; + + return vec_insert_exp (significands, exponents); +} + +int +main () +{ + __vector unsigned int significands; + __vector float *significands_p = (__vector float *) &significands; + __vector unsigned int exponents; + __vector float result; + + /* 24 bits in significand, plus the sign bit: 0x80ffffff */ + significands[0] = 0x00800000; /* 1 */ + significands[1] = 0x00c00000; /* 3 */ + significands[2] = 0x80e00000; /* 7 */ + significands[3] = 0x80c00000; /* -3 */ + + exponents[0] = 127; /* 1.0 */ + exponents[1] = 128; /* 30.0 */ + exponents[2] = 129; /* 700.0 */ + exponents[3] = 125; /* -0.03 */ + + result = make_floats (significands_p, &exponents); + if ((result[0] != 1.0f) + (result[1] != 30.0f) || (result[2] != 700.0f) || (result[3] != -0.03f)) + abort(); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-11.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-11.c new file mode 100644 index 00000000000..a843db8e4ed --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-11.c @@ -0,0 +1,39 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +__vector double +make_doubles (__vector double *significands_p, + __vector unsigned long long int *exponents_p) +{ + __vector double significands = *significands_p; + __vector unsigned long long int exponents = *exponents_p; + + return vec_insert_exp (significands, exponents); +} + +int +main () +{ + __vector unsigned long long int significands; + __vector double *significands_p = (__vector double *) &significands; + __vector unsigned long long int exponents; + __vector double result; + + /* 53 bits in significand, plus the sign bit: 0x8000_0000_0000_0000 */ + significands[0] = 0x0010000000000000; /* 1 */ + significands[1] = 0x801c000000000000; /* -7 */ + + exponents[0] = 1023; /* 1.0 */ + exponents[1] = 1021; /* -0.07 */ + + result = make_floats (significands_p, &exponents); + if ((result[0] != 1.0) || (result[1] != -0.07) + abort(); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-8.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-8.c new file mode 100644 index 00000000000..cffed42646c --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-8.c @@ -0,0 +1,43 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +__vector float +make_floats (__vector unsigned int *significands_p, + __vector unsigned int *exponents_p) +{ + __vector unsigned int significands = *significands_p; + __vector unsigned int exponents = *exponents_p; + + return vec_insert_exp (significands, exponents); +} + +int +main () +{ + __vector unsigned int significands; + __vector unsigned int exponents; + __vector float result; + + /* 24 bits in significand, plus the sign bit: 0x80ffffff */ + significands[0] = 0x00800000; /* 1 */ + significands[1] = 0x00c00000; /* 3 */ + significands[2] = 0x80e00000; /* 7 */ + significands[3] = 0x80c00000; /* -3 */ + + exponents[0] = 127; /* 1.0 */ + exponents[1] = 128; /* 30.0 */ + exponents[2] = 129; /* 700.0 */ + exponents[3] = 125; /* -0.03 */ + + result = make_floats (&significands, &exponents); + if ((result[0] != 1.0f) + (result[1] != 30.0f) || (result[2] != 700.0f) || (result[3] != -0.03f)) + abort(); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-9.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-9.c new file mode 100644 index 00000000000..c5f7e3bd3ca --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-insert-exp-9.c @@ -0,0 +1,38 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +__vector double +make_doubles (__vector unsigned long long int *significands_p, + __vector unsigned long long int *exponents_p) +{ + __vector unsigned long long int significands = *significands_p; + __vector unsigned long long int exponents = *exponents_p; + + return vec_insert_exp (significands, exponents); +} + +int +main () +{ + __vector unsigned long long int significands; + __vector unsigned long long int exponents; + __vector double result; + + /* 53 bits in significand, plus the sign bit: 0x8000_0000_0000_0000 */ + significands[0] = 0x0010000000000000; /* 1 */ + significands[1] = 0x801c000000000000; /* -7 */ + + exponents[0] = 1023; /* 1.0 */ + exponents[1] = 1021; /* -0.07 */ + + result = make_floats (&significands, &exponents); + if ((result[0] != 1.0) || (result[1] != -0.07) + abort(); + return 0; +} + diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-8.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-8.c new file mode 100644 index 00000000000..ae3af0c3566 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-8.c @@ -0,0 +1,101 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +/* Flags to select tests: + 0x40 Test for NaN + 0x20 Test for +Infinity + 0x10 Test for -Infinity + 0x08 Test for +Zero + 0x04 Test for -Zero + 0x02 Test for +Denormal + 0x01 Test for -Denormal */ + +__vector bool int +test_nan (__vector float *p) +{ + __vector float source = *p; + + return vec_test_data_class (source, 0x40); +} + +__vector bool int +test_infinity (__vector float *p) +{ + __vector float source = *p; + + return vec_test_data_class (source, 0x30); +} + +__vector bool int +test_zero (__vector float *p) +{ + __vector float source = *p; + + return vec_test_data_class (source, 0x0c); +} + +__vector bool int +test_denormal (__vector float *p) +{ + __vector float source = *p; + + return vec_test_data_class (source, 0x03); +} + +int +main () +{ + __vector float argument; + __vector bool result; + + unsigned int signaling_significand = 0x00a00000; + unsigned int quiet_significand = 0x00c00000; + unsigned int one_significand = 0x00800000; + unsigned int three_significand = 0x00800000; + unsigned int zero_significand = 0x00000000; + unsigned int minus_zero_significand = 0x80000000; + + /* A NaN is represented with the maximum biased exponent value and a + * non-zero fraction value. The sign bit ignored. If the + * high-order bit of the fraction field is 0, then the NaN + * is a Signaling NaN. Otherwise, it is a Quiet NaN. */ + argument[0] = scalar_insert_exp (signaling_significand, 255); + argument[1] = scalar_insert_exp (quiet_significand, 255); + argument[2] = 1.0f; + argument[3] = -0.07f; + result = test_nan (&argument); + if (!result[0] || !result[1] || result[2] || result[3]) + abort (); + + /* Infinity is represented by a biased exponent value of: + * 255 in single format + * 2047 in double format + * and a zero fraction value. The difference between +infinity and + * -infinity is the value of the sign bit. */ + argument[2] = scalar_insert_exp (zero_significand, 255); + argument[3] = scalar_insert_exp (minus_zero_significand, 255); + result = test_infinity (&argument); + if (result[0] || result[1] || !result[2] || !result[3]) + abort (); + + /* A Zero value has a biased exponent value of zero and a zero + * fraction value. The sign may be either positive or negative. */ + argument[1] = scalar_insert_exp (minus_zero_significand, 0); + argument[2] = scalar_insert_exp (zero_significand, 0); + result = test_zero (&argument); + if (result[0] || !result[1] || !result[2] || result[3]) + abort (); + + /* A Denormal number has a biased exponent value of zero and a + * non-zero fraction value. */ + argument[0] = scalar_insert_exp (one_significand, 0); + argument[4] = scalar_insert_exp (three_significand, 0); + result = test_denormal (&argument); + if (!result[0] || result[1] || result[2] || !result[3]) + abort (); +} diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-9.c b/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-9.c new file mode 100644 index 00000000000..6e7367b4f41 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/bfp/vec-test-data-class-9.c @@ -0,0 +1,122 @@ +/* { dg-do run { target { powerpc*-*-* } } } */ +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */ +/* { dg-require-effective-target p9vector_hw } */ +/* { dg-options "-mcpu=power9" } */ + +#include <altivec.h> +#include <stdlib.h> + +/* Flags to select tests: + 0x40 Test for NaN + 0x20 Test for +Infinity + 0x10 Test for -Infinity + 0x08 Test for +Zero + 0x04 Test for -Zero + 0x02 Test for +Denormal + 0x01 Test for -Denormal */ + +__vector bool long long int +test_nan (__vector double *p) +{ + __vector double source = *p; + + return vec_test_data_class (source, 0x40); +} + +__vector bool long long int +test_infinity (__vector double *p) +{ + __vector double source = *p; + + return vec_test_data_class (source, 0x30); +} + +__vector bool long long int +test_zero (__vector double *p) +{ + __vector double source = *p; + + return vec_test_data_class (source, 0x0c); +} + +__vector bool long long int +test_denormal (__vector double *p) +{ + __vector double source = *p; + + return vec_test_data_class (source, 0x03); +} + +int +main () +{ + __vector double special_argument; + __vector double nonspecial_argument; + __vector double result; + + unsigned long long int signaling_significand = + 0x0001_7000_0000_0000_0000_0000_0000_0000; + unsigned long long int quiet_significand = + 0x0001_f000_0000_0000_0000_0000_0000_0000; + unsigned long long int one_significand = + 0x0001_0000_0000_0000_0000_0000_0000_0000; + unsigned long long int three_significand = + 0x0001_8000_0000_0000_0000_0000_0000_0000; + unsigned long long int zero_significand = + 0x0000_0000_0000_0000_0000_0000_0000_0000; + unsigned long long int minus_zero_significand = + 0x8000_0000_0000_0000_0000_0000_0000_0000; + + nonspecial_argument[0] = -3.825; + nonspecial_argument[1] = 3.14159; + + /* A NaN is represented with the maximum biased exponent value and a + * non-zero fraction value. The sign bit ignored. If the + * high-order bit of the fraction field is 0, then the NaN + * is a Signaling NaN. Otherwise, it is a Quiet NaN. */ + special_argument[0] = scalar_insert_exp (signaling_significand, 2047); + special_argument[1] = scalar_insert_exp (quiet_significand, 2047); + result = test_nan (&special_argument); + if (!result[0] || !result[1]) + abort (); + result = test_nan (&nonspecial_argument); + if (result[0] || result[1]) + abort (); + + /* Infinity is represented by a biased exponent value of: + * 255 in single format + * 2047 in double format + * and a zero fraction value. The difference between +infinity and + * -infinity is the value of the sign bit. */ + special_argument[0] = scalar_insert_exp (zero_significand, 2047); + special_argument[1] = scalar_insert_exp (minus_zero_significand, 2047); + result = test_infinity (&special_argument); + if (!result[0] || !result[1]) + abort (); + result = test_infinity (&nonspecial_argument); + if (result[0] || result[1]) + abort (); + + /* A Zero value has a biased exponent value of zero and a zero + * fraction value. The sign may be either positive or negative. */ + special_argument[0] = scalar_insert_exp (minus_zero_significand, 0); + special_argument[1] = scalar_insert_exp (zero_significand, 0); + result = test_zero (&special_argument); + if (!result[0] || !result[1]) + abort (); + result = test_zero (&nonspecial_argument); + if (result[0] || result[1]) + abort (); + + /* A Denormal number has a biased exponent value of zero and a + * non-zero fraction value. */ + special_argument[0] = scalar_insert_exp (one_significand, 0); + special_argument[1] = scalar_insert_exp (three_significand, 0); + result = test_denormal (&special_argument); + if (!result[0] || !result[1]) + abort (); + result = test_denormal (&nonspecial_argument); + if (result[0] || result[1]) + abort (); +} + |