D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10738 - double2 ^^ 2 and double2 ^^ 3 are missing
Summary: double2 ^^ 2 and double2 ^^ 3 are missing
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: diagnostic, SIMD
Depends on:
Blocks:
 
Reported: 2013-07-31 14:33 UTC by bearophile_hugs
Modified: 2020-12-22 05:31 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2013-07-31 14:33:02 UTC
import std.math;
import core.simd: double2;
void main() {
    double2 x;
    double2 y = x ^^ 2;
    double2 z = x ^^ 3;
}


Gives errors like:

test.d:5: Error: template std.math.pow does not match any function template declaration
.../math.d:3180: Error: template std.math.pow cannot deduce template function from argument types !()(__vector(double[2LU]),__vector(double[2LU]))


Similar errors are generated by ldc2 on Windows32.
Comment 1 Iain Buclaw 2017-12-12 22:42:06 UTC
SIMD ^^ is neither generic, nor a trivial thing to implement.

We should really just flat out error here.
Comment 2 Walter Bright 2020-12-22 05:31:03 UTC
Now it errs with the messages:

test.d(6): Error: incompatible types for (x) ^^ (cast(__vector(double[2]))2.0): both operands are of type __vector(double[2])
test.d(7): Error: incompatible types for (x) ^^ (cast(__vector(double[2]))3.0): both operands are of type __vector(double[2])

which is adequate.