diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2019-08-05 21:29:02 -0700 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2019-08-08 20:29:32 -0700 |
| commit | 48b3ec6e8e4be23e0d4620fb32b8c7faf082569d (patch) | |
| tree | d3a1c5f1e2b6949460a1694d89ddce6fea34c4f6 /src/gui/opengl/qopenglprogrambinarycache.cpp | |
| parent | c76b86aec64c4098434340ec17a26d7b2a32338e (diff) | |
QBitArray: change modulo 8 with bitwise-AND 7
They're the same only for unsigned values. Modulo of negative numbers
since C++11 has an expected behavior and generates more code:
%rax = %rax & 7:
andl $7, %eax
%rax = %rax % 8 with GCC:
cqto
shrq $61, %rdx
addq %rdx, %rax
andl $7, %eax
subq %rdx, %rax
[read as ((%rax + (%rax < 0 ? 7 : 0)) & 7) - (%rax < 0 ? 7 : 0))]
With Clang:
movq %rax, %rcx
sarq $63, %rcx
shrq $61, %rcx
addq %rax, %rcx
andq $-8, %rcx
subq %rcx, %rax
Change-Id: Ife213d861bb14c1787e1fffd15b83b004be7eba0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/opengl/qopenglprogrambinarycache.cpp')
0 files changed, 0 insertions, 0 deletions
