Skip to content

Commit

Permalink
clarify that HWY_LANES is internal-only (incorrect for SVE/RVV), thanks
Browse files Browse the repository at this point in the history
@eustas for raising this. Also deprecate GE256/512 for the same reason.

PiperOrigin-RevId: 372584076
  • Loading branch information
jan-wassenberg authored and Copybara-Service committed May 7, 2021
1 parent bd0374f commit 2f14bd0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 4 additions & 6 deletions g3doc/quick_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -743,23 +743,21 @@ generate such instructions (implying the target CPU would have to support them).
finally reverts to `HWY_STATIC_TARGET`. Can be used in `#if` expressions to
provide an alternative to functions which are not supported by HWY_SCALAR.

* `HWY_LANES(T)`: how many lanes of type `T` in a full vector (>= 1). Used by
HWY_FULL/CAPPED. Note: cannot be used in #if because it uses sizeof.

* `HWY_IDE` is 0 except when parsed by IDEs; adding it to conditions such as
`#if HWY_TARGET != HWY_SCALAR || HWY_IDE` avoids code appearing greyed out.

The following signal capabilities and expand to 1 or 0.

* `HWY_CAP_INTEGER64`: support for 64-bit signed/unsigned integer lanes.
* `HWY_CAP_FLOAT64`: support for double-precision floating-point lanes.
* `HWY_CAP_GE256`: the current target supports vectors of >= 256 bits.
* `HWY_CAP_GE512`: the current target supports vectors of >= 512 bits.

The following were used to signal the maximum number of lanes for certain
operations, but this is no longer necessary, so they are DEPRECATED:
operations, but this is no longer necessary (nor possible on SVE/RVV), so they
are DEPRECATED:

* `HWY_GATHER_LANES(T)`.
* `HWY_CAP_GE256`: the current target supports vectors of >= 256 bits.
* `HWY_CAP_GE512`: the current target supports vectors of >= 512 bits.

## Detecting supported targets

Expand Down
1 change: 1 addition & 0 deletions hwy/ops/set_macros-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@
#elif HWY_TARGET == HWY_SCALAR

#define HWY_ALIGN
// For internal use only; use Lanes(d) instead.
#define HWY_LANES(T) 1

#define HWY_CAP_INTEGER64 1
Expand Down

0 comments on commit 2f14bd0

Please sign in to comment.