Thread (6 messages) flat view 6 messages, 3 authors, 2017-03-17

RE: [PATCH net-next] r8152: simply the arguments

From: David Laight <hidden>
Date: 2017-03-17 11:20:44
Also in: lkml

From: Hayes Wang
Sent: 17 March 2017 03:00
To: David Laight; netdev@vger.kernel.org
Cc: nic_swsd; linux-kernel@vger.kernel.org; linux-usb@vger.kernel.org
Subject: RE: [PATCH net-next] r8152: simply the arguments

David Laight [mailto:David.Laight@ACULAB.COM]
quoted
Sent: Thursday, March 16, 2017 10:28 PM
[...]
quoted
If you are really lucky the compiler will optimise it away.
Otherwise it will generate another local variable and possibly
a register spill to stack.
However, I could reduce the time for calculating the address,
because I only calculate it once and save the result to a variable.
Right?
 address you want is just an offset from another pointer that is
commonly used and ought to be assigned to a register variable.

The offset can be added by the instruction that puts the value into
the register used for the first function argument.

So 'saving' it in another variable is extra work.

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help