Collected the data to move llvm_cbuilder
This commit is contained in:
parent
2685d60e38
commit
004313fcbd
6 changed files with 0 additions and 0 deletions
41
llvm_cbuilder/shortnames.py
Normal file
41
llvm_cbuilder/shortnames.py
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
from numba.minivect import minitypes
|
||||
import numba.decorators
|
||||
from llvm.core import Type
|
||||
|
||||
void = Type.void()
|
||||
char = Type.int(8)
|
||||
short = Type.int(16)
|
||||
int = Type.int(32)
|
||||
int16 = short
|
||||
int32 = int
|
||||
int64 = Type.int(64)
|
||||
|
||||
float = Type.float()
|
||||
double = Type.double()
|
||||
|
||||
npy_intp = minitypes.npy_intp.to_llvm(numba.decorators.context)
|
||||
py_ssize_t = minitypes.Py_ssize_t.to_llvm(numba.decorators.context)
|
||||
|
||||
# pointers
|
||||
|
||||
pointer = Type.pointer
|
||||
|
||||
void_p = pointer(char)
|
||||
char_p = pointer(char)
|
||||
npy_intp_p = pointer(npy_intp)
|
||||
|
||||
# platform dependent
|
||||
|
||||
def _determine_pointer_size():
|
||||
from ctypes import sizeof, c_void_p
|
||||
return sizeof(c_void_p) * 8
|
||||
|
||||
pointer_size = _determine_pointer_size()
|
||||
|
||||
intp = {32: int32, 64: int64}[pointer_size]
|
||||
|
||||
|
||||
# vector
|
||||
def vector(ty, ct):
|
||||
return Type.vector(ty, 4)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue