Bug 10445 – add .min, .max, etc. properties for vector types
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-22T07:40:22Z
Last change time
2020-12-22T11:17:40Z
Keywords
pull, SIMD
Assigned to
No Owner
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-06-22T07:40:22Z
This SIMD code compiles, but it's not handy:
import core.simd;
void main() {
enum U = ubyte.max;
ubyte16 m = [U,U,U,U,U,U,U,U,U,U,U,U,U,U,U,U];
}
So maybe it's worth adding the ".max" and ".min" attributes to simd registers, to allow:
import core.simd;
void main() {
auto a = ubyte16.max; // All initialized to ubyte.max.
auto b = int4.min; // All initizialized to int.min.
}
This also allows to write simd code that looks more like regular code.
Comment #1 by bugzilla — 2016-11-20T08:21:06Z
You can do things like:
ubyte16 a = ubyte.max;
as broadcasting works.
Comment #2 by dlang-bot — 2020-12-22T07:31:28Z
@WalterBright created dlang/dmd pull request #12045 "fix Issue 10445 - add .min, .max, etc. properties for vector types" fixing this issue:
- fix Issue 10445 - add .min, .max, etc. properties for vector types
https://github.com/dlang/dmd/pull/12045
Comment #3 by dlang-bot — 2020-12-22T08:06:46Z
@WalterBright created dlang/dlang.org pull request #2922 "fix Issue 10445 - add .min, .max, etc. properties for vector types" fixing this issue:
- fix Issue 10445 - add .min, .max, etc. properties for vector types
https://github.com/dlang/dlang.org/pull/2922
Comment #4 by dlang-bot — 2020-12-22T09:33:51Z
dlang/dmd pull request #12045 "fix Issue 10445 - add .min, .max, etc. properties for vector types" was merged into master:
- ff88025b51b8074f930295f4a735b76af554e973 by Walter Bright:
fix Issue 10445 - add .min, .max, etc. properties for vector types
https://github.com/dlang/dmd/pull/12045
Comment #5 by dlang-bot — 2020-12-22T11:17:40Z
dlang/dlang.org pull request #2922 "fix Issue 10445 - add .min, .max, etc. properties for vector types" was merged into master:
- 40e9255d5be18f984b042c389657c4422244c88f by Walter Bright:
fix Issue 10445 - add .min, .max, etc. properties for vector types
https://github.com/dlang/dlang.org/pull/2922