Bug 16503 – [ndslice] prevents fastmath LDC attribute

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-09-17T01:21:00Z
Last change time
2016-10-01T11:47:22Z
Assigned to
nobody
Creator
ilyayaroshenko

Comments

Comment #0 by ilyayaroshenko — 2016-09-17T01:21:53Z
Slice { front opIndex ptr ... } auto sl1 = slice!double(...); auto sl2 = slice!double(...); @fastmath ... { // loop for strides == 1 c += sl1.ptr[i] * sl2.ptr[i]; } c's computation can not be fully optimized because Slice primitives has not fastmath attribute. In the same time this is safe TODO: Slice { @fastmath: front opIndex ... } auto sl = slice!double(...); ... { // no fastmath // loop for strides == 1 c += sl1.ptr[i] * sl2.ptr[i]; } No optimisations in the last case. So, we can just mark all ndslice except mapSlice as @fastmath :-)
Comment #1 by github-bugzilla — 2016-09-28T22:09:16Z
Commit pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/99532a8f410f4e15dc1908974cdddf73852ac4a6 fix issue 16503 : add fast math bridge for LDC
Comment #2 by github-bugzilla — 2016-10-01T11:47:22Z
Commit pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/99532a8f410f4e15dc1908974cdddf73852ac4a6 fix issue 16503 : add fast math bridge for LDC