Security Scol plugin
Macros
ppc_simd.h File Reference

Support functions for PowerPC and vector operations. More...

#include "config.h"
#include "misc.h"

Go to the source code of this file.

Macros

#define CONST_V8_CAST(x)   ((unsigned char*)(x))
 Cast array to vector pointer.
 
#define CONST_V32_CAST(x)   ((unsigned int*)(x))
 Cast array to vector pointer.
 
#define CONST_V64_CAST(x)   ((unsigned long long*)(x))
 Cast array to vector pointer.
 
#define NCONST_V8_CAST(x)   ((unsigned char*)(x))
 Cast array to vector pointer.
 
#define NCONST_V32_CAST(x)   ((unsigned int*)(x))
 Cast array to vector pointer.
 
#define NCONST_V64_CAST(x)   ((unsigned long long*)(x))
 Cast array to vector pointer.
 

Detailed Description

Support functions for PowerPC and vector operations.

This header provides an agnostic interface into Clang, GCC and IBM XL C/C++ compilers modulo their different built-in functions for accessing vector instructions.

The abstractions are necessary to support back to GCC 4.8 and XLC 11 and 12. GCC 4.8 and 4.9 are still popular, and they are the default compiler for GCC112, GCC119 and others on the compile farm. Older IBM XL C/C++ compilers also have the need due to lack of vec_xl and vec_xst support on some platforms. Modern compilers provide best support and don't need many of the hacks below.

The library is tested with the following PowerPC machines and compilers. GCC110, GCC111, GCC112, GCC119 and GCC135 are provided by the GCC Compile Farm

Definition in file ppc_simd.h.

Macro Definition Documentation

◆ CONST_V32_CAST

#define CONST_V32_CAST (   x)    ((unsigned int*)(x))

Cast array to vector pointer.

CONST_V32_CAST casts a const array to a vector pointer for a word array. The Power ABI says source arrays are non-const, so this define removes the const. XLC++ will fail the compile if the source array is const.

Definition at line 151 of file ppc_simd.h.

◆ CONST_V64_CAST

#define CONST_V64_CAST (   x)    ((unsigned long long*)(x))

Cast array to vector pointer.

CONST_V64_CAST casts a const array to a vector pointer for a double word array. The Power ABI says source arrays are non-const, so this define removes the const. XLC++ will fail the compile if the source array is const.

Definition at line 157 of file ppc_simd.h.

◆ CONST_V8_CAST

#define CONST_V8_CAST (   x)    ((unsigned char*)(x))

Cast array to vector pointer.

CONST_V8_CAST casts a const array to a vector pointer for a byte array. The Power ABI says source arrays are non-const, so this define removes the const. XLC++ will fail the compile if the source array is const.

Definition at line 145 of file ppc_simd.h.

◆ NCONST_V32_CAST

#define NCONST_V32_CAST (   x)    ((unsigned int*)(x))

Cast array to vector pointer.

NCONST_V32_CAST casts an array to a vector pointer for a word array. The Power ABI says source arrays are non-const, so this define removes the const. XLC++ will fail the compile if the source array is const.

Definition at line 169 of file ppc_simd.h.

◆ NCONST_V64_CAST

#define NCONST_V64_CAST (   x)    ((unsigned long long*)(x))

Cast array to vector pointer.

NCONST_V64_CAST casts an array to a vector pointer for a double word array. The Power ABI says source arrays are non-const, so this define removes the const. XLC++ will fail the compile if the source array is const.

Definition at line 175 of file ppc_simd.h.

◆ NCONST_V8_CAST

#define NCONST_V8_CAST (   x)    ((unsigned char*)(x))

Cast array to vector pointer.

NCONST_V8_CAST casts an array to a vector pointer for a byte array. The Power ABI says source arrays are non-const, so this define removes the const. XLC++ will fail the compile if the source array is const.

Definition at line 163 of file ppc_simd.h.