Page MenuHomeFreeBSD

amd64 pmap.c: minor codegen optimization in flag access
ClosedPublic

Authored by rlibby on Feb 28 2020, 5:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 6 2024, 3:10 PM
Unknown Object (File)
Oct 14 2024, 9:55 PM
Unknown Object (File)
Sep 30 2024, 1:58 AM
Unknown Object (File)
Sep 23 2024, 7:32 PM
Unknown Object (File)
Sep 23 2024, 4:06 PM
Unknown Object (File)
Sep 20 2024, 8:33 PM
Unknown Object (File)
Sep 20 2024, 3:17 PM
Unknown Object (File)
Sep 19 2024, 3:01 PM
Subscribers

Details

Summary

Following previous revision, apply the same minor optimization to
hand-rolled atomic_fcmpset_128 in pmap.c.

Test Plan

kyua test -k /usr/tests/sys/Kyuafile

Manual inspection of generated code, e.g.

pmap_delayed_invl_start_u:

Before:

ffffffff81052022: 48 c7 c6 e0 5f 97 81  movq    $-2120785952, %rsi
ffffffff81052029: 31 db                 xorl    %ebx, %ebx
ffffffff8105202b: 31 c9                 xorl    %ecx, %ecx
ffffffff8105202d: 31 c0                 xorl    %eax, %eax
ffffffff8105202f: 31 d2                 xorl    %edx, %edx
ffffffff81052031: f0                    lock
ffffffff81052032: 48 0f c7 0e           cmpxchg16b      (%rsi)
ffffffff81052036: 0f 94 c1              sete    %cl
ffffffff81052039: 48 89 c7              movq    %rax, %rdi
ffffffff8105203c: b8 00 00 00 00        movl    $0, %eax
ffffffff81052041: 84 c9                 testb   %cl, %cl
ffffffff81052043: 74 9b                 je      -101 <pmap_delayed_invl_start_u+0xb0>
ffffffff81052045: 48 8d 48 01           leaq    1(%rax), %rcx
ffffffff81052049: 49 89 8e e0 04 00 00  movq    %rcx, 1248(%r14)
ffffffff81052050: 41 83 86 b4 04 00 00 01       addl    $1, 1204(%r14)
ffffffff81052058: 48 89 c3              movq    %rax, %rbx
ffffffff8105205b: 4c 89 f9              movq    %r15, %rcx
ffffffff8105205e: 31 d2                 xorl    %edx, %edx
ffffffff81052060: f0                    lock
ffffffff81052061: 48 0f c7 0e           cmpxchg16b      (%rsi)
ffffffff81052065: 0f 94 c1              sete    %cl
ffffffff81052068: 84 c9                 testb   %cl, %cl
ffffffff8105206a: 75 2f                 jne     47 <pmap_delayed_invl_start_u+0x16b>

After:

ffffffff81051022: 48 c7 c6 e0 5f 97 81  movq    $-2120785952, %rsi
ffffffff81051029: 31 db                 xorl    %ebx, %ebx
ffffffff8105102b: 31 c9                 xorl    %ecx, %ecx
ffffffff8105102d: 31 c0                 xorl    %eax, %eax
ffffffff8105102f: 31 d2                 xorl    %edx, %edx
ffffffff81051031: f0                    lock
ffffffff81051032: 48 0f c7 0e           cmpxchg16b      (%rsi)
ffffffff81051036: 48 89 c1              movq    %rax, %rcx
ffffffff81051039: b8 00 00 00 00        movl    $0, %eax
ffffffff8105103e: 75 a0                 jne     -96 <pmap_delayed_invl_start_u+0xb0>
ffffffff81051040: 48 8d 48 01           leaq    1(%rax), %rcx
ffffffff81051044: 49 89 8e e0 04 00 00  movq    %rcx, 1248(%r14)
ffffffff8105104b: 41 83 86 b4 04 00 00 01       addl    $1, 1204(%r14)
ffffffff81051053: 48 89 c3              movq    %rax, %rbx
ffffffff81051056: 4c 89 f9              movq    %r15, %rcx
ffffffff81051059: 31 d2                 xorl    %edx, %edx
ffffffff8105105b: f0                    lock
ffffffff8105105c: 48 0f c7 0e           cmpxchg16b      (%rsi)
ffffffff81051060: 74 2f                 je      47 <pmap_delayed_invl_start_u+0x161>

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable