Skip to content
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

Closed
DartBot opened this issue Jul 9, 2013 · 10 comments
Closed

SIMD Operators Unavailable (SDK 0.5.20.4) #11747

DartBot opened this issue Jul 9, 2013 · 10 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-typed-data

Comments

@DartBot
Copy link

DartBot commented Jul 9, 2013

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

@iposva-google
Copy link
Contributor

Added Area-Dart2JS, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jul 12, 2013

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.

@johnniwinther
Copy link
Member

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.
cc @madsager.
cc @rakudrama.
Removed the owner.
Removed Area-Dart2JS label.
Added Area-Library label.

@DartBot
Copy link
Author

DartBot commented Aug 7, 2013

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 :)

@peter-ahe-google
Copy link
Contributor

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,
Peter

@DartBot
Copy link
Author

DartBot commented Aug 7, 2013

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?

@DartBot
Copy link
Author

DartBot commented Aug 7, 2013

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 :)

@lrhn
Copy link
Member

lrhn commented Aug 23, 2013

Johnni's question stands: Why is this not using the patch system?
Can it be made to do so?

It is definitely a defect in the dart2js library implementation.

@lrhn
Copy link
Member

lrhn commented May 5, 2014

Added Library-TypedData label.

@lrhn
Copy link
Member

lrhn commented Oct 7, 2014

Dart2js seems to support the Float32x4 operators now.


Added AssumedStale label.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-typed-data closed-obsolete Closed as the reported issue is no longer relevant labels Oct 7, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-typed-data
Projects
None yet
Development

No branches or pull requests

6 participants