mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-03-30 11:50:37 +02:00
Improve performance of cpu_to_be32 and be32_to_cpu
By switching to the more common form, gcc and clang emit a single bswap instruction and truetype subsetting of large fonts runs about 15% faster.
This commit is contained in:
parent
956ef874c8
commit
ce08735c06
1 changed files with 1 additions and 1 deletions
|
|
@ -229,7 +229,7 @@ be16_to_cpu(uint16_t v)
|
|||
static inline uint32_t cairo_const
|
||||
cpu_to_be32(uint32_t v)
|
||||
{
|
||||
return (cpu_to_be16 (v) << 16) | cpu_to_be16 (v >> 16);
|
||||
return (v >> 24) | ((v >> 8) & 0xff00) | ((v << 8) & 0xff0000) | (v << 24);
|
||||
}
|
||||
|
||||
static inline uint32_t cairo_const
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue