[PATCH 1/2] score: Add and use _RBTree_Find_inline()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 1 05:48:15 UTC 2016


On 31/03/16 15:29, Gedare Bloom wrote:
>> +RTEMS_INLINE_ROUTINE bool _POSIX_Keys_Key_value_find_less(
> Patch looks fine. I was just curious, does the compiler actually
> inline this too when it is called through a function pointer?
>

Its good that you asked.

In general GCC is quite good at optimizing this. The generated code for 
the keygetspecific.c is identical before and after the patch.

In keysetspecific.c I noticed some changes since here 
key_value_pair->key was used instead of key for the comparison. I 
changed the _RBTree_Insert_inline() a bit and now the code is nearly 
identical (no performance impact) and we can share the less operator 
with _RBTree_Find_inline():

diff -u keysetspecific.s*
--- keysetspecific.s    2016-04-01 07:43:19.418847367 +0200
+++ keysetspecific.s.inline     2016-04-01 07:43:02.374888977 +0200
@@ -121,6 +121,7 @@
         isync
         cmplw 7,10,9
         bne+ 7,.L13
+       addi 4,3,8
         mr 10,24
         b .L14
         .p2align 4,,15
@@ -134,7 +135,6 @@
         cmpwi 7,9,0
         addi 8,9,4
         bne+ 7,.L17
-       addi 4,3,8
         stw 9,12(3)
         stw 9,8(3)
         li 9,1

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