Comments (5)
This can be accomplished with a Float32x4Array
overlay, for example:
var f32Array = new Float32Array(100);
var f32x4Array = new Float32x4Array(f32Array.buffer)
var f32x4 = f32x4Array.getAt(1)
the .getAt(1)
will load 4 float32 values into f32x4
from f32Array
starting at index 4.
If a second parameter is given to the Float32x4Array
constructor it indicates the byte offset into the data buffer. Right now, it must be a multiple of 16, so it's not possible to get to elements that doesn't start at a multiple of 4 index. Is that really needed, you think?
from ecmascript_simd.
It seems that DataView(buffer, byteOffset, byteLength) could accomplish what you want. Currently we have not implemented DataView API for float32x4 and int32x4.
from ecmascript_simd.
Peter and Haitao are correct. The expectation is that the specification will include new typed array views for each SIMD-128 type. For example, Float32x4Array and Int32x4Array. These arrays will have the same alignment (natural byte alignment) restrictions that existing typed arrays have. To complement the arrays and fully extend the Typed Array specification, the DataView class is extended with a getter and a setter for each SIMD-128 type. For example:
float32x4 getFloat32x4(unsigned long byteOffset, optional boolean littleEndian);
void setFloat32x4(unsigned long byteOffset, float32x4 value, optional boolean littleEndian);
Setters and getters on DataView have no alignment restrictions for byteOffsets.
from ecmascript_simd.
https://www.khronos.org/registry/typedarray/specs/latest/
from ecmascript_simd.
We now have load and store which perform this task.
from ecmascript_simd.
Related Issues (20)
- Anything compiled via emscripten with SIMD=1 fails in Microsoft Edge HOT 3
- Can this API be provided as a standard module rather than globals? HOT 23
- Polyfill load index only accepts Int32 values, spec accepts 0 - 2^53-1 HOT 13
- Polyfill simdCheckLaneIndex requires Int32 values, spec applies ToNumber first HOT 3
- Support integer mulHigh ? HOT 7
- Clarification of SIMD objects vs values HOT 3
- Why is shift right modulo lane bit width? HOT 3
- Semantics of minNum and maxNum don't match IEEE 754-2008 for signaling NaNs HOT 10
- SIMD.isFast
- Problematic HOT 2
- First high-level library for SIMD
- SIMD uint8x16 to 4 of uint32x4 with transpose? HOT 9
- Link to asm.js version of the spec? (no load3 or store3?)
- Odd spec layout issues HOT 4
- Is this still an active project? HOT 3
- Explicit rounding modes
- Reduce operations
- Poor naming of "splat"
- Consider using variable (scalable) vectors for more portable code that can adjust to width of vector.
- Float16 / bfloat16 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ecmascript_simd.