Better tabselect

Torbjorn Granlund tg at gmplib.org
Fri Apr 12 20:10:13 CEST 2013


David Miller <davem at davemloft.net> writes:

  From: Torbjorn Granlund <tg at gmplib.org>
  Date: Fri, 12 Apr 2013 19:30:42 +0200
  
  > David Miller <davem at davemloft.net> writes:
  > 
  >   It isn't really conditional execution on sparc, the resources and
  >   timing required for the "move" instruction are constant whether the
  >   condition matches or not.
  >   
  > That's not enough.
  > 
  > It needs to have the same data-dependency behaviour too.
  > 
  > And it needs to be a documented feature, since it is easy to imagine an
  > implementation which does create different data-dependency behaviour,
  > even if all current ones do not.
  > 
  > Using carry seems safer.  Of course, it is conceivable that a
  > carry-dependent instruction could run diffferently depending on the
  > value of the carry flag, but that'd be quite strange.
  
  Even on a pipeline that dynamically renames the condition codes?
  You know, something we've never seen before :-)
  
I am not worrying mainly about WAR and WAW dependencies, but about plain
RAW dependencies.  Does the movXX read the source register or not, for a
false condition?  Does it read the destnation, or does it only write it
(for a true condition)?

If we could trust movXX to be silent, we should of course not bother to
create that mask, but replace that and the logops with 4 moveq for a
great speedup...

  > (For generic sparc64 code, we should perhaps avoid movXX for other
  > reasons too, since it interacts poorly with loads on US1-2, IIRC.)
  
  Now that's a more solid reason to avoid movcc.
  
Keeping cnd functions and tabselect side-channel silent is crucial.
(And while not specificaly designed for side-channel silence, also
mul_k, addmul_k and submul_k should be silent.)

-- 
Torbjörn


More information about the gmp-devel mailing list