]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add IR level support for 16 bit floating point types (Ity_F16) and add
authorJulian Seward <jseward@acm.org>
Mon, 30 Mar 2015 08:50:27 +0000 (08:50 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 30 Mar 2015 08:50:27 +0000 (08:50 +0000)
four new IROps that use it:
Iop_F16toF64, Iop_F64toF16, Iop_F16toF32, Iop_F32toF16.

git-svn-id: svn://svn.valgrind.org/vex/trunk@3110

VEX/priv/ir_defs.c
VEX/priv/ir_opt.c
VEX/pub/libvex_ir.h

index 7cc66cccdb430a862d9fbfd7cbcc28aaab939d98..0b70f39fc2e35fe3610c04063b9b76411bfb7aae 100644 (file)
@@ -54,6 +54,7 @@ void ppIRType ( IRType ty )
       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 @@ void ppIROp ( IROp op )
       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 @@ void typeOfPrimop ( IROp op,
       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 @@ Bool isPlausibleIRType ( IRType ty )
       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 @@ Int sizeofIRType ( IRType ty )
       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;
index e592f388c1309d05cc0f14f89b57943fcafd3c58..52cef9bad23a555636b1872f28122cc69ab88233 100644 (file)
@@ -6482,7 +6482,7 @@ static void considerExpensives ( /*OUT*/Bool* hasGetIorPutI,
                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;
index 3d2c2b2be701bb83fb7fc10337a0fd81f1ae64e1..7178c7e2e1dc2f282f28ca74e49dc440f925126c 100644 (file)
@@ -225,6 +225,7 @@ typedef
       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 @@ typedef
       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 :) */