CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
146 lines
6.3 KiB
HLSL
146 lines
6.3 KiB
HLSL
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.6-library %s -fnative-int16-type -emit-llvm-only -disable-llvm-passes -verify
|
|
|
|
float builtin_f16tof32_too_few_arg() {
|
|
return __builtin_hlsl_elementwise_f16tof32();
|
|
// expected-error@-1 {{too few arguments to function call, expected 1, have 0}}
|
|
// expected-note@hlsl/hlsl_alias_intrinsics_gen.inc:* 4 {{candidate function not viable: requires 1 argument, but 0 were provided}}
|
|
}
|
|
|
|
float builtin_f16tof32_too_many_arg(uint p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0, p0);
|
|
// expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
|
|
// expected-note@hlsl/hlsl_alias_intrinsics_gen.inc:* 4 {{candidate function not viable: requires 1 argument, but 2 were provided}}
|
|
}
|
|
|
|
float builtin_f16tof32_bool(bool p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'bool')}}
|
|
}
|
|
|
|
float builtin_f16tof32_bool4(bool4 p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'bool4' (aka 'vector<bool, 4>')}}
|
|
}
|
|
|
|
float builtin_f16tof32_short(short p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'short')}}
|
|
}
|
|
|
|
float builtin_f16tof32_unsigned_short(unsigned short p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{incorrect number of bits in integer (expected 32 bits, have 16)}}
|
|
}
|
|
|
|
float builtin_f16tof32_int(int p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'int')}}
|
|
}
|
|
|
|
float builtin_f16tof32_int64_t(long p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'long')}}
|
|
}
|
|
|
|
float2 builtin_f16tof32_int2_to_float2_promotion(int2 p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'int2' (aka 'vector<int, 2>'))}}
|
|
}
|
|
|
|
float builtin_f16tof32_half(half p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'half')}}
|
|
}
|
|
|
|
float builtin_f16tof32_half4(half4 p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'half4' (aka 'vector<half, 4>'))}}
|
|
}
|
|
|
|
float builtin_f16tof32_float(float p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'float')}}
|
|
}
|
|
|
|
float builtin_f16tof32_double(double p0) {
|
|
return __builtin_hlsl_elementwise_f16tof32(p0);
|
|
// expected-error@-1 {{1st argument must be a scalar or vector of unsigned integer types (was 'double')}}
|
|
}
|
|
|
|
float f16tof32_too_few_arg() {
|
|
return f16tof32();
|
|
// expected-error@-1 {{no matching function for call to 'f16tof32'}}
|
|
}
|
|
|
|
float f16tof32_too_many_arg(uint p0) {
|
|
return f16tof32(p0, p0);
|
|
// expected-error@-1 {{no matching function for call to 'f16tof32'}}
|
|
}
|
|
|
|
// Overload resolution selects uint f16tof32(uint); bool is implicitly converted to uint.
|
|
float f16tof32_bool(bool p0) {
|
|
return f16tof32(p0);
|
|
}
|
|
|
|
// Overload resolution selects an overload; bool3 is implicitly converted.
|
|
float f16tof32_bool3(bool3 p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion turns vector to scalar: 'vector<float, 3>' (vector of 3 'float' values) to 'float'}}
|
|
}
|
|
|
|
|
|
// Overload resolution selects uint f16tof32(uint); short is implicitly converted to uint.
|
|
float f16tof32_int16_t(short p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion changes signedness: 'short' to 'uint' (aka 'unsigned int')}}
|
|
}
|
|
|
|
// Overload resolution selects uint f16tof32(uint); unsigned short is implicitly converted to uint.
|
|
float f16tof32_int16_t(unsigned short p0) {
|
|
return f16tof32(p0);
|
|
}
|
|
|
|
// Overload resolution selects uint f16tof32(uint); int is implicitly converted to uint.
|
|
float f16tof32_int(int p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion changes signedness: 'int' to 'uint' (aka 'unsigned int')}}
|
|
}
|
|
|
|
// Overload resolution selects uint f16tof32(uint); long is implicitly converted to uint.
|
|
float f16tof32_int64_t(long p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion loses integer precision: 'long' to 'uint' (aka 'unsigned int')}}
|
|
}
|
|
|
|
// Overload resolution selects an overload; int3 is implicitly converted.
|
|
float2 f16tof32_int2_to_float2_promotion(int3 p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion truncates vector: 'vector<float, 3>' (vector of 3 'float' values) to 'vector<float, 2>' (vector of 2 'float' values)}}
|
|
// expected-warning@-2 {{implicit conversion changes signedness: 'int3' (aka 'vector<int, 3>') to 'vector<uint, 3>' (vector of 3 'uint' values)}}
|
|
}
|
|
|
|
// Overload resolution selects uint f16tof32(uint); half is implicitly converted to uint.
|
|
float f16tof32_half(half p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion turns floating-point number into integer: 'half' to 'uint' (aka 'unsigned int')}}
|
|
}
|
|
|
|
// Overload resolution selects an overload; half2 is implicitly converted.
|
|
float f16tof32_half2(half2 p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion turns vector to scalar: 'vector<float, 2>' (vector of 2 'float' values) to 'float'}}
|
|
// expected-warning@-2 {{implicit conversion turns floating-point number into integer: 'half2' (aka 'vector<half, 2>') to 'vector<uint, 2>' (vector of 2 'uint' values)}}
|
|
}
|
|
|
|
// Overload resolution selects uint f16tof32(uint); float is implicitly converted to uint.
|
|
float f16tof32_float(float p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion turns floating-point number into integer: 'float' to 'uint' (aka 'unsigned int')}}
|
|
}
|
|
|
|
// Overload resolution selects uint f16tof32(uint); double is implicitly converted to uint.
|
|
float f16tof32_double(double p0) {
|
|
return f16tof32(p0);
|
|
// expected-warning@-1 {{implicit conversion turns floating-point number into integer: 'double' to 'uint' (aka 'unsigned int')}}
|
|
}
|