History

x86,ftrace: Shrink ftrace_regs_caller() by one byte

'Optimize' ftrace_regs_caller. Instead of comparing against an immediate, the more natural way to test for zero on x86 is: 'test %r,%r'. 48 83 f8 00 cmp $0x0,%rax 74 49 je 226 <ftrace_regs_call+0xa3> 48 85 c0 test %rax,%rax 74 49 je 225 <ftrace_regs_call+0xa2>

Peter Zijlstra committed 6 years ago

Commit 9f2dfd61 parent dc2745b1 file · +2 −2Browse files

Unified · Split

arch/x86/kernel/ftrace_64.S+2−2
@@ -240,8 +240,8 @@ SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL) · 239 unmodified lines
240240 * See arch_ftrace_set_direct_caller().
241241 */
242242 movq ORIG_RAX(%rsp), %rax
243− cmpq $0, %rax
244− je 1f
243+ testq %rax, %rax
244+ jz 1f
245245
246246 /* Swap the flags with orig_rax */
247247 movq MCOUNT_REG_SIZE(%rsp), %rdi

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t