Skip to content

Conversation

@damyanp
Copy link
Member

@damyanp damyanp commented Apr 10, 2025

Merge latest main into staging-sm6.9.

llvm-beanz and others added 2 commits April 9, 2025 16:41
…osoft#7324)

This enables the generation of native vector DXIL Operations
that are "trivial", meaning they take only a single DXOp Call
instruction to implement as well as a few others that either only took
such a call and some llvm operations or were of particular interest for
other reasons.

This involves allowing the overloads by adding the vector indication in
hctdb, altering the lowering to maintain the vectors instead of
scalarizing them, and a few sundry changes to fix issues along the way.

The "trivial" dxil operations that return a different value from the
overload type had to be moved out of the way and given their own
lowering function so that the main function could generate vectors
conditional on the version and vector type. These will be added in a
later change.

While the long vector supporting intrinsics that weren't given this
treatment will continue to generate scalarized operations, some of them
needed some work as well. The dot product for float vectors longer than
4 had to take the integer fallback path, which required some small
modificaitons and a rename.
Additionally, a heuristic for pow that malfunctioned with too many
elements had to have a limit placed on it.

Since the or()/and()/select() intrinsics translate directly to LLVM ops,
they can have their lowering scalarization removed and what future
scalarization might be needed by the current version can be done by
later passes as with other LLVM operators.

An issue with a special value used to represent unassined dimensions had
to be addressed since new dimensions can exceed that value. It's now
MAX_INT.

Contributes to microsoft#7120, but I'd prefer to leave it open until all
intrinsics are covered

Primary work by @pow2clk

Fixes microsoft#7297 & microsoft#7120

---------

Co-authored-by: Greg Roth <grroth@microsoft.com>
@github-actions
Copy link
Contributor

github-actions bot commented Apr 10, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff d478b8626a0e83b4959859895b7a65b4b76003b3 32c8357a3ffc61ebf03a43ea99f24817917d176c -- include/dxc/DXIL/DxilInstructions.h lib/DXIL/DxilOperations.cpp lib/HLSL/HLOperationLower.cpp tools/clang/lib/Sema/SemaHLSL.cpp
View the diff from clang-format here.
diff --git a/tools/clang/lib/Sema/SemaHLSL.cpp b/tools/clang/lib/Sema/SemaHLSL.cpp
index 72dd6d41..2d668aac 100644
--- a/tools/clang/lib/Sema/SemaHLSL.cpp
+++ b/tools/clang/lib/Sema/SemaHLSL.cpp
@@ -387,7 +387,7 @@ enum ArBasicKind {
 #define IS_BPROP_UNSIGNABLE(_Props)                                            \
   (IS_BPROP_AINT(_Props) && GET_BPROP_BITS(_Props) != BPROP_BITS12)
 
-#define IS_BPROP_ENUM(_Props) (((_Props)&BPROP_ENUM) != 0)
+#define IS_BPROP_ENUM(_Props) (((_Props) & BPROP_ENUM) != 0)
 
 const UINT g_uBasicKindProps[] = {
     BPROP_PRIMITIVE | BPROP_BOOLEAN | BPROP_INTEGER | BPROP_NUMERIC |
  • Check this box to apply formatting changes to this branch.

@damyanp damyanp merged commit 4ce225f into microsoft:staging-sm6.9 Apr 10, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in HLSL Roadmap Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants