Skip to content

Commit

Permalink
fix list syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
bashbaug authored and alycm committed Jun 30, 2020
1 parent 7217b86 commit 913ec7f
Showing 1 changed file with 52 additions and 37 deletions.
89 changes: 52 additions & 37 deletions ext/cl_khr_fp16.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1811,53 +1811,63 @@ These conversions are performed as follows:

`CL_UNORM_INT8` (8-bit unsigned integer) {rightarrow} `half`

:: normalized `half` value = `round_to_half(c / 255)`
[none]
* normalized `half` value = `round_to_half(c / 255)`

`CL_UNORM_INT_101010` (10-bit unsigned integer) {rightarrow} `half`

:: normalized `half` value = `round_to_half(c / 1023)`
[none]
* normalized `half` value = `round_to_half(c / 1023)`

`CL_UNORM_INT16` (16-bit unsigned integer) {rightarrow} `half`

:: normalized `half` value = `round_to_half(c / 65535)`
[none]
* normalized `half` value = `round_to_half(c / 65535)`

`CL_SNORM_INT8` (8-bit signed integer) {rightarrow} `half`

:: normalized `half` value = `max(-1.0f, round_to_half(c / 127))`
[none]
* normalized `half` value = `max(-1.0f, round_to_half(c / 127))`

`CL_SNORM_INT16` (16-bit signed integer) {rightarrow} `half`

:: normalized `half` value = `max(-1.0f, round_to_half(c / 32767))`
[none]
* normalized `half` value = `max(-1.0f, round_to_half(c / 32767))`

The accuracy of the above conversions must be \<= 1.5 ulp except for the
following cases.

For `CL_UNORM_INT8`

:: 0 must convert to `0.0h` and
:: 255 must convert to `1.0h`
[none]
* 0 must convert to `0.0h` and
* 255 must convert to `1.0h`

For `CL_UNORM_INT_101010`

:: 0 must convert to `0.0h` and
:: 1023 must convert to `1.0h`
[none]
* 0 must convert to `0.0h` and
* 1023 must convert to `1.0h`

For `CL_UNORM_INT16`

:: 0 must convert to `0.0h` and
:: 65535 must convert to `1.0h`
[none]
* 0 must convert to `0.0h` and
* 65535 must convert to `1.0h`

For `CL_SNORM_INT8`

:: -128 and -127 must convert to `-1.0j`,
:: 0 must convert to `0.0h` and
:: 127 must convert to `1.0h`
[none]
* -128 and -127 must convert to `-1.0j`,
* 0 must convert to `0.0h` and
* 127 must convert to `1.0h`

For `CL_SNORM_INT16`

:: -32768 and -32767 must convert to `-1.0h`,
:: 0 must convert to `0.0h` and
:: 32767 must convert to `1.0h`
[none]
* -32768 and -32767 must convert to `-1.0h`,
* 0 must convert to `0.0h` and
* 32767 must convert to `1.0h`


[[cl_khr_fp16-converting-floating-point-values-to-normalized-integer-channel-data-types]]
Expand All @@ -1879,35 +1889,40 @@ the result of the conversion must satisfy the bound given below.

`half` {rightarrow} `CL_UNORM_INT8` (8-bit unsigned integer)

:: Let f~exact~ = *max*(`0`, *min*(`f * 255`, `255`))
:: Let f~preferred~ = *convert_uchar_sat_rte*(`f * 255.0f`)
:: Let f~approx~ = *convert_uchar_sat_<impl-rounding-mode>*(`f * 255.0f`)
:: *fabs*(f~exact~ - f~approx~) must be \<= 0.6
[none]
* Let f~exact~ = *max*(`0`, *min*(`f * 255`, `255`))
* Let f~preferred~ = *convert_uchar_sat_rte*(`f * 255.0f`)
* Let f~approx~ = *convert_uchar_sat_<impl-rounding-mode>*(`f * 255.0f`)
* *fabs*(f~exact~ - f~approx~) must be \<= 0.6

`half` {rightarrow} `CL_UNORM_INT_101010` (10-bit unsigned integer)

:: Let f~exact~ = *max*(`0`, *min*(`f * 1023`, `1023`))
:: Let f~preferred~ = *min*(*convert_ushort_sat_rte*(`f * 1023.0f`), `1023`)
:: Let f~approx~ = *convert_ushort_sat_<impl-rounding-mode>*(`f * 1023.0f`)
:: *fabs*(f~exact~ - f~approx~) must be \<= 0.6
[none]
* Let f~exact~ = *max*(`0`, *min*(`f * 1023`, `1023`))
* Let f~preferred~ = *min*(*convert_ushort_sat_rte*(`f * 1023.0f`), `1023`)
* Let f~approx~ = *convert_ushort_sat_<impl-rounding-mode>*(`f * 1023.0f`)
* *fabs*(f~exact~ - f~approx~) must be \<= 0.6

`half` {rightarrow} `CL_UNORM_INT16` (16-bit unsigned integer)

:: Let f~exact~ = *max*(`0`, *min*(`f * 65535`, `65535`))
:: Let f~preferred~ = *convert_ushort_sat_rte*(`f * 65535.0f`)
:: Let f~approx~ = *convert_ushort_sat_<impl-rounding-mode>*(`f * 65535.0f`)
:: *fabs*(f~exact~ - f~approx~) must be \<= 0.6
[none]
* Let f~exact~ = *max*(`0`, *min*(`f * 65535`, `65535`))
* Let f~preferred~ = *convert_ushort_sat_rte*(`f * 65535.0f`)
* Let f~approx~ = *convert_ushort_sat_<impl-rounding-mode>*(`f * 65535.0f`)
* *fabs*(f~exact~ - f~approx~) must be \<= 0.6

`half` {rightarrow} `CL_SNORM_INT8` (8-bit signed integer)

:: Let f~exact~ = *max*(`-128`, *min*(`f * 127`, `127`))
:: Let f~preferred~ = *convert_char_sat_rte*(`f * 127.0f`)
:: Let f~approx~ = *convert_char_sat_<impl_rounding_mode>*(`f * 127.0f`)
:: *fabs*(f~exact~ - f~approx~) must be \<= 0.6
[none]
* Let f~exact~ = *max*(`-128`, *min*(`f * 127`, `127`))
* Let f~preferred~ = *convert_char_sat_rte*(`f * 127.0f`)
* Let f~approx~ = *convert_char_sat_<impl_rounding_mode>*(`f * 127.0f`)
* *fabs*(f~exact~ - f~approx~) must be \<= 0.6

`half` {rightarrow} `CL_SNORM_INT16` (16-bit signed integer)

:: Let f~exact~ = *max*(`-32768`, *min*(`f * 32767`, `32767`))
:: Let f~preferred~ = *convert_short_sat_rte*(`f * 32767.0f`)
:: Let f~approx~ = *convert_short_sat_<impl-rounding-mode>*(`f * 32767.0f`)
:: *fabs*(f~exact~ - f~approx~) must be \<= 0.6
[none]
* Let f~exact~ = *max*(`-32768`, *min*(`f * 32767`, `32767`))
* Let f~preferred~ = *convert_short_sat_rte*(`f * 32767.0f`)
* Let f~approx~ = *convert_short_sat_<impl-rounding-mode>*(`f * 32767.0f`)
* *fabs*(f~exact~ - f~approx~) must be \<= 0.6

0 comments on commit 913ec7f

Please sign in to comment.