clarify
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 4 Jun 2018 01:55:46 +0000 (02:55 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 4 Jun 2018 01:55:46 +0000 (02:55 +0100)
simple_v_extension.mdwn

index 57ef9ca689cb481450791ba0da99d17d77e35a30..8253d3c4b9d0ca63474638cf4f7cc89299df18c8 100644 (file)
@@ -426,20 +426,12 @@ equivalent state):
     struct pred int_pred_reg[32];
 
     for (i = 0; i < 16; i++)
+      tb = int_pred_reg if CSRpred[i].type == 0 else fp_pred_reg;
       idx = CSRpred[i].regidx
-      predidx = CSRpred[i].predidx
-      zero    = CSRpred[i].zero
-      inv     = CSRpred[i].inv
-      if CSRpred[i].type == 0: # integer
-        int_pred_reg[idx].zero = zero
-        int_pred_reg[idx].inv  = inv
-        int_pred_reg[idx].predidx  = predidx
-        int_pred_reg[idx].enabled  = true
-      else:
-        fp_pred_reg[idx].zero = zero
-        fp_pred_reg[idx].inv  = inv
-        fp_pred_reg[idx].predidx  = predidx
-        fp_pred_reg[idx].enabled  = true
+      tb[idx].zero = CSRpred[i].zero
+      tb[idx].inv  = CSRpred[i].inv
+      tb[idx].predidx  = CSRpred[i].predidx
+      tb[idx].enabled  = true
 
 So when an operation is to be predicated, it is the internal state that
 is used.  In Section 6.4.2 of Hwacha's Manual (EECS-2015-262) the following