writer/hlsl: Implement fma()

Change-Id: I30763381bcb0588379e0896f014fa9756b5f3395
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54324
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: David Neto <dneto@google.com>
This commit is contained in:
Ben Clayton
2021-06-16 09:19:36 +00:00
committed by Ben Clayton
parent 35ce0d1993
commit fe66cbe7bb
7 changed files with 11 additions and 103 deletions

View File

@@ -1,10 +1,5 @@
SKIP: FAILED
Validation Failure:
void fma_26a7a9() {
float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
float2 res = mad(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
}
struct tint_symbol {
@@ -27,21 +22,3 @@ void compute_main() {
fma_26a7a9();
return;
}
tint_9GH744:2:16: error: no matching function for call to 'fma'
float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 2>' to 'vector<double, 2>' for 1st argument
tint_9GH744:2:16: error: no matching function for call to 'fma'
float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 2>' to 'vector<double, 2>' for 1st argument
tint_9GH744:2:16: error: no matching function for call to 'fma'
float2 res = fma(float2(0.0f, 0.0f), float2(0.0f, 0.0f), float2(0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 2>' to 'vector<double, 2>' for 1st argument

View File

@@ -1,10 +1,5 @@
SKIP: FAILED
Validation Failure:
void fma_6a3283() {
float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
float4 res = mad(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
}
struct tint_symbol {
@@ -27,21 +22,3 @@ void compute_main() {
fma_6a3283();
return;
}
tint_GZ5kFN:2:16: error: no matching function for call to 'fma'
float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 4>' to 'vector<double, 4>' for 1st argument
tint_GZ5kFN:2:16: error: no matching function for call to 'fma'
float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 4>' to 'vector<double, 4>' for 1st argument
tint_GZ5kFN:2:16: error: no matching function for call to 'fma'
float4 res = fma(float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 4>' to 'vector<double, 4>' for 1st argument

View File

@@ -1,10 +1,5 @@
SKIP: FAILED
Validation Failure:
void fma_c10ba3() {
float res = fma(1.0f, 1.0f, 1.0f);
float res = mad(1.0f, 1.0f, 1.0f);
}
struct tint_symbol {
@@ -27,21 +22,3 @@ void compute_main() {
fma_c10ba3();
return;
}
tint_tqaLcU:2:15: error: no matching function for call to 'fma'
float res = fma(1.0f, 1.0f, 1.0f);
^~~
note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument
tint_tqaLcU:2:15: error: no matching function for call to 'fma'
float res = fma(1.0f, 1.0f, 1.0f);
^~~
note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument
tint_tqaLcU:2:15: error: no matching function for call to 'fma'
float res = fma(1.0f, 1.0f, 1.0f);
^~~
note: candidate function not viable: no known conversion from 'float' to 'double' for 1st argument

View File

@@ -1,10 +1,5 @@
SKIP: FAILED
Validation Failure:
void fma_e17c5c() {
float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
float3 res = mad(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
}
struct tint_symbol {
@@ -27,21 +22,3 @@ void compute_main() {
fma_e17c5c();
return;
}
tint_NJUQps:2:16: error: no matching function for call to 'fma'
float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 3>' to 'vector<double, 3>' for 1st argument
tint_NJUQps:2:16: error: no matching function for call to 'fma'
float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 3>' to 'vector<double, 3>' for 1st argument
tint_NJUQps:2:16: error: no matching function for call to 'fma'
float3 res = fma(float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f), float3(0.0f, 0.0f, 0.0f));
^~~
note: candidate function not viable: no known conversion from 'vector<float, 3>' to 'vector<double, 3>' for 1st argument