     const auto bias2 = *(bias + (col%d) + d);
     const auto  mask = (mask_c == NULL) ? 1.0 : (*(mask_c + col));
     auto cur = *(init + col);
-    const auto* __restrict__ up = u + (col*k);
-    const auto* __restrict__ xp = (skip_type == 0) ? NULL : ((skip_type == 1) ? (x + col) : (up + 3));
-    const unsigned char* __restrict__ pad_p = (mask_pad == NULL) ? NULL : (mask_pad + (col/d));
-    auto* __restrict__ cp = c + col;
-    auto* __restrict__ hp = h + col;
+    const auto* up = u + (col*k);
+    const auto* xp = (skip_type == 0) ? NULL : ((skip_type == 1) ? (x + col) : (up + 3));
+    const unsigned char* pad_p = (mask_pad == NULL) ? NULL : (mask_pad + (col/d));
+    auto* cp = c + col;
+    auto* hp = h + col;
 
     for (int row = 0; row < len; ++row)
     {
         if ((pad_p == NULL) || !(*pad_p)) {
             const auto g1 = sigmoidf((*(up+1)) + wc1*cur + bias1);
             const auto g2 = sigmoidf((*(up+2)) + wc2*cur + bias2);
-            cur = (cur-(*up))*g1 + (*up);
+            const auto u_val = *up;
+            cur = (cur-u_val)*g1 + u_val;
             const auto val = calc_activation(activation_type, cur);
             *hp = skip_type ? ((val * mask - (*xp)) * g2 + (*xp)) : (val * mask * g2);
         } 

        up += ncols_u;
        cp += ncols;
        hp += ncols;
        if (skip_type) xp += ncols_x;
        if (pad_p) pad_p += batch;
    }
}


        cp -= ncols;
        gup -= ncols_u;
        ghp -= ncols;
        xp = skip_type ? (xp - ncols_x) : NULL;
        gxp = skip_type ? (gxp - ncols_x) : NULL;
        pad_p = mask_pad ? (pad_p - batch) : NULL;
    }

    //const int bias_idx = col % d;
