-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GenericCPU now also uses the SIMDTable (+ workaround nim-lang/Nim#11668)
- Loading branch information
Showing
4 changed files
with
60 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Laser | ||
# Copyright (c) 2018 Mamy André-Ratsimbazafy | ||
# Distributed under the Apache v2 License (license terms are at http://www.apache.org/licenses/LICENSE-2.0). | ||
# This file may not be copied, modified, or distributed except according to those terms. | ||
|
||
import | ||
# Standard library | ||
macros | ||
|
||
type | ||
SimdPrimitives* = enum | ||
simdSetZero | ||
simdBroadcast | ||
simdLoadA | ||
simdLoadU | ||
simdStoreA | ||
simdStoreU | ||
simdAdd | ||
simdMul | ||
simdFma | ||
simdType | ||
|
||
template noop*(scalar: untyped): untyped = | ||
scalar | ||
|
||
template unreachable*(): untyped = | ||
{.error: "Unreachable".} | ||
|
||
proc genericPrimitives*: array[SimdPrimitives, NimNode] = | ||
# Use a proc instead of a const | ||
# to workaround https://github.com/nim-lang/Nim/issues/11668 | ||
[ | ||
simdSetZero: bindSym"unreachable", | ||
simdBroadcast: bindSym"noop", | ||
simdLoadA: bindSym"unreachable", | ||
simdLoadU: bindSym"unreachable", | ||
simdStoreA: bindSym"unreachable", | ||
simdStoreU: bindSym"unreachable", | ||
simdAdd: bindSym"+", | ||
simdMul: bindSym"*", | ||
simdFma: bindSym"unreachable", | ||
simdType: bindSym"unreachable" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters