Skip to content

handle OpBitcast between pointers and non-pointers#2948

Merged
MrSidims merged 6 commits intoKhronosGroup:mainfrom
bashbaug:OpBitcast_ptr
Jan 7, 2025
Merged

handle OpBitcast between pointers and non-pointers#2948
MrSidims merged 6 commits intoKhronosGroup:mainfrom
bashbaug:OpBitcast_ptr

Conversation

@bashbaug
Copy link
Copy Markdown
Contributor

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

Even though we only expect to OpBitcast a pointer to a vector of
two 32-bit integers, it's easy enough to just handle all vector
types.
Comment thread test/OpBitcast_ptr_vector.spvasm Outdated
Comment thread lib/SPIRV/SPIRVReader.cpp
@MrSidims MrSidims merged commit aafca81 into KhronosGroup:main Jan 7, 2025
svenvh pushed a commit to svenvh/SPIRV-LLVM-Translator that referenced this pull request Jan 9, 2025
…hronosGroup#2948)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)
svenvh pushed a commit to svenvh/SPIRV-LLVM-Translator that referenced this pull request Jan 10, 2025
…hronosGroup#2948)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)
svenvh pushed a commit to svenvh/SPIRV-LLVM-Translator that referenced this pull request Jan 10, 2025
…hronosGroup#2948)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)
svenvh pushed a commit to svenvh/SPIRV-LLVM-Translator that referenced this pull request Jan 10, 2025
…hronosGroup#2948)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)
svenvh pushed a commit to svenvh/SPIRV-LLVM-Translator that referenced this pull request Jan 10, 2025
…hronosGroup#2948)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)
svenvh pushed a commit to svenvh/SPIRV-LLVM-Translator that referenced this pull request Jan 10, 2025
…hronosGroup#2948)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)
svenvh added a commit that referenced this pull request Jan 13, 2025
…2948) (#2959)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
svenvh added a commit that referenced this pull request Jan 13, 2025
…2948) (#2958)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
svenvh added a commit that referenced this pull request Jan 13, 2025
…2948) (#2957)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
svenvh added a commit that referenced this pull request Jan 13, 2025
…2948) (#2956)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
svenvh added a commit that referenced this pull request Jan 13, 2025
…2948) (#2955)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
svenvh added a commit that referenced this pull request Jan 13, 2025
…2948) (#2952)

Adds support for SPIR-V OpBitcast instructions where the source is a pointer and the destination is not a pointer, and where the source is not a pointer and the destination is a pointer. This needs to be handled as a special case because the LLVM bitcast instruction does not support this.

Handles bitcasts between pointers and scalar integers, which is supported by all SPIR-V versions, and pointers and vectors of integers, which is supported by SPIR-V 1.5 (though only for vectors of 32-bit integers).

(cherry picked from commit aafca81)

Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
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.

3 participants