From: Christophe Lyon <christophe.lyon@linaro.org>
To: Alan Lawrence <alan.lawrence@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 14/15][ARM/AArch64 Testsuite]Add test of vcvt{,_high}_i{f32_f16,f16_f32}
Date: Tue, 25 Aug 2015 14:22:00 -0000 [thread overview]
Message-ID: <CAKdteOYvjUMDB6CSSeL1NndM3Jv3Y6_ckWY8yGiR-tJRfqdMAw@mail.gmail.com> (raw)
In-Reply-To: <1440511043-7622-1-git-send-email-alan.lawrence@arm.com>
On 25 August 2015 at 15:57, Alan Lawrence <alan.lawrence@arm.com> wrote:
> Sorry - wrong version posted. The hunk for add_options_for_arm_neon_fp16 has
> moved to the previous patch! This version also fixes some whitespace issues.
>
This looks OK to me now, thanks.
> gcc/testsuite/ChangeLog:
>
> * gcc.target/aarch64/advsimd-intrinsics/vcvt_f16.c: New.
> * lib/target-supports.exp
> (check_effective_target_arm_neon_fp16_hw_ok): New.
> ---
> .../aarch64/advsimd-intrinsics/vcvt_f16.c | 98 ++++++++++++++++++++++
> gcc/testsuite/lib/target-supports.exp | 15 ++++
> 2 files changed, 113 insertions(+)
> create mode 100644 gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvt_f16.c
>
> diff --git a/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvt_f16.c b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvt_f16.c
> new file mode 100644
> index 0000000..a2cfd38
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/aarch64/advsimd-intrinsics/vcvt_f16.c
> @@ -0,0 +1,98 @@
> +/* { dg-require-effective-target arm_neon_fp16_hw_ok { target { arm*-*-* } } } */
> +#include <arm_neon.h>
> +#include "arm-neon-ref.h"
> +#include "compute-ref-data.h"
> +#include <math.h>
> +
> +/* Expected results for vcvt. */
> +VECT_VAR_DECL (expected,hfloat,32,4) [] = { 0x41800000, 0x41700000,
> + 0x41600000, 0x41500000 };
> +VECT_VAR_DECL (expected,hfloat,16,4) [] = { 0x3e00, 0x4100, 0x4300, 0x4480 };
> +
> +/* Expected results for vcvt_high_f32_f16. */
> +VECT_VAR_DECL (expected_high,hfloat,32,4) [] = { 0xc1400000, 0xc1300000,
> + 0xc1200000, 0xc1100000 };
> +/* Expected results for vcvt_high_f16_f32. */
> +VECT_VAR_DECL (expected_high,hfloat,16,8) [] = { 0x4000, 0x4000, 0x4000, 0x4000,
> + 0xcc00, 0xcb80, 0xcb00, 0xca80 };
> +
> +void
> +exec_vcvt (void)
> +{
> + clean_results ();
> +
> +#define TEST_MSG vcvt_f32_f16
> + {
> + VECT_VAR_DECL (buffer_src, float, 16, 4) [] = { 16.0, 15.0, 14.0, 13.0 };
> +
> + DECL_VARIABLE (vector_src, float, 16, 4);
> +
> + VLOAD (vector_src, buffer_src, , float, f, 16, 4);
> + DECL_VARIABLE (vector_res, float, 32, 4) =
> + vcvt_f32_f16 (VECT_VAR (vector_src, float, 16, 4));
> + vst1q_f32 (VECT_VAR (result, float, 32, 4),
> + VECT_VAR (vector_res, float, 32, 4));
> +
> + CHECK_FP (TEST_MSG, float, 32, 4, PRIx32, expected, "");
> + }
> +#undef TEST_MSG
> +
> + clean_results ();
> +
> +#define TEST_MSG vcvt_f16_f32
> + {
> + VECT_VAR_DECL (buffer_src, float, 32, 4) [] = { 1.5, 2.5, 3.5, 4.5 };
> + DECL_VARIABLE (vector_src, float, 32, 4);
> +
> + VLOAD (vector_src, buffer_src, q, float, f, 32, 4);
> + DECL_VARIABLE (vector_res, float, 16, 4) =
> + vcvt_f16_f32 (VECT_VAR (vector_src, float, 32, 4));
> + vst1_f16 (VECT_VAR (result, float, 16, 4),
> + VECT_VAR (vector_res, float, 16 ,4));
> +
> + CHECK_FP (TEST_MSG, float, 16, 4, PRIx16, expected, "");
> + }
> +#undef TEST_MSG
> +
> +#if defined (__aarch64__)
> + clean_results ();
> +
> +#define TEST_MSG "vcvt_high_f32_f16"
> + {
> + DECL_VARIABLE (vector_src, float, 16, 8);
> + VLOAD (vector_src, buffer, q, float, f, 16, 8);
> + DECL_VARIABLE (vector_res, float, 32, 4);
> + VECT_VAR (vector_res, float, 32, 4) =
> + vcvt_high_f32_f16 (VECT_VAR (vector_src, float, 16, 8));
> + vst1q_f32 (VECT_VAR (result, float, 32, 4),
> + VECT_VAR (vector_res, float, 32, 4));
> + CHECK_FP (TEST_MSG, float, 32, 4, PRIx32, expected_high, "");
> + }
> +#undef TEST_MSG
> + clean_results ();
> +
> +#define TEST_MSG "vcvt_high_f16_f32"
> + {
> + DECL_VARIABLE (vector_low, float, 16, 4);
> + VDUP (vector_low, , float, f, 16, 4, 2.0);
> +
> + DECL_VARIABLE (vector_src, float, 32, 4);
> + VLOAD (vector_src, buffer, q, float, f, 32, 4);
> +
> + DECL_VARIABLE (vector_res, float, 16, 8) =
> + vcvt_high_f16_f32 (VECT_VAR (vector_low, float, 16, 4),
> + VECT_VAR (vector_src, float, 32, 4));
> + vst1q_f16 (VECT_VAR (result, float, 16, 8),
> + VECT_VAR (vector_res, float, 16, 8));
> +
> + CHECK_FP (TEST_MSG, float, 16, 8, PRIx16, expected_high, "");
> + }
> +#endif
> +}
> +
> +int
> +main (void)
> +{
> + exec_vcvt ();
> + return 0;
> +}
> diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
> index 9aec02d..0a22c95 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -2730,6 +2730,21 @@ proc check_effective_target_arm_neon_fp16_ok { } {
> check_effective_target_arm_neon_fp16_ok_nocache]
> }
>
> +proc check_effective_target_arm_neon_fp16_hw_ok { } {
> + if {! [check_effective_target_arm_neon_fp16_ok] } {
> + return 0
> + }
> + global et_arm_neon_fp16_flags
> + check_runtime_nocache arm_neon_fp16_hw_ok {
> + int
> + main (int argc, char **argv)
> + {
> + asm ("vcvt.f32.f16 q1, d0");
> + return 0;
> + }
> + } $et_arm_neon_fp16_flags
> +}
> +
> proc add_options_for_arm_neon_fp16 { flags } {
> if { ! [check_effective_target_arm_neon_fp16_ok] } {
> return "$flags"
> --
> 1.8.3
>
next prev parent reply other threads:[~2015-08-25 14:21 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 11:23 [PATCH 0/15][ARM/AArch64] Add support for float16_t vectors (v3) Alan Lawrence
2015-07-28 11:24 ` [PATCH 1/15][ARM] Hide existing float16 intrinsics unless we have a scalar __fp16 type Alan Lawrence
2015-07-29 14:53 ` Kyrill Tkachov
2015-08-20 13:45 ` Alan Lawrence
2015-07-28 11:24 ` [PATCH 3/15][ARM] Add V8HFmode and float16x8_t type Alan Lawrence
2015-07-29 15:12 ` Kyrill Tkachov
2015-07-28 11:24 ` [PATCH 2/15][ARM] float16x4_t intrinsics in arm_neon.h Alan Lawrence
2015-07-29 15:08 ` Kyrill Tkachov
2015-07-28 11:25 ` [PATCH 6/15][AArch64] Add basic FP16 support Alan Lawrence
2015-07-29 10:09 ` James Greenhalgh
2015-07-28 11:25 ` [PATCH 5/15][ARM] Remaining intrinsics Alan Lawrence
2015-08-04 11:12 ` Kyrill Tkachov
2015-07-28 11:25 ` [PATCH 4/15][ARM] float16x8_t intrinsics in arm_neon.h Alan Lawrence
2015-07-31 9:51 ` Kyrill Tkachov
2015-07-28 11:26 ` [PATCH 8/15][AArch64] Add support for float14x{4,8}_t vectors/builtins Alan Lawrence
2015-07-29 10:46 ` James Greenhalgh
2015-07-30 12:26 ` [AArch64] Remove unused VRL2/3/4 iterator values (was: Re: [PATCH 8/15][AArch64] Add support for float14x{4,8}_t vectors/builtins) Alan Lawrence
2015-07-30 13:02 ` James Greenhalgh
2015-07-30 15:13 ` [AArch64] Remove unused VRL2/3/4 iterator values Alan Lawrence
2015-07-30 16:01 ` James Greenhalgh
2015-08-04 11:01 ` [PATCH 8/15][AArch64] Add support for float16x{4,8}_t vectors/builtins Alan Lawrence
2015-08-04 11:13 ` Alan Lawrence
2015-08-17 13:19 ` James Greenhalgh
2015-07-28 11:26 ` [PATCH 10/15][AArch64] Implement vcvt_{,high_}f16_f32 Alan Lawrence
2015-07-29 9:10 ` James Greenhalgh
2015-07-29 9:18 ` Alan Lawrence
2015-07-29 11:39 ` James Greenhalgh
2015-07-28 11:26 ` [PATCH 7/15][ARM/AArch64 Testsuite] Add basic fp16 tests Alan Lawrence
2015-07-29 10:16 ` James Greenhalgh
2015-07-28 11:27 ` [PATCH 11/15][AArch64] vreinterpret(q?), vget_(low|high), vld1(q?)_dup Alan Lawrence
2015-07-29 13:18 ` James Greenhalgh
2015-08-24 9:19 ` Alan Lawrence
2015-09-04 10:18 ` James Greenhalgh
2015-09-07 13:10 ` [PATCH][AArch64] Improve code generation for float16 vector code Alan Lawrence
2015-09-08 8:26 ` James Greenhalgh
2015-09-08 8:26 ` James Greenhalgh
2015-09-08 12:03 ` Alan Lawrence
2015-09-08 8:33 ` [PATCH 11/15][AArch64] vreinterpret(q?), vget_(low|high), vld1(q?)_dup James Greenhalgh
2015-07-28 11:27 ` [PATCH 15/15][ARM] Update sourcebuild.texi with testsuite/effective-target hooks Alan Lawrence
2015-09-08 14:03 ` Alan Lawrence
2015-09-08 14:20 ` Kyrill Tkachov
2015-07-28 11:27 ` [PATCH 9/15][AArch64] vld{2,3,4}{,_lane,_dup}, vcombine, vcreate Alan Lawrence
2015-07-29 9:15 ` James Greenhalgh
2015-08-04 11:03 ` Alan Lawrence
2015-08-04 11:28 ` Alan Lawrence
2015-08-04 11:07 ` [PATCH][ARM/AArch64 Testsuite] Add float16 lane_indices tests (was: Re: [PATCH 9/15][AArch64] vld{2,3,4}{,_lane,_dup}, vcombine, vcreate) Alan Lawrence
2015-08-17 13:35 ` James Greenhalgh
2015-08-06 16:28 ` [PATCH 9/15][AArch64] vld{2,3,4}{,_lane,_dup}, vcombine, vcreate Alan Lawrence
2015-08-17 13:21 ` James Greenhalgh
2015-07-28 11:27 ` [PATCH 14/15][ARM/AArch64 Testsuite]Add test of vcvt{,_high}_{f16_f32,f32_f16} Alan Lawrence
2015-08-25 13:28 ` Christophe Lyon
2015-08-25 14:07 ` Alan Lawrence
2015-08-25 13:59 ` [PATCH 14/15][ARM/AArch64 Testsuite]Add test of vcvt{,_high}_i{f32_f16,f16_f32} Alan Lawrence
2015-08-25 14:22 ` Christophe Lyon [this message]
2015-09-08 11:00 ` Alan Lawrence
2015-09-08 11:17 ` Kyrill Tkachov
2015-09-22 14:42 ` Marcus Shawcroft
2015-07-28 11:42 ` [PATCH 12/15][AArch64] Add vcvt(_high)?_f32_f16 intrinsics, with BE RTL fix Alan Lawrence
2015-07-29 14:08 ` James Greenhalgh
2015-08-25 11:06 ` Alan Lawrence
2015-09-04 9:54 ` James Greenhalgh
2015-07-28 11:48 ` [PATCH 13/15][ARM/AArch64 Testsuite] Add float16 tests to advsimd-intrinsics testsuite Alan Lawrence
2015-08-25 13:27 ` Christophe Lyon
2015-08-25 13:29 ` Alan Lawrence
2015-09-08 10:56 ` Alan Lawrence
2015-09-08 10:56 ` Kyrill Tkachov
2015-09-08 11:09 ` Kyrill Tkachov
2015-08-25 12:54 ` [PATCH 0/15][ARM/AArch64] Add support for float16_t vectors (v3) Alan Lawrence
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAKdteOYvjUMDB6CSSeL1NndM3Jv3Y6_ckWY8yGiR-tJRfqdMAw@mail.gmail.com \
--to=christophe.lyon@linaro.org \
--cc=alan.lawrence@arm.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).