[Piglit] [PATCH] cl: Add fmod tests

Aaron Watry awatry at gmail.com
Mon Sep 8 14:34:49 PDT 2014


Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 generated_tests/generate-cl-math-builtins.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/generated_tests/generate-cl-math-builtins.py b/generated_tests/generate-cl-math-builtins.py
index 394207a..66ea755 100644
--- a/generated_tests/generate-cl-math-builtins.py
+++ b/generated_tests/generate-cl-math-builtins.py
@@ -25,7 +25,7 @@
 import os
 
 from genclbuiltins import gen
-from math import acos, asin, atan, atan2, pi, sin, sqrt, cos, fabs, tan, pow
+from math import acos, asin, atan, atan2, fmod, pi, sin, sqrt, cos, fabs, tan, pow
 
 CLC_VERSION_MIN = {
     'acos' : 10,
@@ -37,6 +37,7 @@ CLC_VERSION_MIN = {
     'cos' : 10,
     'fabs' : 10,
     'floor' : 10,
+    'fmod' : 10,
     'mix' : 10,
     'nextafter' : 10,
     'round' : 10,
@@ -134,6 +135,16 @@ tests = {
             [0.5, -0.5, 0.0, -0.0, float("nan"), -3.99, 1.5]
         ]
     },
+    'fmod' : {
+        'arg_types': [F, F, F],
+        'function_type': 'ttt',
+        'values': [
+            [float.fromhex("0x1.99998p-4"),  float("nan"), float.fromhex("-0x1.47aep-7"),   1.0, float("-nan"), float("nan")],
+            [float.fromhex("0x1.466666p+2"), 0.0,          float.fromhex("-0x1p+2"),        1.0, 5.1,           3.0         ],
+            [float.fromhex("0x1p-1"),        float("nan"), float.fromhex("-0x1.feb852p+1"), 1.5, 0.0,           float("inf")]
+        ],
+        'tolerance' : 0
+    },
     'mix' : { #x + (y - x) * a
         'arg_types': [F, F, F, F],
         'function_type': 'tts',
-- 
1.9.1



More information about the Piglit mailing list