Mentions légales du service

Skip to content
  • Adhemerval Zanella's avatar
    Optimize roundeven for powerpc · 572ecec5
    Adhemerval Zanella authored
    The PowerISA does not have a roundeven instruction, like x86-64-v2
    or aarch64, however it does have support for round (frin, ISA 2.03)
    and clz (cnttzd).  Thus the __builtin_roundeven inline version is
    faster for recent POWER chips.
    
    Since the implementations do not include math.h, use __builtin_round
    instead of round (so compiler can lower to the instruction if
    available).
    
    Also optimize the result adjustment to use copysign instead of
    floating point comparison (it shows slight better generated code).
    572ecec5
Loading