[PATCH] D13994: Optimization for pow(x, n) where n is some constant

Mandeep Singh Grang via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 25 20:11:19 PDT 2015


mgrang added a comment.

Thanks escha.
It seems Addition Chain Exponentiation is NP-complete.

My solution calculates pow(x, n) by computing powers of 2.
See: https://en.wikipedia.org/wiki/Exponentiation_by_squaring#Computation_by_powers_of_2


http://reviews.llvm.org/D13994





More information about the llvm-commits mailing list