Bug 17964 – [CTFE] If array is large enough it hits __simd at CTFE

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-11-03T15:43:44Z
Last change time
2018-05-17T04:34:13Z
Keywords
pull
Assigned to
No Owner
Creator
Dmitry Olshansky

Comments

Comment #0 by dmitry.olsh — 2017-11-03T15:43:44Z
Array ops used to work at CTFE, now: uint bug(){ uint[] a = [1, 2, 3, 5, 6, 7]; uint[] b = [1, 2, 3, 5, 6, 7]; a[] |= ~b[]; return a[1]; } enum x = bug(); Produces on a recent master (1fa67d062b8d755b11722ea112af63cb34cc06b7): /home/olshanskiy/dmd2/linux/bin64/../../src/druntime/import/core/internal/arrayop.d(102): Error: __simd cannot be interpreted at compile time, because it has no available source code /home/olshanskiy/dmd2/linux/bin64/../../src/druntime/import/core/internal/arrayop.d-mixin-50(50): called from here: load(&res[pos]) /home/olshanskiy/dmd2/linux/bin64/../../src/druntime/import/core/internal/arrayop.d-mixin-50(50): called from here: binop(load(&res[pos]), unaop(load(&_param_1[pos]))) /home/olshanskiy/dmd2/linux/bin64/../../src/druntime/import/core/internal/arrayop.d-mixin-50(50): called from here: store(&res[pos], binop(load(&res[pos]), unaop(load(&_param_1[pos])))) bug.d(5): called from here: arrayOp(a[], b[]) bug.d(9): called from here: bug()
Comment #1 by uplink.coder — 2017-11-06T11:09:11Z
What needs to be done here is a change in druntime/src/core/internal/arrayops.d adding a __ctfe branch to load and store which works without simd intrinsics. I will take this if it is not fixed by the end of the week
Comment #2 by r.sagitario — 2018-02-28T14:19:42Z
Comment #3 by github-bugzilla — 2018-03-02T23:19:26Z
Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/fe4425678d9de2c085b1cdc0a97b28d2f8cf0dc8 Issue 17964 - [CTFE] If array is large enough it hits __simd at CTFE skip executing simd instructions at compile time https://github.com/dlang/druntime/commit/ce8c251aa0b52cdf1b83cc683a318f0766a087ee Merge pull request #2121 from rainers/issue17964 Issue 17964 - [CTFE] If array is large enough it hits __simd at CTFE
Comment #4 by bugzilla — 2018-05-17T04:34:13Z
This was fixed by the PR.