D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15727 - DMD adds default opEqals to structure with SIMD vector
Summary: DMD adds default opEqals to structure with SIMD vector
Status: RESOLVED DUPLICATE of issue 13852
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: SIMD
Depends on:
Blocks:
 
Reported: 2016-02-26 22:12 UTC by Iakh
Modified: 2020-03-21 03:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iakh 2016-02-26 22:12:55 UTC
This compiles despite there isn't defined opEqals for core.simd vectors

import core.simd;

struct S
{
    int4 vec;
}
void main()
{
    S a, b;
    assert(a == b);

    // While this doesn't
    //int4 a, b
    //assert(a == b);

}

DMD64 D Compiler v2.070
Comment 1 basile-z 2019-11-03 19:31:17 UTC
This is normal for a struct, a default comparison occurs, i.e on the whole structure. The real issue here is then that vectors of same type cant be compared, and this has been already reported.

*** This issue has been marked as a duplicate of issue 13852 ***