llvm-project/llvm/test/CodeGen/DirectX/normalize_error.ll
Joshua Batista 1b2d11de93
Add normalize builtins and normalize HLSL function to DirectX and SPIR-V backend (#102683)
This PR adds the normalize intrinsic and an HLSL function that uses it.
The SPIRV backend is also implemented.

Used https://github.com/llvm/llvm-project/pull/101256 as a reference,
along with https://github.com/llvm/llvm-project/pull/102243
Fixes https://github.com/llvm/llvm-project/issues/99139
2024-08-13 15:15:19 -07:00

11 lines
439 B
LLVM

; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s 2>&1 | FileCheck %s
; DXIL operation normalize does not support double overload type
; CHECK: Cannot create Dot2 operation: Invalid overload type
define noundef <2 x double> @test_normalize_double2(<2 x double> noundef %p0) {
entry:
%hlsl.normalize = call <2 x double> @llvm.dx.normalize.v2f32(<2 x double> %p0)
ret <2 x double> %hlsl.normalize
}