-
Notifications
You must be signed in to change notification settings - Fork 797
Add SPV_INTEL_float_controls2 extension preview #1611
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
1dc5de5
40d7f91
f32982c
2682f50
39fa9b0
90fa11e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,206 @@ | ||
| SPV_INTEL_float_controls2 | ||
| ========================= | ||
|
|
||
| Name Strings | ||
| ------------ | ||
|
|
||
| SPV_INTEL_float_controls2 | ||
|
|
||
| Contact | ||
| ------- | ||
|
|
||
| To report problems or to provide input on this extension, please open a new issue at: | ||
| https://github.com/intel/llvm/issues | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - Gang Chen, Intel | ||
| - Mariusz Merecki, Intel | ||
| - Aleksander Us, Intel | ||
| - Konstantin Vladimirov, Intel | ||
| - Rudenko Nikita, Intel | ||
| Notice | ||
| ------ | ||
|
|
||
| Copyright (c) 2020 Intel Corporation. All rights reserved. | ||
|
|
||
| Status | ||
| ------ | ||
|
|
||
| Working Draft | ||
|
|
||
| This is a preview extension specification, intended to provide early access to a feature for review and community feedback. When the feature matures, this specification may be released as a formal extension. | ||
|
|
||
| Because the interfaces defined by this specification are not final and are subject to change they are not intended to be used by shipping software products. If you are interested in using this feature in your software product, please let us know! | ||
|
|
||
|
|
||
| Version | ||
| ------- | ||
|
|
||
| [width="40%",cols="25,25"] | ||
| |======================================== | ||
| | Last Modified Date | 2020-08-03 | ||
| | Revision | 3 | ||
| |======================================== | ||
|
|
||
| Dependencies | ||
| ------------ | ||
|
|
||
| This extension is written against the SPIR-V Specification, | ||
| Version 1.5, Revision 3, Unified | ||
|
|
||
| This extension requires SPIR-V 1.0. | ||
|
|
||
| Overview | ||
| -------- | ||
|
|
||
| This extension adds new execution modes and decorations to control floating-point computations. | ||
| This extension adds execution modes with round to positive infinity and round to negative infinity default rounding | ||
| and execution modes specifying compliance with floating-point arithmetic (IEEE 754) standard. | ||
| This extension adds new decorations that can be applied to a function to control floating-point computations inside the function. | ||
|
|
||
|
|
||
| Extension Name | ||
| -------------- | ||
|
|
||
| To use this extension within a SPIR-V module, the following | ||
| *OpExtension* must be present in the module: | ||
|
|
||
| ---- | ||
| OpExtension "SPV_INTEL_float_controls2" | ||
| ---- | ||
|
|
||
| Modifications to the SPIR-V Specification, Version 1.5, Revision 3, Unified | ||
| --------------------------------------------------------------------------- | ||
|
|
||
| Modify Section 3.6, Execution Mode, add the following rows to the Execution Mode table: | ||
|
|
||
| -- | ||
| [cols="1,20,10,10",options="header",width = "80%"] | ||
| |==== | ||
| 2+^| Execution Mode | Extra Operands | Enabling Capabilities | ||
| | 5620 | *RoundingModeRTPINTEL* + | ||
| The default rounding mode for floating-point arithmetic and conversions instructions must be round to positive infinity. | ||
| If an instruction is decorated with *FPRoundingMode* or defines a rounding mode in its description, that rounding mode is applied and *RoundingModeRTPINTEL* is ignored. | ||
| Only affects instructions operating on a floating-point type whose component width is _Target Width_. | ||
|
|
||
| _Target Width_ is an unsigned 32-bit integer. | ||
| | <<Literal, 'Literal'>> _Target Width_ | *RoundToInfinityINTEL* | ||
| | 5621 | *RoundingModeRTNINTEL* + | ||
| The default rounding mode for floating-point arithmetic and conversions instructions must be round to negative infinity. | ||
| If an instruction is decorated with *FPRoundingMode* or defines a rounding mode in its description, that rounding mode is applied and *RoundingModeRTNINTEL* is ignored. | ||
| Only affects instructions operating on a floating-point type whose component width is _Target Width_. | ||
|
|
||
| _Target Width_ is an unsigned 32-bit integer. | ||
| | <<Literal, 'Literal'>> _Target Width_ | *RoundToInfinityINTEL* | ||
| | 5622 | *FloatingPointModeALTINTEL* + | ||
| The default floating-point operation mode for floating-point arithmetic and conversions instructions must be the Alternative Floating-Point Mode as specified by the client API. | ||
| Only affects instructions operating on a floating-point type whose component width is _Target Width_. | ||
|
|
||
| _Target Width_ is an unsigned 32-bit integer. | ||
| | <<Literal, 'Literal'>> _Target Width_ | *FloatingPointModeINTEL* | ||
| | 5623 | *FloatingPointModeIEEEINTEL* + | ||
| The default floating-point operation mode for floating-point arithmetic and conversions instructions must be the IEEE 754 Mode as specified by the client API. | ||
| Only affects instructions operating on a floating-point type whose component width is _Target Width_. | ||
|
|
||
| _Target Width_ is an unsigned 32-bit integer. | ||
| | <<Literal, 'Literal'>> _Target Width_ | *FloatingPointModeINTEL* | ||
| |==== | ||
| -- | ||
| Modify Section 3 Binary form, add new sub-sections after 3.16 FP Rounding Mode: | ||
| -- | ||
| [[FP_Denorm_Mode]]*3.17. FP Denorm Mode* | ||
|
|
||
| Denormalized values handling mode. | ||
|
|
||
| [cols="^.^1,15,15",options="header",width = "50%"] | ||
| |==== | ||
| 2+^.^| FP Denorm Mode | Enabling Capabilities | ||
| | 0x0 | *Preserve* + | ||
bader marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Denormalized values must be preserved. | | ||
| | 0x1 | *FlushToZero* + | ||
| Denormalized values must be flushed to zero. | | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Confirming: For the FlushToZero denorm mode denormalized values must be flushed to zero? Or is it possible that some implementations may still preserve denorms? I'm reminded of this text for the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We already have corresponding execution modes whose description uses "is flushed to zero" or "is preserved". We could do the same here (instead of must ) and defer to Client API spec. |
||
| |==== | ||
| [[FP_Operation_Mode]]*3.18. FP Operation Mode* | ||
|
|
||
| Floating-point operation mode. | ||
|
|
||
| [cols="^.^1,15,15",options="header",width = "50%"] | ||
| |==== | ||
| 2+^.^| FP Operation Mode | Enabling Capabilities | ||
| | 0x0 | *IEEE* + | ||
bader marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Floating-point operation mode is IEEE 754 Mode. | | ||
| | 0x1 | *ALT* + | ||
| Floating-point operation mode is Alternative Mode. | | ||
| |==== | ||
| -- | ||
|
|
||
| Modify Section 3.20, Decoration, add the following rows to the Decoration table: | ||
|
|
||
| -- | ||
| [cols="1,20,5,5,10",options="header",width = "80%"] | ||
| |==== | ||
| 2+^| Decoration 2+| Extra Operands | Enabling Capabilities | ||
| | 5822 | *FunctionRoundingModeINTEL* + | ||
| Apply to a function to overwrite the default rounding mode for all floating-point arithmetic and conversion instructions inside the function. | ||
bader marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Only affects instructions operating on a floating-point type whose component width is _Target Width_. | ||
|
|
||
| _Target Width_ is an unsigned 32-bit integer. | ||
| |<<Literal, 'Literal'>> + | ||
| _Target Width_|<<FP_Rounding_Mode, 'FP Rounding Mode'>> + | ||
| _FP Rounding Mode_| *FunctionFloatControlINTEL* | ||
| | 5823 | *FunctionDenormModeINTEL* + | ||
| Apply to a function to overwrite the default mode of handling denormalized values for all floating-point arithmetic and conversion instructions inside the function. | ||
| Only affects instructions operating on a floating-point type whose component width is _Target Width_. | ||
|
|
||
| _Target Width_ is an unsigned 32-bit integer. | ||
| |<<Literal, 'Literal'>> + | ||
| _Target Width_|<<FP_Denorm_Mode, 'FP Denorm Mode'>> + | ||
| _FP Denorm Mode_| *FunctionFloatControlINTEL* | ||
| | 6080 | *FunctionFloatingPointModeINTEL* + | ||
| Apply to a function to overwrite the default floating-point operation mode for all floating-point arithmetic and conversion instructions inside the function. | ||
| Only affects instructions operating on a floating-point type whose component width is _Target Width_. | ||
|
|
||
| _Target Width_ is an unsigned 32-bit integer. | ||
| |<<Literal, 'Literal'>> + | ||
| _Target Width_|<<FP_Operation_Mode, 'FP_Operation_Mode'>> + | ||
| _FP Operation Mode_| *FunctionFloatControlINTEL* | ||
| |==== | ||
|
|
||
| Modify Section 3.31, Capability, add the following rows the 'Capability' table: | ||
| -- | ||
| [cols="1,20,10",options="header",width = "80%"] | ||
| |==== | ||
| 2+^| Capability | Implicitly Declares | ||
| | 5582 | *RoundToInfinityINTEL* + | ||
| Module uses *RoundingModeRTNINTEL* or *RoundingModeRTPINTEL* execution modes. | ||
| | | ||
| | 5583 | *FloatingPointModeINTEL* + | ||
| Module uses *FloatingPointModeIEEEINTEL* or *FloatingPointModeALTINTEL* execution modes. | ||
| | | ||
| | 5821 | *FunctionFloatControlINTEL* + | ||
| Module uses *FunctionRoundingModeINTEL*, *FunctionDenormModeINTEL* or *FunctionFloatingPointModeINTEL* decorations. | ||
| | | ||
| |==== | ||
| -- | ||
|
|
||
| Issues | ||
| ------ | ||
| -- | ||
|
|
||
| Revision History | ||
| ---------------- | ||
|
|
||
| [cols="5,15,15,70"] | ||
| [grid="rows"] | ||
| [options="header"] | ||
| |======================================== | ||
| |Rev|Date|Author|Changes | ||
| |1|2020-04-17|Mariusz Merecki|Initial revision | ||
| |2|2020-04-24|Mariusz Merecki|Assigned token numbers to *RoundToInfinityINTEL* and *FloatingPointModeINTEL* | ||
| |3|2020-08-03|Mariusz Merecki|Rebased to SPIR-V Version 1.5, Revision 3, Unified. Added *FunctionFloatControlINTEL* capability and *FunctionRoundingModeINTEL*, *FunctionDenormModeINTEL*, *FunctionFloatingPointModeINTEL* decorations | ||
| |======================================== | ||
Uh oh!
There was an error while loading. Please reload this page.