Better lowering of distinct types. Noreturn function call expr recognized as a "jump" for escape analysis. Preferring "def" in libs. To upper / to lower for ascii. Initial dynlib support.

This commit is contained in:
Christoffer Lerno
2023-05-21 21:25:33 +02:00
committed by Christoffer Lerno
parent a877d4458c
commit ddd0497922
55 changed files with 579 additions and 416 deletions

View File

@@ -85,33 +85,33 @@ fault MatrixError
MATRIX_INVERSE_DOESNT_EXIST,
}
typedef Complexf = Complex<float>;
typedef Complex = Complex<double>;
define complexf_identity = complex::identity<float>;
define complex_identity = complex::identity<double>;
def Complexf = Complex<float>;
def Complex = Complex<double>;
def complexf_identity = complex::identity<float>;
def complex_identity = complex::identity<double>;
typedef Quaternionf = Quaternion<float>;
typedef Quaternion = Quaternion<double>;
define quaternionf_identity = quaternion::identity<float>;
define quaternion_identity = quaternion::identity<double>;
def Quaternionf = Quaternion<float>;
def Quaternion = Quaternion<double>;
def quaternionf_identity = quaternion::identity<float>;
def quaternion_identity = quaternion::identity<double>;
typedef Matrix2f = Matrix2x2<float>;
typedef Matrix2 = Matrix2x2<double>;
typedef Matrix3f = Matrix3x3<float>;
typedef Matrix3 = Matrix3x3<double>;
typedef Matrix4f = Matrix4x4<float>;
typedef Matrix4 = Matrix4x4<double>;
define matrix4_ortho = matrix::ortho<double>;
define matrix4_perspective = matrix::perspective<double>;
define matrix4f_ortho = matrix::ortho<float>;
define matrix4f_perspective = matrix::perspective<float>;
def Matrix2f = Matrix2x2<float>;
def Matrix2 = Matrix2x2<double>;
def Matrix3f = Matrix3x3<float>;
def Matrix3 = Matrix3x3<double>;
def Matrix4f = Matrix4x4<float>;
def Matrix4 = Matrix4x4<double>;
def matrix4_ortho = matrix::ortho<double>;
def matrix4_perspective = matrix::perspective<double>;
def matrix4f_ortho = matrix::ortho<float>;
def matrix4f_perspective = matrix::perspective<float>;
define MATRIX2_IDENTITY = matrix::IDENTITY2<double>;
define MATRIX2F_IDENTITY = matrix::IDENTITY2<float>;
define MATRIX3_IDENTITY = matrix::IDENTITY3<double>;
define MATRIX3F_IDENTITY = matrix::IDENTITY3<float>;
define MATRIX4_IDENTITY = matrix::IDENTITY4<double>;
define MATRIX4F_IDENTITY = matrix::IDENTITY4<float>;
def MATRIX2_IDENTITY = matrix::IDENTITY2<double>;
def MATRIX2F_IDENTITY = matrix::IDENTITY2<float>;
def MATRIX3_IDENTITY = matrix::IDENTITY3<double>;
def MATRIX3F_IDENTITY = matrix::IDENTITY3<float>;
def MATRIX4_IDENTITY = matrix::IDENTITY4<double>;
def MATRIX4F_IDENTITY = matrix::IDENTITY4<float>;
/**
* @require types::is_numerical($typeof(x)) `The input must be a numerical value or numerical vector`

View File

@@ -6,9 +6,9 @@ struct Random
void* state;
}
typedef RandomSeedFn = fn void(Random*, char[] seed);
typedef RandomNextBytesFn = fn void(Random*, char[] buffer);
typedef RandomNextFn = fn uint(Random*, int bits);
def RandomSeedFn = fn void(Random*, char[] seed);
def RandomNextBytesFn = fn void(Random*, char[] buffer);
def RandomNextFn = fn uint(Random*, int bits);
struct RandomInterface
{

View File

@@ -1,13 +1,13 @@
module std::math::vector;
import std::math;
typedef Vec2f = float[<2>];
typedef Vec3f = float[<3>];
typedef Vec4f = float[<4>];
def Vec2f = float[<2>];
def Vec3f = float[<3>];
def Vec4f = float[<4>];
typedef Vec2 = double[<2>];
typedef Vec3 = double[<3>];
typedef Vec4 = double[<4>];
def Vec2 = double[<2>];
def Vec3 = double[<3>];
def Vec4 = double[<4>];
macro Vec2f.length_sq(Vec2f v) => v.dot(v);
macro Vec3f.length_sq(Vec3f v) => v.dot(v);

View File

@@ -1,6 +1,6 @@
module std::math;
typedef SimpleRandom = distinct ulong;
def SimpleRandom = distinct ulong;
const long SIMPLE_RANDOM_MULTIPLIER @local = 0x5DEECE66D;
const long SIMPLE_RANDOM_ADDEND @local = 0xB;