[Libclc-dev] [PATCH] Implement mad_hi built-in

Tom Stellard tom at stellard.net
Fri Sep 6 15:10:58 PDT 2013


On Fri, Sep 06, 2013 at 05:09:26PM -0500, Aaron Watry wrote:
> We already have a working mul_hi, and the spec gives us the implementation as:
> Returns mul_hi(a,b)+c.
> 
> Signed-off-by: Aaron Watry <awatry at gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
> ---
>  generic/include/clc/clc.h            | 1 +
>  generic/include/clc/integer/mad_hi.h | 1 +
>  2 files changed, 2 insertions(+)
>  create mode 100644 generic/include/clc/integer/mad_hi.h
> 
> diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
> index aeb3949..467cd58 100644
> --- a/generic/include/clc/clc.h
> +++ b/generic/include/clc/clc.h
> @@ -67,6 +67,7 @@
>  #include <clc/integer/clz.h>
>  #include <clc/integer/hadd.h>
>  #include <clc/integer/mad24.h>
> +#include <clc/integer/mad_hi.h>
>  #include <clc/integer/mul24.h>
>  #include <clc/integer/mul_hi.h>
>  #include <clc/integer/rhadd.h>
> diff --git a/generic/include/clc/integer/mad_hi.h b/generic/include/clc/integer/mad_hi.h
> new file mode 100644
> index 0000000..e67c988
> --- /dev/null
> +++ b/generic/include/clc/integer/mad_hi.h
> @@ -0,0 +1 @@
> +#define mad_hi(a, b, c) (mul_hi(a,b)+c)
> -- 
> 1.8.1.2
> 
> 
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev




More information about the Libclc-dev mailing list