public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ramana Radhakrishnan <ramana.gcc@googlemail.com>
To: Matthew Wahab <matthew.wahab@foss.arm.com>
Cc: Joseph Myers <joseph@codesourcery.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 9/17][ARM] Add NEON FP16 arithmetic instructions.
Date: Thu, 28 Jul 2016 11:53:00 -0000	[thread overview]
Message-ID: <CAJA7tRaSrQCnNjp9=pXxCbkimge5VZ7g8WQpapNQMMAJhQvRbQ@mail.gmail.com> (raw)
In-Reply-To: <577A6E09.5020607@foss.arm.com>

On Mon, Jul 4, 2016 at 3:09 PM, Matthew Wahab
<matthew.wahab@foss.arm.com> wrote:
> On 18/05/16 01:58, Joseph Myers wrote:
>> On Tue, 17 May 2016, Matthew Wahab wrote:
>>
>>> As with the VFP FP16 arithmetic instructions, operations on __fp16
>>> values are done by conversion to single-precision. Any new optimization
>>> supported by the instruction descriptions can only apply to code
>>> generated using intrinsics added in this patch series.
>>
>> As with the scalar instructions, I think it is legitimate in most cases to
>> optimize arithmetic via single precision to work direct on __fp16 values
>> (and this would be natural for vectorization of __fp16 arithmetic).
>>
>>> A number of the instructions are modelled as two variants, one using
>>> UNSPEC and the other using RTL operations, with the model used decided
>>> by the funsafe-math-optimizations flag. This follows the
>>> single-precision instructions and is due to the half-precision
>>> operations having the same conditions and restrictions on their use in
>>> optmizations (when they are enabled).
>>
>> (Of course, these restrictions still apply.)
>
> The F16 support generally follows the F32 implementation and, for F32,
> direct arithmetic vector operations are only available when
> unsafe-math-optimizations is enabled. I want to check the behaviour of
> the F16 operations when unsafe-math is enabled so I'll defer to a follow
> up patch the change to use standard names for the vector operations.
>
> There are still some changes from the previous patch:
>
> - Two fma/fmsub patterns *fma<VH:mode>4 and <*fmsub<VH:mode>4 are
>   dropped since they just duplicated *fma<VH:mode>4_intrinsic and
>   <*fmsub<VH:mode>4_intrinsic.
>
> - Patterns neon_vadd<mode>_unspec and neon_vsub<mode>_unspec are
>   dropped, they were redundant.
>
> - <absneg_str><mode>2_fp16 is renamed to <absneg_str><mode>2. This
>   implements the abs and neg operations which are always safe to use.
>
> - neon_vsqrte<mode> is renamed to neon_vrsqrte<mode>. This is a
>   misspelled intrinsic that wasn't caught in testing because the
>   relevant test case is missing. The intrinsic is fixed here and in
>   other patches and an advsimd-intrinsics test added later in the
>   (updated) series.
>
> - neon_vcvt<sup>_n<mode: The bounds on the scalar were wrong, the
>   correct range for f16 is 0-17.
>
> - Test armv8_2-fp16-arith-1.c is updated to expect f16 arithmetic
>   instructions rather then f32 and to use the neon command line options.
>
> Tested the series for arm-none-linux-gnueabihf with native bootstrap and
> make check and for arm-none-eabi and armeb-none-eabi with make check on
> an ARMv8.2-A emulator.
>
> Ok for trunk?

OK.

Ramana
> Matthew
>
> 2016-07-04  Matthew Wahab  <matthew.wahab@arm.com>
>
>         * config/arm/iterators.md (VCVTHI): New.
>         (NEON_VCMP): Add UNSPEC_VCLT and UNSPEC_VCLE.  Fix a long line.
>         (NEON_VAGLTE): New.
>         (VFM_LANE_AS): New.
>         (VH_CVTTO): New.
>         (V_reg): Add HF, V4HF and V8HF.  Fix white-space.
>         (V_HALF): Add V4HF.  Fix white-space.
>         (V_if_elem): Add HF, V4HF and V8HF.  Fix white-space.
>         (V_s_elem): Likewise.
>         (V_sz_elem): Fix white-space.
>         (V_elem_ch): Likewise.
>         (VH_elem_ch): New.
>         (scalar_mul_constraint): Add V8HF and V4HF.
>         (Is_float_mode): Fix white-space.
>         (Is_d_reg): Fix white-space.
>         (q): Add HF.  Fix white-space.
>         (float_sup): New.
>         (float_SUP): New.
>         (cmp_op_unsp): Add UNSPEC_VCALE and UNSPEC_VCALT.
>         (neon_vfm_lane_as): New.
>         * config/arm/neon.md (add<mode>3_fp16): New.
>         (sub<mode>3_fp16): New.
>         (mul<mode>3add<mode>_neon): New.
>         (fma<VH:mode>4_intrinsic): New.
>         (fmsub<VCVTF:mode>4_intrinsic): Fix white-space.
>         (fmsub<VH:mode>4_intrinsic): New.
>         (<absneg_str><mode>2): New.
>         (neon_v<absneg_str><mode>): New.
>         (neon_v<fp16_rnd_str><mode>): New.
>         (neon_vrsqrte<mode>): New.
>         (neon_vpaddv4hf): New.
>         (neon_vadd<mode>): New.
>         (neon_vsub<mode>): New.
>         (neon_vmulf<mode>): New.
>         (neon_vfma<VH:mode>): New.
>         (neon_vfms<VH:mode>): New.
>         (neon_vc<cmp_op><mode>): New.
>         (neon_vc<cmp_op><mode>_fp16insn): New
>         (neon_vc<cmp_op_unsp><mode>_fp16insn_unspec): New.
>         (neon_vca<cmp_op><mode>): New.
>         (neon_vca<cmp_op><mode>_fp16insn): New.
>         (neon_vca<cmp_op_unsp><mode>_fp16insn_unspec): New.
>         (neon_vc<cmp_op>z<mode>): New.
>         (neon_vabd<mode>): New.
>         (neon_v<maxmin>f<mode>): New.
>         (neon_vp<maxmin>fv4hf: New.
>         (neon_<fmaxmin_op><mode>): New.
>         (neon_vrecps<mode>): New.
>         (neon_vrsqrts<mode>): New.
>         (neon_vrecpe<mode>): New (VH variant).
>         (neon_vdup_lane<mode>_internal): New.
>         (neon_vdup_lane<mode>): New.
>         (neon_vcvt<sup><mode>): New (VCVTHI variant).
>         (neon_vcvt<sup><mode>): New (VH variant).
>         (neon_vcvt<sup>_n<mode>): New (VH variant).
>         (neon_vcvt<sup>_n<mode>): New (VCVTHI variant).
>         (neon_vcvt<vcvth_op><sup><mode>): New.
>         (neon_vmul_lane<mode>): New.
>         (neon_vmul_n<mode>): New.
>         * config/arm/unspecs.md (UNSPEC_VCALE): New
>         (UNSPEC_VCALT): New.
>         (UNSPEC_VFMA_LANE): New.
>         (UNSPECS_VFMS_LANE): New.
>
> testsuite/
> 2016-07-04  Matthew Wahab  <matthew.wahab@arm.com>
>
>         * gcc.target/arm/armv8_2-fp16-arith-1.c: Use arm_v8_2a_fp16_neon
>         options.  Add tests for float16x4_t and float16x8_t.
>

  reply	other threads:[~2016-07-28 11:53 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-17 14:20 [PATCH 0/17][ARM] ARMv8.2-A and FP16 extension support Matthew Wahab
2016-05-17 14:23 ` [PATCH 1/17][ARM] Add ARMv8.2-A command line option and profile Matthew Wahab
2016-07-04 13:46   ` Matthew Wahab
2016-09-21 13:57     ` Ramana Radhakrishnan
2016-05-17 14:25 ` [PATCH 2/17][Testsuite] Add a selector for ARM FP16 alternative format support Matthew Wahab
2016-07-27 13:34   ` Ramana Radhakrishnan
2016-05-17 14:26 ` [PATCH 3/17][Testsuite] Add ARM support for ARMv8.2-A with FP16 arithmetic instructions Matthew Wahab
2016-07-04 13:49   ` Matthew Wahab
2016-07-27 13:34     ` Ramana Radhakrishnan
2016-05-17 14:28 ` [PATCH 4/17][ARM] Define feature macros for FP16 Matthew Wahab
2016-07-27 13:35   ` Ramana Radhakrishnan
2016-05-17 14:29 ` [PATCH 5/17][ARM] Enable HI mode moves for floating point values Matthew Wahab
2016-07-27 13:57   ` Ramana Radhakrishnan
2016-09-26 13:20     ` Christophe Lyon
2016-09-26 13:26       ` Matthew Wahab
2016-05-17 14:32 ` [PATCH 6/17][ARM] Add data processing intrinsics for float16_t Matthew Wahab
2016-07-27 13:59   ` Ramana Radhakrishnan
2016-09-25 14:44     ` Christophe Lyon
2016-09-26  9:56       ` Matthew Wahab
2016-09-26 12:54         ` Christophe Lyon
2016-09-26 13:11           ` Ramana Radhakrishnan
2016-09-26 13:19             ` Matthew Wahab
2016-09-26 13:21             ` Christophe Lyon
2016-09-26 20:02               ` Christophe Lyon
2016-05-17 14:34 ` [PATCH 7/17][ARM] Add FP16 data movement instructions Matthew Wahab
2016-07-04 13:57   ` Matthew Wahab
2016-07-27 14:01     ` Ramana Radhakrishnan
2016-05-17 14:36 ` [PATCH 8/17][ARM] Add VFP FP16 arithmetic instructions Matthew Wahab
2016-05-18  0:52   ` Joseph Myers
2016-05-18  0:57     ` Joseph Myers
2016-05-18 13:40     ` Matthew Wahab
2016-05-18 15:21       ` Joseph Myers
2016-05-19 14:54         ` Matthew Wahab
2016-07-04 14:02   ` Matthew Wahab
2016-07-28 11:37     ` Ramana Radhakrishnan
2016-08-03 11:52       ` Ramana Radhakrishnan
2016-08-03 13:10         ` Matthew Wahab
2016-08-03 14:45         ` James Greenhalgh
2016-08-03 17:44         ` Joseph Myers
2016-05-17 14:37 ` [PATCH 9/17][ARM] Add NEON " Matthew Wahab
2016-05-18  0:58   ` Joseph Myers
2016-05-19 17:01     ` Jiong Wang
2016-05-19 17:29       ` Joseph Myers
2016-06-08  8:46         ` James Greenhalgh
2016-06-08 20:02           ` Joseph Myers
2016-07-04 14:09     ` Matthew Wahab
2016-07-28 11:53       ` Ramana Radhakrishnan [this message]
2016-05-17 14:39 ` [PATCH 10/17][ARM] Refactor support code for NEON builtins Matthew Wahab
2016-07-28 11:54   ` Ramana Radhakrishnan
2016-12-05 16:47     ` [arm-embedded][committed][PATCH 10/17] " Andre Vieira (lists)
2016-05-17 14:41 ` [PATCH 11/17][ARM] Add builtins for VFP FP16 intrinsics Matthew Wahab
2016-07-04 14:12   ` Matthew Wahab
2016-07-28 11:55     ` Ramana Radhakrishnan
2016-05-17 14:43 ` [PATCH 12/17][ARM] Add builtins for NEON " Matthew Wahab
2016-07-04 14:13   ` Matthew Wahab
2016-07-28 11:56     ` Ramana Radhakrishnan
2016-05-17 14:44 ` [PATCH 13/17][ARM] Add VFP FP16 instrinsics Matthew Wahab
2016-07-04 14:14   ` Matthew Wahab
2016-07-28 11:57     ` Ramana Radhakrishnan
2016-05-17 14:47 ` [PATCH 14/17][ARM] Add NEON " Matthew Wahab
2016-07-04 14:16   ` Matthew Wahab
2016-08-03 12:57     ` Ramana Radhakrishnan
2016-05-17 14:49 ` [PATCH 15/17][ARM] Add tests for ARMv8.2-A FP16 support Matthew Wahab
2016-07-04 14:17   ` Matthew Wahab
2016-08-04  8:34     ` Ramana Radhakrishnan
2016-05-17 14:51 ` [PATCH 16/17][ARM] Add tests for VFP FP16 ACLE instrinsics Matthew Wahab
2016-05-18  1:07   ` Joseph Myers
2016-05-18 10:58     ` Matthew Wahab
2016-07-04 14:18       ` Matthew Wahab
2016-08-04  8:35         ` Ramana Radhakrishnan
2016-05-17 14:52 ` [PATCH 17/17][ARM] Add tests for NEON FP16 ACLE intrinsics Matthew Wahab
2016-07-04 14:22   ` Matthew Wahab
2016-08-04  9:01     ` Ramana Radhakrishnan

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='CAJA7tRaSrQCnNjp9=pXxCbkimge5VZ7g8WQpapNQMMAJhQvRbQ@mail.gmail.com' \
    --to=ramana.gcc@googlemail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=matthew.wahab@foss.arm.com \
    /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).