HomePhabricator

[PowerPC] [Clang] [AltiVec] The second parameter of vec_sr function should be…

Authored by wuzish on Nov 8 2018, 7:35 PM.

Description

[PowerPC] [Clang] [AltiVec] The second parameter of vec_sr function should be modulo the number of bits in the element

The second parameter of vec_sr function is representing shift bits and it should be modulo the number of bits in the element like what vec_sl does now.
This is actually required by the ABI:

Each element of the result vector is the result of logically right shifting the corresponding
element of ARG1 by the number of bits specified by the value of the corresponding
element of ARG2, modulo the number of bits in the element. The bits that are shifted out
are replaced by zeros.

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

llvm-svn: 346471