summaryrefslogtreecommitdiffstats
path: root/src/testlib/doc/snippets/code
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2019-08-05 21:29:02 -0700
committerThiago Macieira <thiago.macieira@intel.com>2019-08-08 20:29:32 -0700
commit48b3ec6e8e4be23e0d4620fb32b8c7faf082569d (patch)
treed3a1c5f1e2b6949460a1694d89ddce6fea34c4f6 /src/testlib/doc/snippets/code
parentc76b86aec64c4098434340ec17a26d7b2a32338e (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/testlib/doc/snippets/code')
0 files changed, 0 insertions, 0 deletions