llvm-beanz wrote:

> This is the documentation i found. Can you confirm the intent is only to 
> support `.x???` and `r???` ? It alludes to more options. Maybe we need a 
> `isHLSLSwizzleStart` function to avoid comparing to `'x'` and `'r'` in 
> multiple places.

The documentation for this is bad. Single element vectors can only have `x` and 
`r` components, so it should never be anything else. Adding a helper is 
probably worth doing just for code simplicity and expressivity. We also don't 
support the `r` suffix, so there shouldn't be any syntactic ambiguity with 
things like `1.r` being interpreted as fixed point.

> https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx9-graphics-reference-asm-vs-registers-modifiers-source-swizzling
>  
> https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx9-graphics-reference-asm-ps-registers-modifiers-source-register-swizzling

There is also this page:
https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-per-component-math

It doesn't really add much.

> I don't suppose there is a specification / grammar for these things?

Working on it. I've been working to draft a language specification [over 
here](https://github.com/microsoft/hlsl-specs/tree/main/specs/language). I 
haven't yet gotten to the vector grammar. I'm unfortunately chasing down too 
many paths at once trying to both get enough syntax supported that we can 
generate real programs to flesh out codegen, and trying to get the language 
semantics documented and implemented in a way that conforms with the reference 
compilers.

I'm digging myself out from the Dev Meeting, but I'll work on getting an update 
to this PR posted this week.

Thanks for the great feedback!

https://github.com/llvm/llvm-project/pull/67700
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to