Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1603227

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

From David Laight <David.Laight@ACULAB.COM>
Newsgroups linux.kernel
Subject RE: [PATCH net-next] r8152: simply the arguments
Date 2017-03-17 12:30 +0100
Message-ID <tlYf0-5GH-17@gated-at.bofh.it> (permalink)
References <tlx58-2Fi-1@gated-at.bofh.it> <tlEzD-80N-17@gated-at.bofh.it> <tlQUa-8mg-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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]
> > Sent: Thursday, March 16, 2017 10:28 PM
> [...]
> > 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

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH net-next] r8152: simply the arguments Hayes Wang <hayeswang@realtek.com> - 2017-03-16 07:30 +0100
  [PATCH v2 net-next] r8152: simply the arguments Hayes Wang <hayeswang@realtek.com> - 2017-03-16 07:40 +0100
    Re: [PATCH v2 net-next] r8152: simply the arguments David Miller <davem@davemloft.net> - 2017-03-16 18:20 +0100
  RE: [PATCH net-next] r8152: simply the arguments David Laight <David.Laight@ACULAB.COM> - 2017-03-16 15:30 +0100
    RE: [PATCH net-next] r8152: simply the arguments Hayes Wang <hayeswang@realtek.com> - 2017-03-17 04:40 +0100
      RE: [PATCH net-next] r8152: simply the arguments David Laight <David.Laight@ACULAB.COM> - 2017-03-17 12:30 +0100

csiph-web