Go to file
Hiroshi Inoue 33486787cb [PowerPC] fix incorrect vectorization of abs() on POWER9
Vectorized loops with abs() returns incorrect results on POWER9. This patch fixes it.
For example the following code returns negative result if input values are negative though it sums up the absolute value of the inputs.

int vpx_satd_c(const int16_t *coeff, int length) {
  int satd = 0;
  for (int i = 0; i < length; ++i) satd += abs(coeff[i]);
  return satd;
}

This problem causes test failures for libvpx.
For vector absolute and vector absolute difference on POWER9, LLVM generates VABSDUW (Vector Absolute Difference Unsigned Word) instruction or variants.
Since these instructions are for unsigned integers, we need adjustment for signed integers.
For abs(sub(a, b)), we generate VABSDUW(a+0x80000000, b+0x80000000). Otherwise, abs(sub(-1, 0)) returns 0xFFFFFFFF(=-1) instead of 1. For abs(a), we generate VABSDUW(a+0x80000000, 0x80000000).

Differential Revision: https://reviews.llvm.org/D45522

llvm-svn: 330497
2018-04-21 09:32:17 +00:00
clang [X86] WaitPKG intrinsics 2018-04-20 18:44:33 +00:00
clang-tools-extra [clang-tidy] add new check to find out objc ivars which do not have prefix '_' 2018-04-20 23:18:09 +00:00
compiler-rt Revert "[Sanitizer] Internal Printf string precision argument + padding." 2018-04-20 20:24:02 +00:00
debuginfo-tests [Darwin] Specify DWARF 2/4 when running apple accelerator tests. 2018-02-26 20:56:45 +00:00
libclc powr: Use denormal path only 2018-04-17 19:35:32 +00:00
libcxx Don't do aligned allocations on MSVCRT before 19.12 (update 15.3) 2018-04-19 22:12:10 +00:00
libcxxabi [libc++abi] Replace __sync_* functions with __libcpp_atomic_* functions. 2018-04-16 22:00:14 +00:00
libunwind [cmake] Remove duplicate command line options from build 2018-04-05 20:27:50 +00:00
lld [ELF] Swap argument names: use Old to refer to original symbol and New for incoming one 2018-04-20 22:50:15 +00:00
lldb Fix the Xcode gtest target for the move of FileSpecTest.cpp. 2018-04-20 18:30:31 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [PowerPC] fix incorrect vectorization of abs() on POWER9 2018-04-21 09:32:17 +00:00
openmp [OpenMP] Make bc file compilation sensitive to LIBOMPTARGET_NVPTX_DEBUG flag 2018-04-20 20:41:00 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Update isl to isl-0.19-107-gc4fe33d8 2018-04-21 08:34:22 +00:00
README.md Add an svn project to contain the files that appear at the root of the 2017-10-19 21:09:49 +00:00

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.