From 03bfddae5080f8b92d86342d68439c7f07838369 Mon Sep 17 00:00:00 2001 From: Amy Kwan Date: Fri, 8 Oct 2021 12:52:01 -0500 Subject: [PATCH] [NFC] Update vec_extract builtin signatures to take signed int. This patch updates the vec_extract builtins to take a signed int as the second parameter, as defined by the Power Vector Intrinsics Programming Reference. This patch is NFC and all existing tests pass. Differential Revision: https://reviews.llvm.org/D110935 --- clang/lib/Headers/altivec.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/clang/lib/Headers/altivec.h b/clang/lib/Headers/altivec.h index 9d244158b202..fb808d7b0a4f 100644 --- a/clang/lib/Headers/altivec.h +++ b/clang/lib/Headers/altivec.h @@ -13455,74 +13455,74 @@ vec_vxor(vector bool long long __a, vector bool long long __b) { /* vec_extract */ static __inline__ signed char __ATTRS_o_ai vec_extract(vector signed char __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0xf]; } static __inline__ unsigned char __ATTRS_o_ai -vec_extract(vector unsigned char __a, unsigned int __b) { +vec_extract(vector unsigned char __a, signed int __b) { return __a[__b & 0xf]; } static __inline__ unsigned char __ATTRS_o_ai vec_extract(vector bool char __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0xf]; } static __inline__ signed short __ATTRS_o_ai vec_extract(vector signed short __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0x7]; } static __inline__ unsigned short __ATTRS_o_ai -vec_extract(vector unsigned short __a, unsigned int __b) { +vec_extract(vector unsigned short __a, signed int __b) { return __a[__b & 0x7]; } static __inline__ unsigned short __ATTRS_o_ai vec_extract(vector bool short __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0x7]; } static __inline__ signed int __ATTRS_o_ai vec_extract(vector signed int __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0x3]; } static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector unsigned int __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0x3]; } static __inline__ unsigned int __ATTRS_o_ai vec_extract(vector bool int __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0x3]; } #ifdef __VSX__ static __inline__ signed long long __ATTRS_o_ai -vec_extract(vector signed long long __a, unsigned int __b) { +vec_extract(vector signed long long __a, signed int __b) { return __a[__b & 0x1]; } static __inline__ unsigned long long __ATTRS_o_ai -vec_extract(vector unsigned long long __a, unsigned int __b) { +vec_extract(vector unsigned long long __a, signed int __b) { return __a[__b & 0x1]; } static __inline__ unsigned long long __ATTRS_o_ai -vec_extract(vector bool long long __a, unsigned int __b) { +vec_extract(vector bool long long __a, signed int __b) { return __a[__b & 0x1]; } static __inline__ double __ATTRS_o_ai vec_extract(vector double __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0x1]; } #endif static __inline__ float __ATTRS_o_ai vec_extract(vector float __a, - unsigned int __b) { + signed int __b) { return __a[__b & 0x3]; }