Thanks for using Compiler Explorer
Sponsors
Jakt
C++
Ada
Algol68
Analysis
Android Java
Android Kotlin
Assembly
C
C3
Carbon
C with Coccinelle
C++ with Coccinelle
C++ (Circle)
CIRCT
Clean
Clojure
CMake
CMakeScript
COBOL
C++ for OpenCL
MLIR
Cppx
Cppx-Blue
Cppx-Gold
Cpp2-cppfront
Crystal
C#
CUDA C++
D
Dart
Elixir
Erlang
Fortran
F#
GLSL
Go
Haskell
HLSL
Helion
Hook
Hylo
IL
ispc
Java
Julia
Kotlin
LLVM IR
LLVM MIR
Modula-2
Mojo
Nim
Numba
Nix
Objective-C
Objective-C++
OCaml
Odin
OpenCL C
Pascal
Pony
PTX
Python
Racket
Raku
Ruby
Rust
Sail
Snowball
Scala
Slang
Solidity
Spice
SPIR-V
Swift
LLVM TableGen
Toit
Triton
TypeScript Native
V
Vala
Visual Basic
Vyper
WASM
Yul (Solidity IR)
Zig
Javascript
GIMPLE
Ygen
sway
hlsl source #1
Output
Compile to binary object
Link to binary
Execute the code
Intel asm syntax
Demangle identifiers
Verbose demangling
Filters
Unused labels
Library functions
Directives
Comments
Horizontal whitespace
Debug intrinsics
Compiler
AMD RGA 2.10
AMD RGA 2.11
AMD RGA 2.12
AMD RGA 2.13
AMD RGA 2.9.1
Clang (assertions trunk)
Clang (trunk)
DXC (trunk)
DXC 1.6.2112
DXC 1.7.2207
DXC 1.7.2212
DXC 1.7.2308
DXC 1.8.2306-preview
DXC 1.8.2403
DXC 1.8.2403.1
DXC 1.8.2403.2
DXC 1.8.2405
DXC 1.8.2407
DXC 1.8.2502
DXC 1.8.2505
DXC 1.8.2505.1
RGA 2.6.1 (DXC 1.6.2112)
RGA 2.6.1 (DXC 1.7.2207)
RGA 2.6.2 (DXC 1.6.2112)
RGA 2.6.2 (DXC 1.7.2207)
RGA 2.6.2 (DXC trunk)
RGA 2.9.0 (DXC trunk)
Options
Source code
void fn3x2(float3x2) {} void fn2x2(float2x2) {} void fn2x2IO(inout float2x2) {} void fnI2x2IO(inout int2x2) {} void matOrVec(float4 F) {} void matOrVec(float2x2 F) {} void matOrVec2(float3 F) {} void matOrVec2(float2x3 F) {} export void cases(float2x3 f23, float4x4 f44, float3x3 f33, float3x2 f32) { int2x2 i22 = f23; // Allowed! #ifdef ERROR int3x2 i32 = f23; // Error! fn3x2(f23); // Error! #endif fn2x2(f23); // Allowed! #ifdef ERROR // DXC disallows these, and I'm really unsure why... fn2x2IO(f23); // Maybe allowed? fnI2x2IO(f23); // Maybe allowed? #endif matOrVec(f23); // calls matOrVec(float2x2); matOrVec(f44); // calls matOrVec(float2x2); #ifdef ERROR matOrVec(2.0); // Ambiguous! matOrVec2(f23); // No viable conversion! #endif matOrVec2(f44); // calls matOrVec(float2x3); matOrVec2(f33); // calls matOrVec(float2x3); #ifdef ERROR // I think the current language in the spec is wrong about this one! matOrVec2(f32); // No known conversion from matrix to vector! #endif }
Become a Patron
Sponsor on GitHub
Donate via PayPal
Compiler Explorer Shop
Source on GitHub
Mailing list
Installed libraries
Wiki
Report an issue
How it works
Contact the author
CE on Mastodon
CE on Bluesky
Statistics
Changelog
Version tree