-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to generic syntax for SIMD types while including the original aliases #70
Comments
More thoughts related to this. In the generics extension I refer to the point there's no Expand for all the ```int``` and ```uint``` types defined by default.type int8 = int<8>;
type int16 = int<16>;
type int32 = int<32>;
type int64 = int<64>;
type uint8 = uint<8>;
type uint16 = uint<16>;
type uint32 = uint<32>;
type uint64 = uint<64>; boolean at least for SIMD masks can be thought of as type boolean1 = uint<1>;
type boolean8 = vector<boolean1, 8>;
type boolean8x16 = vector<boolean8, 16>; // vector<vector<uint<1>, 8>, 16> Expand for all the SIMD types defined by default.type boolean1 = uint<1>;
type boolean8 = vector<boolean1, 8>;
type boolean16 = vector<boolean1, 16>;
type boolean32 = vector<boolean1, 32>;
type boolean64 = vector<boolean1, 64>;
type boolean8x16 = vector<boolean8, 16>;
type boolean16x8 = vector<boolean16>, 8>;
type boolean32x4 = vector<boolean32>, 4>;
type boolean64x2 = vector<boolean64>, 2>;
type boolean8x32 = vector<boolean8>, 32>;
type boolean16x16 = vector<boolean16>, 16>;
type boolean32x8 = vector<boolean32>, 8>;
type boolean64x4 = vector<boolean64>, 4>;
type int8x16 = vector<int8, 16>;
type int16x8 = vector<int16, 8>;
type int32x4 = vector<int32, 4>;
type int64x2 = vector<int64, 2>;
type int8x32 = vector<int8, 32>;
type int16x16 = vector<int16, 16>;
type int32x8 = vector<int32, 8>;
type int64x4 = vector<int64, 4>;
type uint8x16 = vector<uint8, 16>;
type uint16x8 = vector<uint16, 8>;
type uint32x4 = vector<uint32, 4>;
type uint64x2 = vector<uint64, 2>;
type uint8x32 = vector<uint8, 32>;
type uint16x16 = vector<uint16, 16>;
type uint32x8 = vector<uint32, 8>;
type uint64x4 = vector<uint64, 4>;
type float32x4 = vector<float32, 4>;
type float64x2 = vector<float64, 2>;
type float32x8 = vector<float32, 8>;
type float64x4 = vector<float64, 4>; Further down in the current spec I mention allowing bit fields. Weirdly enough ECMAScript is seeing use in embedded systems. Sometimes it's things like devices having web interfaces. As computing power continues to increase there are more low level libraries being used by developers. class Vector2 {
x:uint<4>; // 4 bits
y:uint<4>; // 4 bits
} It's important to quickly mock up such bitfield syntax and ensure the language defines the memory layout as it can't be changed later. WIP: Continue this later... |
Updated https://github.com/sirisian/ecmascript-types/blob/master/README.md#types-proposed with these changes. TODO: Update the bit-fields section and the memory layout sections to support bit alignment and sizes optionally. |
WIP issue with thoughts.
Currently the SIMD types are:
Been thinking they could just be aliases. They're really nice to have as they make math code compact. One of the main reasons I originally defined them as separate types is because they need component accessors in the form of:
These would be part of the swizzling operators on vectors of size 2 and 4.
There are vectors with sizes 2, 4, 8, 16, and 32. These could all be defined like:
We'd need to make the boolean bitflag types real:
boolean8, boolean16, boolean32, boolean64
. These array syntax to access bitflags probably.The text was updated successfully, but these errors were encountered: