Skip to content
Snippets Groups Projects
Commit 80aa79bb authored by Jö Fahlke's avatar Jö Fahlke
Browse files

[!662] [Simd] Ignore value-initialization issues in vectorclass.

Merge branch 'simd-ignore-vectorclass-value-initialization-issues' into 'master'

ref:core/dune-common Value-initialized Vectorclass simd types are not always
initialized. The reason is that vectorclass defines default-constructors for
its Simd types with empty body and no member initializers.
Value-initialization will see those constructors and invoke
default-initialization. As the mask types sometimes just contain an
`unsigned short` or similar fundamental data type, default-initializing that
does nothing and leaves it inintialized.

To make value-initialization work reliably, vectorclass would need to do one
of two things:

-   Make sure the default-constructor is implicitly or explicitly defaulted.
    That would mean value-initialization would invoke zero-initialization
    before default-inizialization, which would clear the member
-   Provide a default initializer when declaring the member, which would then
    be used when the class does not define an initializer for the member in
    the default-constructor's member-initializer-list.

Since I can't really fix vectorclass, work around this issue by using
direct-initialization with an initializer (Simd::Scalar<V>(0)) to initialize
simd types.

Closes: [extensions/dune-vectorclass#9]

See merge request [!662]

  [extensions/dune-vectorclass#9]: gitlab.dune-project.org/extensions/dune-vectorclass/issues/9
  [!662]: gitlab.dune-project.org/core/dune-common/merge_requests/662


Closes extensions/dune-vectorclass#9
parents 07b27021 d676c3cb
No related branches found
No related tags found
1 merge request!662[Simd] Ignore value-initialization issues in vectorclass.
Pipeline #18284 passed
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment