piotte13 / simd-visualiser Goto Github PK
View Code? Open in Web Editor NEWA tool to graphically visualize SIMD code
License: BSD 3-Clause "New" or "Revised" License
A tool to graphically visualize SIMD code
License: BSD 3-Clause "New" or "Revised" License
Page goes blank when clicking visualize
VCL is popular enough to be available in the Godbolt compiler explorer. Would be great to be able to use it here.
Right now, one cannot quickly identify which vector is being animated. Sometimes vectors are subject to a lot of operation aland are mixed with other vectors. We should be able to quickly know which one is which.
E.g., 32-bit integers or floats...
It seems that we should regroup the instructions by types and implement them in batches. It seems wasteful to duplicate entirely the code for psubw, pcmpeqw, paddw which have all the same logic.
This is a case where abstraction would be welcome.
This example makes it spin forever:
#include <x86intrin.h>
__m256 dot8(__m256 a0, __m256 a1, __m256 a2, __m256 b0, __m256 b1, __m256 b2)
{
return _mm256_add_ps(
_mm256_mul_ps(a0, b0), _mm256_add_ps(_mm256_mul_ps(a1, b1), _mm256_mul_ps(a2, b2)));
}
This example makes it load a white webpage:
#include <x86intrin.h>
__m128i a;
__m128i Foo() { return a; }
Duh.
Currently, we only support code that makes use of vector registers. In some instances, that's going to be too restrictive. We want some support for non-vector registers.
Big thanks for making this cool tool open-source.
By any chance, is there a complete list of instructions which are currently not supported / under development please? For instance, I am aware that vgatherdpd does not work.
It seems that it may fail on Edge.
What a great tool, thanks for this! I tried to visualize a very simple function that uses _mm_cvtepi8_epi32
; it compiles but then page goes blank; in the firefox console following error appears:
TypeError: e.component.current is null[Learn More] SequentialComponent.js:89:12
<anonymous>
SequentialComponent.js:89:12
value
SequentialComponent.js:83:39
Ni
react-dom.production.min.js:2890
so
react-dom.production.min.js:3408:3
ho
react-dom.production.min.js:3593
Ko
react-dom.production.min.js:4600
Vo
react-dom.production.min.js:4620
Aa
react-dom.production.min.js:5017
Oa
react-dom.production.min.js:4983
Ea
react-dom.production.min.js:4927
Xo
react-dom.production.min.js:4847
enqueueSetState
react-dom.production.min.js:2844
k.prototype.setState
react.production.min.js:72
value
ASMVisualizer.js:67:12
value self-hosted:974:17 complete
SequentialComponent.js:47:20
o
anime.min.js:587
s
anime.min.js:615
j/h.tick
anime.min.js:646
t
anime.min.js:848
I'd be delighted to help integrate directly into Compiler Explorer, if that's something you'd consider useful? (see also compiler-explorer/compiler-explorer#1203 )
It seems bad to just code up our implementation of the instructions and hope for the best. We should have tests to make sure they are correct.
cc @pmntang
Neat project! A quick search didn't turn up anything for NEON (ARM's SIMD intrinsics). Would this be difficult to implement?
Hi folks, cool project!
I was trying out a few of my code snippets but can't seem to get them to work. Here's an example:
#include <x86intrin.h>
__m512 huge = _mm512_set1_pd(2);
__m512 tiny = _mm512_set1_pd(-2);
__m512 one = _mm512_set1_pd(1.0);
void sgm(__m512& prodv, __m512& scales, __m512 const incoming) {
prodv = _mm512_mul_pd(prodv, incoming);
auto pgeh = _mm512_cmp_pd_mask(prodv, huge, _CMP_GE_OQ);
auto plet = _mm512_cmp_pd_mask(prodv, tiny, _CMP_LE_OQ);
prodv = _mm512_mask_mul_pd(prodv, pgeh, prodv, tiny);
prodv = _mm512_mask_mul_pd(prodv, plet, prodv, huge);
scales = _mm512_mask_add_epi64(scales, pgeh, scales, one);
scales = _mm512_mask_sub_epi64(scales, plet, scales, one);
}
Removing the &
in the parameter list and making it return prodv
gets it a bit further, but not much. All of the instructions are reported as "unsupported command".
It would be nice if the user could choose out of a small collection of examples...
E.g., here is another example...
__m128i Delta(__m128i curr, __m128i prev) {
__m128i a = _mm_alignr_epi8(curr, prev, 12);
return _mm_sub_epi32(curr, a);
}
c.c. @pmntang
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.