LGTM, thanks.
On Tue, Sep 03, 2013 at 08:41:28AM +0800, Homer Hsing wrote: > This patch makes following piglit test case pass. > piglit/framework/../bin/cl-program-tester > generated_tests/cl/builtin/int/builtin-int-sub_sat-1.0.generated.cl > > Signed-off-by: Homer Hsing <[email protected]> > --- > backend/src/ocl_stdlib.tmpl.h | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h > index d4e436d..8c50279 100644 > --- a/backend/src/ocl_stdlib.tmpl.h > +++ b/backend/src/ocl_stdlib.tmpl.h > @@ -182,9 +182,14 @@ INLINE_OVERLOADABLE TYPE add_sat(TYPE x, TYPE y) { > return ocl_sadd_sat(x, y); } > INLINE_OVERLOADABLE TYPE sub_sat(TYPE x, TYPE y) { return ocl_ssub_sat(x, > y); } > SDEF(char); > SDEF(short); > -SDEF(int); > SDEF(long); > #undef SDEF > +OVERLOADABLE int ocl_sadd_sat(int x, int y); > +INLINE_OVERLOADABLE int add_sat(int x, int y) { return ocl_sadd_sat(x, y); } > +OVERLOADABLE int ocl_ssub_sat(int x, int y); > +INLINE_OVERLOADABLE int sub_sat(int x, int y) { > + return (y == 0x80000000u) ? (x & 0x7FFFFFFF) : ocl_ssub_sat(x, y); > +} > #define UDEF(TYPE) > \ > OVERLOADABLE TYPE ocl_uadd_sat(TYPE x, TYPE y); \ > OVERLOADABLE TYPE ocl_usub_sat(TYPE x, TYPE y); \ > -- > 1.8.1.2 > > _______________________________________________ > Beignet mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
