Convert __io_uring_get_sqe() from a macro into an inline function

This patch makes gcc 10 insert one additional assembly instruction in
io_uring_get_sqe(), namely xor %r8d,%r8d. That shouldn't cause any slowdown
since that instruction does not access memory:

   0x0000000000000360 <+0>:     mov    (%rdi),%rax
   0x0000000000000363 <+3>:     xor    %r8d,%r8d
   0x0000000000000366 <+6>:     mov    (%rax),%ecx
   0x0000000000000368 <+8>:     mov    0x44(%rdi),%eax
   0x000000000000036b <+11>:    lea    0x1(%rax),%edx
   0x000000000000036e <+14>:    mov    %edx,%esi
   0x0000000000000370 <+16>:    sub    %ecx,%esi
   0x0000000000000372 <+18>:    mov    0x18(%rdi),%rcx
   0x0000000000000376 <+22>:    cmp    (%rcx),%esi
   0x0000000000000378 <+24>:    ja     0x38e <io_uring_get_sqe+46>
   0x000000000000037a <+26>:    mov    0x10(%rdi),%rcx
   0x000000000000037e <+30>:    and    (%rcx),%eax
   0x0000000000000380 <+32>:    mov    %edx,0x44(%rdi)
   0x0000000000000383 <+35>:    shl    $0x6,%rax
   0x0000000000000387 <+39>:    add    0x38(%rdi),%rax
   0x000000000000038b <+43>:    mov    %rax,%r8
   0x000000000000038e <+46>:    mov    %r8,%rax
   0x0000000000000391 <+49>:    retq

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 file changed