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

Matt Turner mattst88 at gmail.com
Sun Nov 3 16:23:01 PST 2013


On Thu, Oct 31, 2013 at 9:20 AM, Yi Sun <yi.sun at intel.com> 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

vector.


More information about the Piglit mailing list