unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 86c4e5a2fb3: Fix implicit declaration of bswap_{32,64}
@ 2024-03-30  8:16 Eli Zaretskii
  2024-03-30  8:34 ` Andreas Schwab
  2024-03-30 16:44 ` Paul Eggert
  0 siblings, 2 replies; 4+ messages in thread
From: Eli Zaretskii @ 2024-03-30  8:16 UTC (permalink / raw)
  To: Andreas Schwab, Paul Eggert; +Cc: emacs-devel

> branch: master
> commit 86c4e5a2fb3fd6b7acb8a3fc10e1e7c2eb8012a9
> Author: Andreas Schwab <schwab@linux-m68k.org>
> Commit: Andreas Schwab <schwab@linux-m68k.org>
> 
>     Fix implicit declaration of bswap_{32,64}
>     
>     * src/data.c: Move include of <byteswap.h> ...
>     * src/lisp.h: ... here.

Wouldn't it be better to use __builtin_bswap32 when it's available?

Paul, why doesn't Gnulib do that in its byteswap.h header?



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 86c4e5a2fb3: Fix implicit declaration of bswap_{32,64}
  2024-03-30  8:16 master 86c4e5a2fb3: Fix implicit declaration of bswap_{32,64} Eli Zaretskii
@ 2024-03-30  8:34 ` Andreas Schwab
  2024-03-30  8:44   ` Collin Funk
  2024-03-30 16:44 ` Paul Eggert
  1 sibling, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2024-03-30  8:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Paul Eggert, emacs-devel

On Mär 30 2024, Eli Zaretskii wrote:

> Wouldn't it be better to use __builtin_bswap32 when it's available?

The compiler is smart enough to do that by itself.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 86c4e5a2fb3: Fix implicit declaration of bswap_{32,64}
  2024-03-30  8:34 ` Andreas Schwab
@ 2024-03-30  8:44   ` Collin Funk
  0 siblings, 0 replies; 4+ messages in thread
From: Collin Funk @ 2024-03-30  8:44 UTC (permalink / raw)
  To: emacs-devel

On 3/30/24 1:34 AM, Andreas Schwab wrote:
>> Wouldn't it be better to use __builtin_bswap32 when it's available?
> The compiler is smart enough to do that by itself.

The macro would evaluate it's arguments multiple times though right?

This line:

    uint32_t result = bswap_32 (value++);

should increment 'value' once, but would do it four times with a
macro.

Collin



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: master 86c4e5a2fb3: Fix implicit declaration of bswap_{32,64}
  2024-03-30  8:16 master 86c4e5a2fb3: Fix implicit declaration of bswap_{32,64} Eli Zaretskii
  2024-03-30  8:34 ` Andreas Schwab
@ 2024-03-30 16:44 ` Paul Eggert
  1 sibling, 0 replies; 4+ messages in thread
From: Paul Eggert @ 2024-03-30 16:44 UTC (permalink / raw)
  To: Eli Zaretskii, Andreas Schwab; +Cc: emacs-devel

On 3/30/24 02:16, Eli Zaretskii wrote:
> Wouldn't it be better to use __builtin_bswap32 when it's available?
> 
> Paul, why doesn't Gnulib do that in its byteswap.h header?

I think Gnulib byteswap.h predates __builtin_bswap32. Not sure it's 
worth the hassle of using __builtin_bswap32 if available, as (as Andreas 
mentioned) that won't make Emacs go faster in the usual gcc -O2 case.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-30 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-30  8:16 master 86c4e5a2fb3: Fix implicit declaration of bswap_{32,64} Eli Zaretskii
2024-03-30  8:34 ` Andreas Schwab
2024-03-30  8:44   ` Collin Funk
2024-03-30 16:44 ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).