This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add a new macro to mask a float
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>, <munroesj at linux dot vnet dot ibm dot com>
- Date: Tue, 28 Jun 2016 20:51:53 +0000
- Subject: Re: [PATCH] Add a new macro to mask a float
- Authentication-results: sourceware.org; auth=none
- References: <1467142073-13886-1-git-send-email-tuliom at linux dot vnet dot ibm dot com>
On Tue, 28 Jun 2016, Tulio Magno Quites Machado Filho wrote:
> Defining a new macro allows architectures to provide more efficient
> implementations than using a GET_FLOAT_WORD/SET_FLOAT_WORD pair.
> As an example, POWER8 is able to mask the float directly in the VSX
> without copying the data to a GPR and copying it back.
>
> This patch introduces the new macro MASK_FLOAT. The generic
> implementation remains unchanged.
I think this would better be implemented as a compiler optimization that
recognizes the pattern of masking a float value.
Note that language runtimes sometimes include code derived from fdlibm (to
ensure system-independent results rather than results depending on system
libm), so the optimization wouldn't be purely for building glibc.
--
Joseph S. Myers
joseph@codesourcery.com