aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-11-17 10:19:08 -0800
committerCraig Topper <craig.topper@sifive.com>2021-11-17 10:29:41 -0800
commit0274be28d7f8266e441a45adc1a208fc0ca04dd4 (patch)
treee5562c95be677c2898ec13230bf17a48a81a0968 /clang/lib/Frontend/CompilerInvocation.cpp
parent103cc914d63371212fdc81e450572ee096952211 (diff)
downloadllvm-0274be28d7f8266e441a45adc1a208fc0ca04dd4.zip
llvm-0274be28d7f8266e441a45adc1a208fc0ca04dd4.tar.gz
llvm-0274be28d7f8266e441a45adc1a208fc0ca04dd4.tar.bz2
[RISCV] Lower vector CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF by converting to FP and extracting the exponent.
If we have a large enough floating point type that can exactly represent the integer value, we can convert the value to FP and use the exponent to calculate the leading/trailing zeros. The exponent will contain log2 of the value plus the exponent bias. We can then remove the bias and convert from log2 to leading/trailing zeros. This doesn't work for zero since the exponent of zero is zero so we can only do this for CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF. If we need a value for zero we can use a vmseq and a vmerge to handle it. We need to be careful to make sure the floating point type is legal. If it isn't we'll continue using the integer expansion. We could split the vector and concatenate the results but that needs some additional work and evaluation. Differential Revision: https://reviews.llvm.org/D111904
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions