module documentation

Undocumented

Exception MismatchCAPIError Undocumented
Function check_api_version Emits a MismatchCAPIWarning if the C API version needs updating.
Function check_for_right_shift_internal_compiler_error On our arm CI, this fails with an internal compilation error
Function check_long_double_representation Undocumented
Function fname2def Undocumented
Function get_api_versions Return current C API checksum and the recorded checksum.
Function long_double_representation Given a binary dump as given by GNU od -b, look for long double representation.
Function pyod Python implementation of the od UNIX utility (od -b, more exactly).
Function set_sig Undocumented
Function sym2def Undocumented
Function type2def Undocumented
Constant C99_COMPLEX_FUNCS Undocumented
Constant C99_COMPLEX_TYPES Undocumented
Constant C_ABI_VERSION Undocumented
Constant C_API_VERSION Undocumented
Constant FUNC_CALL_ARGS Undocumented
Constant LONG_DOUBLE_REPRESENTATION_SRC Undocumented
Constant MANDATORY_FUNCS Undocumented
Constant OPTIONAL_FILE_FUNCS Undocumented
Constant OPTIONAL_FUNCS_MAYBE Undocumented
Constant OPTIONAL_FUNCTION_ATTRIBUTES Undocumented
Constant OPTIONAL_FUNCTION_ATTRIBUTES_AVX Undocumented
Constant OPTIONAL_FUNCTION_ATTRIBUTES_WITH_INTRINSICS_AVX Undocumented
Constant OPTIONAL_HEADERS Undocumented
Constant OPTIONAL_INTRINSICS Undocumented
Constant OPTIONAL_LOCALE_FUNCS Undocumented
Constant OPTIONAL_MISC_FUNCS Undocumented
Constant OPTIONAL_VARIABLE_ATTRIBUTES Undocumented
Constant _AFTER_SEQ Undocumented
Constant _BEFORE_SEQ Undocumented
Constant _IBM_DOUBLE_DOUBLE_BE Undocumented
Constant _IBM_DOUBLE_DOUBLE_LE Undocumented
Constant _IEEE_DOUBLE_BE Undocumented
Constant _IEEE_DOUBLE_LE Undocumented
Constant _IEEE_QUAD_PREC_BE Undocumented
Constant _IEEE_QUAD_PREC_LE Undocumented
Constant _INTEL_EXTENDED_12B Undocumented
Constant _INTEL_EXTENDED_16B Undocumented
Constant _MOTOROLA_EXTENDED_12B Undocumented
def check_api_version(apiversion, codegen_dir): (source)

Emits a MismatchCAPIWarning if the C API version needs updating.

def check_for_right_shift_internal_compiler_error(cmd): (source)

On our arm CI, this fails with an internal compilation error

The failure looks like the following, and can be reproduced on ARM64 GCC 5.4:

<source>: In function 'right_shift': <source>:4:20: internal compiler error: in expand_shift_1, at expmed.c:2349

ip1[i] = ip1[i] >> in2;
^

Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. Compiler returned: 1

This function returns True if this compiler bug is present, and we need to turn off optimization for the function

def check_long_double_representation(cmd): (source)

Undocumented

def fname2def(name): (source)

Undocumented

def get_api_versions(apiversion, codegen_dir): (source)

Return current C API checksum and the recorded checksum.

Return current C API checksum and the recorded checksum for the given version of the C API version.

def long_double_representation(lines): (source)

Given a binary dump as given by GNU od -b, look for long double representation.

def pyod(filename): (source)

Python implementation of the od UNIX utility (od -b, more exactly).

Notes

We only implement enough to get the necessary information for long double representation, this is not intended as a compatible replacement for od.

Parameters
filename:strname of the file to get the dump from.
Returns
seqout - list of lines of od output
def set_sig(sig): (source)

Undocumented

def sym2def(symbol): (source)

Undocumented

def type2def(symbol): (source)

Undocumented

C99_COMPLEX_FUNCS: list[str] = (source)

Undocumented

Value
['cabs',
 'cacos',
 'cacosh',
 'carg',
 'casin',
 'casinh',
 'catan',
...
C99_COMPLEX_TYPES: list[str] = (source)

Undocumented

Value
['complex double', 'complex float', 'complex long double']
C_ABI_VERSION: int = (source)

Undocumented

Value
16777225
C_API_VERSION: int = (source)

Undocumented

Value
16
FUNC_CALL_ARGS: dict = (source)

Undocumented

Value
{}
LONG_DOUBLE_REPRESENTATION_SRC: str = (source)

Undocumented

Value
'''
/* "before" is 16 bytes to ensure there\'s no padding between it and "x".
 *    We\'re not expecting any "long double" bigger than 16 bytes or with
 *       alignment requirements stricter than 16 bytes.  */
typedef %(type)s test_type;

struct {
...
MANDATORY_FUNCS: list[str] = (source)

Undocumented

Value
['sin',
 'cos',
 'tan',
 'sinh',
 'cosh',
 'tanh',
 'fabs',
...
OPTIONAL_FILE_FUNCS: list[str] = (source)

Undocumented

Value
['ftello', 'fseeko', 'fallocate']
OPTIONAL_FUNCS_MAYBE: list[str] = (source)

Undocumented

Value
['ftello', 'fseeko']
OPTIONAL_FUNCTION_ATTRIBUTES: list = (source)

Undocumented

Value
[('__attribute__((optimize("unroll-loops")))',
  'attribute_optimize_unroll_loops'),
 ('__attribute__((optimize("O3")))', 'attribute_optimize_opt_3'),
 ('__attribute__((optimize("O2")))', 'attribute_optimize_opt_2'),
 ('__attribute__((nonnull (1)))', 'attribute_nonnull')]
OPTIONAL_FUNCTION_ATTRIBUTES_AVX: list = (source)

Undocumented

Value
[('__attribute__((target ("avx")))', 'attribute_target_avx'),
 ('__attribute__((target ("avx2")))', 'attribute_target_avx2'),
 ('__attribute__((target ("avx512f")))', 'attribute_target_avx512f'),
 ('__attribute__((target ("avx512f,avx512dq,avx512bw,avx512vl,avx512cd")))',
  'attribute_target_avx512_skx')]
OPTIONAL_FUNCTION_ATTRIBUTES_WITH_INTRINSICS_AVX: list = (source)

Undocumented

Value
[('__attribute__((target("avx2,fma")))',
  'attribute_target_avx2_with_intrinsics',
  '__m256 temp = _mm256_set1_ps(1.0); temp =     _mm256_fmadd_ps(temp, temp, tem
p)',
  'immintrin.h'),
 ('__attribute__((target("avx512f")))',
  'attribute_target_avx512f_with_intrinsics',
...
OPTIONAL_HEADERS: list[str] = (source)

Undocumented

Value
['xmmintrin.h',
 'emmintrin.h',
 'immintrin.h',
 'features.h',
 'xlocale.h',
 'dlfcn.h',
 'execinfo.h',
...
OPTIONAL_INTRINSICS: list = (source)

Undocumented

Value
[('__builtin_isnan', '5.'),
 ('__builtin_isinf', '5.'),
 ('__builtin_isfinite', '5.'),
 ('__builtin_bswap32', '5u'),
 ('__builtin_bswap64', '5u'),
 ('__builtin_expect', '5, 0'),
 ('__builtin_mul_overflow', '(long long)5, 5, (int*)5'),
...
OPTIONAL_LOCALE_FUNCS: list[str] = (source)

Undocumented

Value
['strtold_l']
OPTIONAL_MISC_FUNCS: list[str] = (source)

Undocumented

Value
['backtrace', 'madvise']
OPTIONAL_VARIABLE_ATTRIBUTES: list[str] = (source)

Undocumented

Value
['__thread', '__declspec(thread)']
_AFTER_SEQ: list[str] = (source)

Undocumented

Value
['376', '334', '272', '230', '166', '124', '062', '020']
_BEFORE_SEQ: list[str] = (source)

Undocumented

Value
['000',
 '000',
 '000',
 '000',
 '000',
 '000',
 '000',
...
_IBM_DOUBLE_DOUBLE_BE = (source)

Undocumented

Value
['301', '235', '157', '064', '124', '000', '000', '000']+['000']*8
_IBM_DOUBLE_DOUBLE_LE = (source)

Undocumented

Value
['000', '000', '000', '124', '064', '157', '235', '301']+['000']*8
_IEEE_DOUBLE_BE: list[str] = (source)

Undocumented

Value
['301', '235', '157', '064', '124', '000', '000', '000']
_IEEE_DOUBLE_LE = (source)

Undocumented

Value
_IEEE_DOUBLE_BE[::-1]
_IEEE_QUAD_PREC_BE: list[str] = (source)

Undocumented

Value
['300',
 '031',
 '326',
 '363',
 '105',
 '100',
 '000',
...
_IEEE_QUAD_PREC_LE = (source)

Undocumented

Value
_IEEE_QUAD_PREC_BE[::-1]
_INTEL_EXTENDED_12B: list[str] = (source)

Undocumented

Value
['000',
 '000',
 '000',
 '000',
 '240',
 '242',
 '171',
...
_INTEL_EXTENDED_16B: list[str] = (source)

Undocumented

Value
['000',
 '000',
 '000',
 '000',
 '240',
 '242',
 '171',
...
_MOTOROLA_EXTENDED_12B: list[str] = (source)

Undocumented

Value
['300',
 '031',
 '000',
 '000',
 '353',
 '171',
 '242',
...