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
SIMD Operators Unavailable (SDK 0.5.20.4) #11747
Comments
Added Area-Dart2JS, Triaged labels. |
This comment was originally written by ngeoffray@google.com Even though these types are not supported in dart2js, we should not emit a warning in this case. Set owner to @johnniwinther. |
The problem is caused by inconsistencies between the source code used by the VM (in sdk/lib/typed_data/typed_data.dart) and the source code used by dart2js (in sdk/lib/typed_data/dart2js/typed_data_dart2js.dart). The dart2js declaration for Float32x4 does not include the operators and dart2js therefore warns about the usage - and what's worse, dartdoc (which is based on dart2js) does not document the operators. @vsm,ager,sra: What is the reason for not implementing typed_data using the patch system (which ensures that the interfaces are the same)? cc @vsmenon. |
This comment was originally written by @si-robertson Hi guys, I was wondering if there was any movement on this issue? I understand the SIMD stuff is relatively new but not being able to minify/obfuscate Dart code will unfortunately prevent me from releasing anything publicly, and I really want to help to get other developers interested in Dart. If it makes any difference, I'm only really using dart2js to minify the Dart source files (--minify --output-type=dart), I'm not using it to convert Dart to JavaScript. Are there any files that I hack myself in my local copy of the Dart SDK to patch this issue until it's officially fixed by you guys? Thanks :) |
Hi Si, When running dart2js with the -v option, you can see the location of the libraries it reads. That should tell you the location of the files you want to hack on. Cheers, |
This comment was originally written by @si-robertson FYI: I have just modified the "typed_data.dart" and "typed_data_dart2js.dart" files to include the addition and subtraction operators for Uint32x4 types, and I also prefixed the snapshot files with "_" just to make sure no cached data was being pulled in from those, but it didn't fix the issue. Are there any other files in the SDK that need to be modified? |
This comment was originally written by @si-robertson Ah, this isn't going to work. I managed to get the compiler working with no errors when running it via a command-line, but the Dart VM (Dartium) naturally fell over when it hit the addition operator. No problem though, this doesn't affect project development so I can happily wait for you guys to sort this out :) |
Johnni's question stands: Why is this not using the patch system? It is definitely a defect in the dart2js library implementation. |
Added Library-TypedData label. |
Dart2js seems to support the Float32x4 operators now. Added AssumedStale label. |
This issue was originally filed by @si-robertson
== What steps will reproduce the problem ==
Using any operator on explicitly declared Float32x4 and Uint32x4 objects.
== What is the expected output ==
I expect the operators to be available.
== What do you see instead ==
The compiler spits out the following warnings:
no operator [OPERATOR] in class Float32x4
no operator [OPERATOR] in class Uint32x4
== What version of the product are you using ==
Dart-to-JavaScript compiler (dart2js) version: 0.5.20.4_r24275
== On what operating system ==
Windows 7
== Please provide any additional information below ==
The following code will reproduce the warning.
// start
Float32x4 a = new Float32x4( 1.0, 2.0, 3.0, 4.0 );
Float32x4 b = new Float32x4( 1.0, 2.0, 3.0, 4.0 );
Float32x4 c;
void fail() {
// triggers a compiler warning
c = a + b;
}
void fine() {
// triggers no warnings
var a = new Float32x4( 1.0, 2.0, 3.0, 4.0 );
var b = new Float32x4( 1.0, 2.0, 3.0, 4.0 );
var c = a + b;
}
// end
The text was updated successfully, but these errors were encountered: