4 Commits

Author SHA1 Message Date
Fraser Cormack
8cc9a48579
[clang] Improve diagnostics for vector builtins (#125673)
This commit improves the diagnostics for vector (elementwise) builtins
in a couple of ways.

It primarily provides more precise type-checking diagnostics for
builtins with specific type requirements. Previously many builtins were
receiving a catch-all diagnostic suggesting types which aren't valid.

It also makes consistent the type-checking behaviour between various
binary and ternary builtins. The binary builtins would check for
mismatched argument types before specific type requirements, whereas
ternary builtins would perform the checks in the reverse order. The
binary builtins now behave as the ternary ones do.
2025-03-18 18:11:45 +00:00
Juan Manuel Martinez Caamaño
7decd04626
[Clang] Add __builtin_elementwise_exp10 in the same fashion as exp/exp2 (#130746)
Clang has __builtin_elementwise_exp and __builtin_elementwise_exp2
intrinsics, but no __builtin_elementwise_exp10.

There doesn't seem to be a good reason not to expose the exp10 flavour
of this intrinsic too.

This commit introduces this intrinsic following the same pattern as the
exp and exp2 versions.

Fixes: SWDEV-519541
2025-03-12 09:20:29 +01:00
Karl-Johan Karlsson
31480b0cc8
[test] Avoid writing to a potentially write-protected dir (#89242)
These tests just don't check the output written to the current directory. The
current directory may be write protected e.g. in a sandboxed environment.

The Testcases that use -emit-llvm and -verify only care about stdout/stderr
and are in this patch changed to use -emit-llvm-only to avoid writing to an
output file. The verify-inlineasmbr.mir testcase that also only care about
stdout/stderr is in this patch changed to throw away the output file and just
write to /dev/null.
2024-04-20 12:26:58 +02:00
Farzon Lotfi
b2ca23aed8
[HLSL] implement exp intrinsic (#83832)
This change implements: #70072

- `hlsl_intrinsics.h` - add the `exp` api
- `DXIL.td` - add the llvm intrinsic to DXIL opcode lowering mapping.
- This change reuses llvm's existing intrinsic
`__builtin_elementwise_exp` \ `int_exp` & `__builtin_elementwise_exp2` \
`int_exp2`
- This PR is part 1 of 2.
- Part 2 requires an intrinsic to instructions lowering.
Part2 will expand `int_exp` to 
```
A = Builder.CreateFMul(log2eConst, val);
int_exp2(A)
```
just like we do in
[TranslateExp](https://github.com/microsoft/DirectXShaderCompiler/blob/main/lib/HLSL/HLOperationLower.cpp#L2220C1-L2236C2)
2024-03-05 12:42:33 -05:00