5 Commits

Author SHA1 Message Date
Chris B
02654f7370
[HLSL][Doc] Document multi-argument resolution (#104474)
This updates the expected diffferences document to capture the
difference in multi-argument overload resolution between Clang and DXC.

Fixes #99530
2024-08-30 16:18:46 -05:00
Greg Roth
ad6685b252
Correct confusing headers in HLSLDocs (#100017)
AvailabilityDiagnostics.rst and ExpectedDifferences.rst both had
multiple headers that were perceived to be the "top-level".

In AvailabilityDiagnostics.rst two headers had both over and underlines.
The second was the "Examples" section so it showed up in the top level
HLSL docs. The overline is removed here so it's clear it's a subheader.

In ExpectedDifferences.rst, the first header had no overline, so a few
headers that looked the same were included. The overline is added to the
top header to make clear that it's the main header.
2024-07-22 18:06:33 -07:00
Chris B
d91ff3f240
[HLSL] Rework implicit conversion sequences (#96011)
This PR reworks HLSL's implicit conversion sequences. Initially I was
seeking to match DXC's behavior more closely, but that was leading to a
pile of special case rules to tie-break ambiguous cases that should
really be left as ambiguous. We've decided that we're going to break
compatibility with DXC here, and we may port this new behavior over to
DXC instead.

This change is a bit closer to C++'s overload resolution rules, but it
does have a bit of nuance around how dimension adjustment conversions
are ranked. Conversion sequence ranks for HLSL are:

* Exact match
* Scalar Widening (i.e. splat)
* Promotion
* Scalar Widening with Promotion
* Conversion
* Scalar Widening with Conversion
* Dimension Reduction (i.e. truncation)
* Dimension Reduction with Promotion
* Dimension Reduction with Conversion

In this implementation I've folded the disambiguation into the
conversion sequence ranks which does add some complexity as compared to
C++, however this avoids needing to add special casing in
`CompareStandardConversionSequences`. I believe the added conversion
rank values provide a simpler approach, but feedback is appreciated.

The HLSL language spec updates are in the PR here:
https://github.com/microsoft/hlsl-specs/pull/261
2024-07-13 12:23:22 -05:00
Nathan Sidwell
8e22fffc85 [clang] Remove trailing whitespace
Fix commit 66f6929fec3ae
2024-02-24 12:25:08 -05:00
Chris B
66f6929fec
[HLSL][Doc] Add doc about expected differences (#82395)
This document covers expected differences between Clang and the HLSL
reference compiler implementations (FXC & DXC). The document is not
intended to be exhaustive, but it should be a best effort to cover known
cases.

This document should document both the behavioral difference and the
explanation of why Clang differs.

The initail document covers known overload resolution differences.

---------

Co-authored-by: S. Bharadwaj Yadavalli <Bharadwaj.Yadavalli@microsoft.com>
2024-02-22 14:32:24 -06:00