|
From: <sv...@va...> - 2015-03-30 08:50:36
|
Author: sewardj
Date: Mon Mar 30 09:50:27 2015
New Revision: 3110
Log:
Add IR level support for 16 bit floating point types (Ity_F16) and add
four new IROps that use it:
Iop_F16toF64, Iop_F64toF16, Iop_F16toF32, Iop_F32toF16.
Modified:
trunk/priv/ir_defs.c
trunk/priv/ir_opt.c
trunk/pub/libvex_ir.h
Modified: trunk/priv/ir_defs.c
==============================================================================
--- trunk/priv/ir_defs.c (original)
+++ trunk/priv/ir_defs.c Mon Mar 30 09:50:27 2015
@@ -54,6 +54,7 @@
case Ity_I32: vex_printf( "I32"); break;
case Ity_I64: vex_printf( "I64"); break;
case Ity_I128: vex_printf( "I128"); break;
+ case Ity_F16: vex_printf( "F16"); break;
case Ity_F32: vex_printf( "F32"); break;
case Ity_F64: vex_printf( "F64"); break;
case Ity_F128: vex_printf( "F128"); break;
@@ -340,6 +341,11 @@
case Iop_RecpExpF64: vex_printf("RecpExpF64"); return;
case Iop_RecpExpF32: vex_printf("RecpExpF32"); return;
+ case Iop_F16toF64: vex_printf("F16toF64"); return;
+ case Iop_F64toF16: vex_printf("F64toF16"); return;
+ case Iop_F16toF32: vex_printf("F16toF32"); return;
+ case Iop_F32toF16: vex_printf("F32toF16"); return;
+
case Iop_QAdd32S: vex_printf("QAdd32S"); return;
case Iop_QSub32S: vex_printf("QSub32S"); return;
case Iop_Add16x2: vex_printf("Add16x2"); return;
@@ -2802,7 +2808,12 @@
case Iop_I64StoF32: BINARY(ity_RMode,Ity_I64, Ity_F32);
case Iop_F32toF64: UNARY(Ity_F32, Ity_F64);
+ case Iop_F16toF64: UNARY(Ity_F16, Ity_F64);
+ case Iop_F16toF32: UNARY(Ity_F16, Ity_F32);
+
case Iop_F64toF32: BINARY(ity_RMode,Ity_F64, Ity_F32);
+ case Iop_F64toF16: BINARY(ity_RMode,Ity_F64, Ity_F16);
+ case Iop_F32toF16: BINARY(ity_RMode,Ity_F32, Ity_F16);
case Iop_ReinterpI64asF64: UNARY(Ity_I64, Ity_F64);
case Iop_ReinterpF64asI64: UNARY(Ity_F64, Ity_I64);
@@ -3577,7 +3588,7 @@
case Ity_INVALID: case Ity_I1:
case Ity_I8: case Ity_I16: case Ity_I32:
case Ity_I64: case Ity_I128:
- case Ity_F32: case Ity_F64: case Ity_F128:
+ case Ity_F16: case Ity_F32: case Ity_F64: case Ity_F128:
case Ity_D32: case Ity_D64: case Ity_D128:
case Ity_V128: case Ity_V256:
return True;
@@ -4615,6 +4626,7 @@
case Ity_I32: return 4;
case Ity_I64: return 8;
case Ity_I128: return 16;
+ case Ity_F16: return 2;
case Ity_F32: return 4;
case Ity_F64: return 8;
case Ity_F128: return 16;
Modified: trunk/priv/ir_opt.c
==============================================================================
--- trunk/priv/ir_opt.c (original)
+++ trunk/priv/ir_opt.c Mon Mar 30 09:50:27 2015
@@ -6482,7 +6482,7 @@
case Ity_I1: case Ity_I8: case Ity_I16:
case Ity_I32: case Ity_I64: case Ity_I128:
break;
- case Ity_F32: case Ity_F64: case Ity_F128:
+ case Ity_F16: case Ity_F32: case Ity_F64: case Ity_F128:
case Ity_V128: case Ity_V256:
*hasVorFtemps = True;
break;
Modified: trunk/pub/libvex_ir.h
==============================================================================
--- trunk/pub/libvex_ir.h (original)
+++ trunk/pub/libvex_ir.h Mon Mar 30 09:50:27 2015
@@ -225,6 +225,7 @@
Ity_I32,
Ity_I64,
Ity_I128, /* 128-bit scalar */
+ Ity_F16, /* 16 bit float */
Ity_F32, /* IEEE 754 float */
Ity_F64, /* IEEE 754 double */
Ity_D32, /* 32-bit Decimal floating point */
@@ -759,6 +760,14 @@
Iop_RecpExpF64, /* FRECPX d :: IRRoundingMode(I32) x F64 -> F64 */
Iop_RecpExpF32, /* FRECPX s :: IRRoundingMode(I32) x F32 -> F32 */
+ /* ------------------ 16-bit scalar FP ------------------ */
+
+ Iop_F16toF64, /* F16 -> F64 */
+ Iop_F64toF16, /* IRRoundingMode(I32) x F64 -> F16 */
+
+ Iop_F16toF32, /* F16 -> F32 */
+ Iop_F32toF16, /* IRRoundingMode(I32) x F32 -> F16 */
+
/* ------------------ 32-bit SIMD Integer ------------------ */
/* 32x1 saturating add/sub (ok, well, not really SIMD :) */
|
|
From: Petar J. <mip...@gm...> - 2015-03-30 13:28:22
|
Hi Julian,
You will want to add a change like this one as well:
Index: memcheck/tests/vbit-test/irops.c
===================================================================
--- memcheck/tests/vbit-test/irops.c (revision 15050)
+++ memcheck/tests/vbit-test/irops.c (working copy)
@@ -259,6 +259,12 @@
{ DEFOP(Iop_RecpExpF64, UNDEF_UNKNOWN), },
{ DEFOP(Iop_RecpExpF32, UNDEF_UNKNOWN), },
+ /* ------------------ 16-bit scalar FP --------------------- */
+ { DEFOP(Iop_F16toF64, UNDEF_UNKNOWN), },
+ { DEFOP(Iop_F64toF16, UNDEF_UNKNOWN), },
+ { DEFOP(Iop_F16toF32, UNDEF_UNKNOWN), },
+ { DEFOP(Iop_F32toF16, UNDEF_UNKNOWN), },
+
/* ------------------ 32-bit SIMD Integer ------------------ */
{ DEFOP(Iop_QAdd32S, UNDEF_UNKNOWN), },
{ DEFOP(Iop_QSub32S, UNDEF_UNKNOWN), },
Otherwise, build breaks at memcheck/tests/vbit-test/irops.c.
Regards,
Petar
On Mon, Mar 30, 2015 at 10:50 AM, <sv...@va...> wrote:
> Author: sewardj
> Date: Mon Mar 30 09:50:27 2015
> New Revision: 3110
>
> Log:
> Add IR level support for 16 bit floating point types (Ity_F16) and add
> four new IROps that use it:
> Iop_F16toF64, Iop_F64toF16, Iop_F16toF32, Iop_F32toF16.
>
>
> Modified:
> trunk/priv/ir_defs.c
> trunk/priv/ir_opt.c
> trunk/pub/libvex_ir.h
>
> Modified: trunk/priv/ir_defs.c
>
> ==============================================================================
> --- trunk/priv/ir_defs.c (original)
> +++ trunk/priv/ir_defs.c Mon Mar 30 09:50:27 2015
> @@ -54,6 +54,7 @@
> case Ity_I32: vex_printf( "I32"); break;
> case Ity_I64: vex_printf( "I64"); break;
> case Ity_I128: vex_printf( "I128"); break;
> + case Ity_F16: vex_printf( "F16"); break;
> case Ity_F32: vex_printf( "F32"); break;
> case Ity_F64: vex_printf( "F64"); break;
> case Ity_F128: vex_printf( "F128"); break;
> @@ -340,6 +341,11 @@
> case Iop_RecpExpF64: vex_printf("RecpExpF64"); return;
> case Iop_RecpExpF32: vex_printf("RecpExpF32"); return;
>
> + case Iop_F16toF64: vex_printf("F16toF64"); return;
> + case Iop_F64toF16: vex_printf("F64toF16"); return;
> + case Iop_F16toF32: vex_printf("F16toF32"); return;
> + case Iop_F32toF16: vex_printf("F32toF16"); return;
> +
> case Iop_QAdd32S: vex_printf("QAdd32S"); return;
> case Iop_QSub32S: vex_printf("QSub32S"); return;
> case Iop_Add16x2: vex_printf("Add16x2"); return;
> @@ -2802,7 +2808,12 @@
> case Iop_I64StoF32: BINARY(ity_RMode,Ity_I64, Ity_F32);
>
> case Iop_F32toF64: UNARY(Ity_F32, Ity_F64);
> + case Iop_F16toF64: UNARY(Ity_F16, Ity_F64);
> + case Iop_F16toF32: UNARY(Ity_F16, Ity_F32);
> +
> case Iop_F64toF32: BINARY(ity_RMode,Ity_F64, Ity_F32);
> + case Iop_F64toF16: BINARY(ity_RMode,Ity_F64, Ity_F16);
> + case Iop_F32toF16: BINARY(ity_RMode,Ity_F32, Ity_F16);
>
> case Iop_ReinterpI64asF64: UNARY(Ity_I64, Ity_F64);
> case Iop_ReinterpF64asI64: UNARY(Ity_F64, Ity_I64);
> @@ -3577,7 +3588,7 @@
> case Ity_INVALID: case Ity_I1:
> case Ity_I8: case Ity_I16: case Ity_I32:
> case Ity_I64: case Ity_I128:
> - case Ity_F32: case Ity_F64: case Ity_F128:
> + case Ity_F16: case Ity_F32: case Ity_F64: case Ity_F128:
> case Ity_D32: case Ity_D64: case Ity_D128:
> case Ity_V128: case Ity_V256:
> return True;
> @@ -4615,6 +4626,7 @@
> case Ity_I32: return 4;
> case Ity_I64: return 8;
> case Ity_I128: return 16;
> + case Ity_F16: return 2;
> case Ity_F32: return 4;
> case Ity_F64: return 8;
> case Ity_F128: return 16;
>
> Modified: trunk/priv/ir_opt.c
>
> ==============================================================================
> --- trunk/priv/ir_opt.c (original)
> +++ trunk/priv/ir_opt.c Mon Mar 30 09:50:27 2015
> @@ -6482,7 +6482,7 @@
> case Ity_I1: case Ity_I8: case Ity_I16:
> case Ity_I32: case Ity_I64: case Ity_I128:
> break;
> - case Ity_F32: case Ity_F64: case Ity_F128:
> + case Ity_F16: case Ity_F32: case Ity_F64: case Ity_F128:
> case Ity_V128: case Ity_V256:
> *hasVorFtemps = True;
> break;
>
> Modified: trunk/pub/libvex_ir.h
>
> ==============================================================================
> --- trunk/pub/libvex_ir.h (original)
> +++ trunk/pub/libvex_ir.h Mon Mar 30 09:50:27 2015
> @@ -225,6 +225,7 @@
> Ity_I32,
> Ity_I64,
> Ity_I128, /* 128-bit scalar */
> + Ity_F16, /* 16 bit float */
> Ity_F32, /* IEEE 754 float */
> Ity_F64, /* IEEE 754 double */
> Ity_D32, /* 32-bit Decimal floating point */
> @@ -759,6 +760,14 @@
> Iop_RecpExpF64, /* FRECPX d :: IRRoundingMode(I32) x F64 -> F64 */
> Iop_RecpExpF32, /* FRECPX s :: IRRoundingMode(I32) x F32 -> F32 */
>
> + /* ------------------ 16-bit scalar FP ------------------ */
> +
> + Iop_F16toF64, /* F16 -> F64 */
> + Iop_F64toF16, /* IRRoundingMode(I32) x F64 -> F16 */
> +
> + Iop_F16toF32, /* F16 -> F32 */
> + Iop_F32toF16, /* IRRoundingMode(I32) x F32 -> F16 */
> +
> /* ------------------ 32-bit SIMD Integer ------------------ */
>
> /* 32x1 saturating add/sub (ok, well, not really SIMD :) */
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website,
> sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for
> all
> things parallel software development, from weekly thought leadership blogs
> to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
>
|
|
From: Julian S. <js...@ac...> - 2015-03-30 19:17:46
|
On 30/03/15 15:28, Petar Jovanovic wrote: > You will want to add a change like this one as well: > [..] Petar, thanks for that. Committed, r15052. It didn't fail on arm64-linux for reasons I don't understand, but it did fail on amd64-linux. J |