# `nupp.runtime.bitops.spi`
Implementation interfaces consumed during ordinary module initialization.
Discover with nupp.spi.load; the consumer chooses the unique highest priority.
Omitted priority is zero. Importing these declarations loads no implementation.
## Types
### `Provider` _interface_
```nupp
interface Provider ...
```
32-bit operations with Lua BitOp semantics.
Results are signed integers representing 32-bit words, including logical right
shift results whose high bit is set. Inputs normalize to 32 bits; shifts and
rotates mask counts to five bits. Variadic operations consume every operand.
Providers must preserve these conventions even on hosts with unsigned primitives.
#### Members
| Name | Kind | Description |
| --- | --- | --- |
| [`priority`](#nupp.runtime.bitops.spi.Provider.priority) | field | |
| [`tobit`](#nupp.runtime.bitops.spi.Provider.tobit) | method | Normalizes a numeric operand to a signed 32-bit word. |
| [`tohex`](#nupp.runtime.bitops.spi.Provider.tohex) | method | Formats the low requested hexadecimal digits; negative digits select uppercase. |
| [`rol`](#nupp.runtime.bitops.spi.Provider.rol) | method | Rotates left by the low five bits of count. |
| [`ror`](#nupp.runtime.bitops.spi.Provider.ror) | method | Rotates right by the low five bits of count. |
| [`bswap`](#nupp.runtime.bitops.spi.Provider.bswap) | method | Reverses the four bytes of the normalized word. |
| [`band`](#nupp.runtime.bitops.spi.Provider.band) | method | Bitwise conjunction of the first operand and every remaining operand. |
| [`bor`](#nupp.runtime.bitops.spi.Provider.bor) | method | Bitwise disjunction of every operand. |
| [`bxor`](#nupp.runtime.bitops.spi.Provider.bxor) | method | Bitwise exclusive-or of every operand. |
| [`bnot`](#nupp.runtime.bitops.spi.Provider.bnot) | method | Inverts all 32 bits. |
| [`lshift`](#nupp.runtime.bitops.spi.Provider.lshift) | method | Shifts left, discarding bits beyond the word. |
| [`rshift`](#nupp.runtime.bitops.spi.Provider.rshift) | method | Shifts right with zero fill, then returns the signed word representation. |
| [`arshift`](#nupp.runtime.bitops.spi.Provider.arshift) | method | Shifts right with sign extension. |
#### `priority` _field_
```nupp
priority: integer?
```
`@readonly`
#### `tobit` _method_
```nupp
tobit: function(value: number): integer
```
`@readonly`
Normalizes a numeric operand to a signed 32-bit word.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `tohex` _method_
```nupp
tohex: function(value: number, digits: number?): string
```
`@readonly`
Formats the low requested hexadecimal digits; negative digits select uppercase.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
| `digits` | `number?` | |
##### Returns
| Type | Description |
| --- | --- |
| `string` | |
#### `rol` _method_
```nupp
rol: function(value: number, count: number): integer
```
`@readonly`
Rotates left by the low five bits of count.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
| `count` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `ror` _method_
```nupp
ror: function(value: number, count: number): integer
```
`@readonly`
Rotates right by the low five bits of count.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
| `count` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `bswap` _method_
```nupp
bswap: function(value: number): integer
```
`@readonly`
Reverses the four bytes of the normalized word.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `band` _method_
```nupp
band: function(first: number, ...: number): integer
```
`@readonly`
Bitwise conjunction of the first operand and every remaining operand.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `first` | `number` | |
| `...` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `bor` _method_
```nupp
bor: function(first: number, ...: number): integer
```
`@readonly`
Bitwise disjunction of every operand.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `first` | `number` | |
| `...` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `bxor` _method_
```nupp
bxor: function(first: number, ...: number): integer
```
`@readonly`
Bitwise exclusive-or of every operand.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `first` | `number` | |
| `...` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `bnot` _method_
```nupp
bnot: function(value: number): integer
```
`@readonly`
Inverts all 32 bits.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `lshift` _method_
```nupp
lshift: function(value: number, count: number): integer
```
`@readonly`
Shifts left, discarding bits beyond the word.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
| `count` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `rshift` _method_
```nupp
rshift: function(value: number, count: number): integer
```
`@readonly`
Shifts right with zero fill, then returns the signed word representation.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
| `count` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |
#### `arshift` _method_
```nupp
arshift: function(value: number, count: number): integer
```
`@readonly`
Shifts right with sign extension.
##### Arguments
| Name | Type | Description |
| --- | --- | --- |
| `value` | `number` | |
| `count` | `number` | |
##### Returns
| Type | Description |
| --- | --- |
| `integer` | |