From e74616b8898b5f18d9bf82b9e81aefad056c1e36 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 15 Apr 2012 14:12:13 -0400 Subject: [PATCH] Add comment --- src/hb-private.hh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hb-private.hh b/src/hb-private.hh index f561260c2..64cb3c864 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -440,6 +440,14 @@ static inline uint16_t hb_be_uint16 (const uint16_t v) return (uint16_t) (V[0] << 8) + V[1]; } +/* Note, of the following macros, uint16_get is the one called many many times. + * If there is any optimizations to be done, it's in that macro. However, I + * already confirmed that on my T400 ThinkPad at least, using bswap_16(), which + * results in a single ror instruction, does NOT speed this up. In fact, it + * resulted in a minor slowdown. At any rate, note that v may not be correctly + * aligned, so I think the current implementation is optimal. + */ + #define hb_be_uint16_put(v,V) HB_STMT_START { v[0] = (V>>8); v[1] = (V); } HB_STMT_END #define hb_be_uint16_get(v) (uint16_t) ((v[0] << 8) + v[1]) #define hb_be_uint16_eq(a,b) (a[0] == b[0] && a[1] == b[1])