Skip to content

Conversation

@mlychkov
Copy link
Contributor

This patch introduces SPV_INTEL_arbitrary_precision_fixed_point extension,
which adds operations for arbitrary precision fixed point numbers.

The ac_fixed datatype is represented as a pseudo type using OpTypeInt. Its
parameters are:

  • W - total width of the datatype. It's encoded in the width of the OpTypeInt.
  • I - determines the position of the decimal point.
  • S - determines if this is a signed or an unsigned number.

Full specification (intel/llvm#1934):
https://github.com/intel/llvm/blob/2f6e965e686354fbb25f9c177a667a646de302eb/sycl/doc/extensions/SPIRV/SPV_INTEL_arbitrary_precision_fixed_point.asciidoc

@mlychkov
Copy link
Contributor Author

mlychkov commented Jul 27, 2020

This review is created as a continue of #614

@mlychkov
Copy link
Contributor Author

@AlexeySotkin @AlexeySachkov @vmaksimo @MrSidims Please review.

@mlychkov mlychkov force-pushed the private/mlychkov/ac_fixed branch from 271b96c to b6b30a8 Compare July 27, 2020 12:36
@mlychkov mlychkov force-pushed the private/mlychkov/ac_fixed branch from b6b30a8 to 7cf617c Compare July 29, 2020 12:17
@mlychkov mlychkov changed the title Enable translation of ac_fixed functions [SYCL][FPGA] Enable translation of ac_fixed functions Jul 29, 2020
@vmaksimo
Copy link
Contributor

LGTM

; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_arbitrary_precision_integers,+SPV_INTEL_arbitrary_precision_fixed_point -o %t.spv
; RUN: llvm-spirv %t.spv -to-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV

; RUN: llvm-spirv %t.bc --spirv-ext=+SPV_INTEL_arbitrary_precision_integers -spirv-text -o - | FileCheck %s --check-prefix=CHECK-SPIRV-NEGATIVE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will we produce a valid SPIR-V in this case? If no, I think we should report an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case if we translate to SPIR-V without SPV_INTEL_arbitrary_precision_fixed_point then those built-ins are translated as user defined function calls. I suppose that it is technically valid but linkage will be failed.
I may add error generation, but the same mechanism should be added for hls_float built-ins too. Sinse that feature has already merged I would address this change in a separate PR for both features later.

@AlexeySotkin
Copy link
Contributor

Please resolve the conflicts.

@mlychkov mlychkov force-pushed the private/mlychkov/ac_fixed branch 2 times, most recently from ea9c637 to d3ed6f5 Compare August 2, 2020 11:41
This patch introduces SPV_INTEL_arbitrary_precision_fixed_point extension,
which adds operations for arbitrary precision fixed point numbers.

The ac_fixed datatype is represented as a pseudo type using OpTypeInt. Its
parameters are:
* W - total width of the datatype. It's encoded in the width of the OpTypeInt.
* I - determines the position of the decimal point.
* S - determines if this is a signed or an unsigned number.

Full specification (intel/llvm#1934):
https://github.com/intel/llvm/blob/2f6e965e686354fbb25f9c177a667a646de302eb/sycl/doc/extensions/SPIRV/SPV_INTEL_arbitrary_precision_fixed_point.asciidoc
@mlychkov mlychkov force-pushed the private/mlychkov/ac_fixed branch from d3ed6f5 to a277abb Compare August 6, 2020 14:20
@mlychkov
Copy link
Contributor Author

mlychkov commented Aug 7, 2020

@AlexeySachkov Could you please review?

@AlexeySachkov AlexeySachkov merged commit a69a0f7 into KhronosGroup:master Aug 7, 2020
vmaksimo added a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Aug 25, 2020
… extensions

This patch addresses
KhronosGroup#653 (comment)

If the appropriate extension for arbitrary precision instruction is not
enabled, invalid IR will be produced. Report an error in this case.
AlexeySachkov pushed a commit that referenced this pull request Sep 9, 2020
… extensions (#714)

This patch addresses [comment][1]

If the appropriate extension for arbitrary precision instruction is not
enabled, invalid IR will be produced. Report an error in this case.

[1]: #653 (comment)
vladimirlaz pushed a commit to vladimirlaz/llvm that referenced this pull request Sep 13, 2020
… extensions (intel#714)

This patch addresses [comment][1]

If the appropriate extension for arbitrary precision instruction is not
enabled, invalid IR will be produced. Report an error in this case.

[1]: KhronosGroup/SPIRV-LLVM-Translator#653 (comment)
svenvh pushed a commit to svenvh/SPIRV-LLVM-Translator that referenced this pull request Nov 4, 2020
…up#653)

This patch introduces SPV_INTEL_arbitrary_precision_fixed_point extension,
which adds operations for arbitrary precision fixed point numbers.

The ac_fixed datatype is represented as a pseudo type using OpTypeInt. Its
parameters are:
* W - total width of the datatype. It's encoded in the width of the OpTypeInt.
* I - determines the position of the decimal point.
* S - determines if this is a signed or an unsigned number.

Full specification  can be found in intel/llvm#1934

Co-authored-by: Viktoria Maksimova <[email protected]>
svenvh pushed a commit to svenvh/SPIRV-LLVM-Translator that referenced this pull request Nov 4, 2020
… extensions (KhronosGroup#714)

This patch addresses [comment][1]

If the appropriate extension for arbitrary precision instruction is not
enabled, invalid IR will be produced. Report an error in this case.

[1]: KhronosGroup#653 (comment)
svenvh pushed a commit that referenced this pull request Nov 12, 2020
This patch introduces SPV_INTEL_arbitrary_precision_fixed_point extension,
which adds operations for arbitrary precision fixed point numbers.

The ac_fixed datatype is represented as a pseudo type using OpTypeInt. Its
parameters are:
* W - total width of the datatype. It's encoded in the width of the OpTypeInt.
* I - determines the position of the decimal point.
* S - determines if this is a signed or an unsigned number.

Full specification  can be found in intel/llvm#1934

Co-authored-by: Viktoria Maksimova <[email protected]>
svenvh pushed a commit that referenced this pull request Nov 12, 2020
… extensions (#714)

This patch addresses [comment][1]

If the appropriate extension for arbitrary precision instruction is not
enabled, invalid IR will be produced. Report an error in this case.

[1]: #653 (comment)
@mlychkov mlychkov deleted the private/mlychkov/ac_fixed branch March 4, 2021 08:02
DmitryBushev pushed a commit to DmitryBushev/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2021
…up#653)

This patch introduces SPV_INTEL_arbitrary_precision_fixed_point extension,
which adds operations for arbitrary precision fixed point numbers.

The ac_fixed datatype is represented as a pseudo type using OpTypeInt. Its
parameters are:
* W - total width of the datatype. It's encoded in the width of the OpTypeInt.
* I - determines the position of the decimal point.
* S - determines if this is a signed or an unsigned number.

Full specification  can be found in intel/llvm#1934

Co-authored-by: Viktoria Maksimova <[email protected]>
vmaksimo pushed a commit to vmaksimo/SPIRV-LLVM-Translator that referenced this pull request Sep 1, 2022
…recision_fixed_point (KhronosGroup#653)

Change-Id: I4773436f38a116b47d7cd41411838f6b0dfd2f69
Reviewed-on: https://git-amr-2.devtools.intel.com/gerrit/265338
Tested-by: LiuChen <[email protected]>
Reviewed-by: LiuChen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants