Mark Wielaard 7d4b18
commit 270037da8b508954f0f7d703a0bebf5364eec548
Mark Wielaard 7d4b18
Author: Julian Seward <jseward@acm.org>
Mark Wielaard 7d4b18
Date:   Sat Apr 13 12:34:06 2019 +0200
Mark Wielaard 7d4b18
Mark Wielaard 7d4b18
    Bug 406465 - arm64 instruction selector fails on "t0 = <expr>" where <expr> has type Ity_F16.
Mark Wielaard 7d4b18
Mark Wielaard 7d4b18
diff --git a/VEX/priv/host_arm64_isel.c b/VEX/priv/host_arm64_isel.c
Mark Wielaard 7d4b18
index 49d0f0b..b2ab742 100644
Mark Wielaard 7d4b18
--- a/VEX/priv/host_arm64_isel.c
Mark Wielaard 7d4b18
+++ b/VEX/priv/host_arm64_isel.c
Mark Wielaard 7d4b18
@@ -3391,6 +3391,10 @@ static HReg iselF16Expr_wrk ( ISelEnv* env, IRExpr* e )
Mark Wielaard 7d4b18
    vassert(e);
Mark Wielaard 7d4b18
    vassert(ty == Ity_F16);
Mark Wielaard 7d4b18
 
Mark Wielaard 7d4b18
+   if (e->tag == Iex_RdTmp) {
Mark Wielaard 7d4b18
+      return lookupIRTemp(env, e->Iex.RdTmp.tmp);
Mark Wielaard 7d4b18
+   }
Mark Wielaard 7d4b18
+
Mark Wielaard 7d4b18
    if (e->tag == Iex_Get) {
Mark Wielaard 7d4b18
       Int offs = e->Iex.Get.offset;
Mark Wielaard 7d4b18
       if (offs >= 0 && offs < 8192 && 0 == (offs & 1)) {
Mark Wielaard 7d4b18
@@ -3706,6 +3710,12 @@ static void iselStmt ( ISelEnv* env, IRStmt* stmt )
Mark Wielaard 7d4b18
          addInstr(env, ARM64Instr_VMov(8/*yes, really*/, dst, src));
Mark Wielaard 7d4b18
          return;
Mark Wielaard 7d4b18
       }
Mark Wielaard 7d4b18
+      if (ty == Ity_F16) {
Mark Wielaard 7d4b18
+         HReg src = iselF16Expr(env, stmt->Ist.WrTmp.data);
Mark Wielaard 7d4b18
+         HReg dst = lookupIRTemp(env, tmp);
Mark Wielaard 7d4b18
+         addInstr(env, ARM64Instr_VMov(8/*yes, really*/, dst, src));
Mark Wielaard 7d4b18
+         return;
Mark Wielaard 7d4b18
+      }
Mark Wielaard 7d4b18
       if (ty == Ity_V128) {
Mark Wielaard 7d4b18
          HReg src = iselV128Expr(env, stmt->Ist.WrTmp.data);
Mark Wielaard 7d4b18
          HReg dst = lookupIRTemp(env, tmp);