[PATCH 07/11] Add bitcount inlinesfor RTEMS. These are found in FREEBSDs types.h

Kirspel, Kevin Kevin-Kirspel at idexx.com
Tue May 16 18:40:59 UTC 2017


After doing some research, the GCC default __builtin_popcount functions are slower than the FREEBSD versions (roughly 3.5x slower according to some tests I saw online).  If someone adds the -mpopcnt compile option, then it means that there is a CPU instruction to perform the task.  I think we should do what FREEBSD has done.  Only use the built in functions if there is a CPU instruction to execute it.

I have posted a patch to newlib.

Kevin Kirspel
Electrical Engineer - Sr. Staff
Idexx Roswell
235 Hembree Park Drive
Roswell GA 30076
Tel: (770)-510-4444 ext. 81642
Direct: (770)-688-1642
Fax: (770)-510-4445

-----Original Message-----
From: Sebastian Huber [mailto:sebastian.huber at embedded-brains.de] 
Sent: Tuesday, May 16, 2017 9:28 AM
To: Kirspel, Kevin <Kevin-Kirspel at idexx.com>; devel at rtems.org
Subject: Re: [PATCH 07/11] Add bitcount inlinesfor RTEMS. These are found in FREEBSDs types.h

On 16/05/17 15:18, Kirspel, Kevin wrote:
> Sorry.  I pulled that header file from memory which these days is losing its effectiveness.  So, should we put the bitcount changes in sys/types.h like FREEBSD?
>
> If so, I will submit a patch tonewlib at sourceware.org.  How long does it take to get the patch reviewed by the newlib mailing list?

Between one day and four weeks. If its not included this week, then we can use the alternative.

Please add GCC support for these operations. I think the builtins are available since GCC 3.4.0.

--
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list