[Piglit] [PATCH 1/2 v2] genclbuiltins.py: Add two new function types.

Dylan Baker baker.dylan.c at gmail.com
Thu Oct 31 17:31:29 CET 2013


On Friday, November 01, 2013 12:20:46 AM Yi Sun wrote:
> Sometimes we should handle scalar/vector types separately.
> For example some builtin functions only support scalar type input,
> and some relational builtin functions get different results between
> scalar and vector type though with the same value.
> 
> Signed-off-by: Yi Sun <yi.sun at intel.com>
> 
> diff --git a/generated_tests/genclbuiltins.py
> b/generated_tests/genclbuiltins.py old mode 100644
> new mode 100755
> index 721191e..e7757a7
> --- a/generated_tests/genclbuiltins.py
> +++ b/generated_tests/genclbuiltins.py
> @@ -22,6 +22,9 @@ VEC_WIDTHS = [2, 4, 8, 16]
>  # ALL_WIDTHS = [1, 2, 3, 4, 8, 16]
>  ALL_WIDTHS = [1, 2, 4, 8, 16]
> 
> +# According to CL1.1/1.2 spec, some built-in functions only take scalar
> type as input. +SCALAR_WIDTHS = [1]
> +
>  MIN_VALUES = {
>      'char': -128,
>      'uchar': 0,
> @@ -377,8 +380,16 @@ def gen(types, minVersions, functions, testDefs,
> dirName): numTests = len(outputValues)
> 
>              # Handle all available scalar/vector widths
> -            sizes = sorted(VEC_WIDTHS)
> -            sizes.insert(0, 1)  # Add 1-wide scalar to the vector widths
> +            if functionDef['function_type'] == 'ttt' or
> functionDef['function_type'] == 'tss': +                sizes =
> sorted(ALL_WIDTHS)
> +            # Add two new function_type types:
> +            # 'vvv' means handle available vdctor widths only
> +            # 'sss' means handle available scalar width only
> +            if functionDef['function_type'] == 'vvv':
> +                sizes = sorted(VEC_WIDTHS)
> +            if functionDef['function_type'] == 'sss':
> +                sizes = sorted(SCALAR_WIDTHS)
> +

both of these should be 'elif' not 'if'

>              for vecSize in sizes:
>                  for testIdx in range(0, numTests):
>                      print_test(f, fnName, dataType, functionDef, tests,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20131031/28389b46/attachment.pgp>


More information about the Piglit mailing list