Merge tag 'iwlwifi-next-for-kalle-2014-12-30' of https://git.kernel.org/pub/scm/linux...
[cascardo/linux.git] / arch / mips / math-emu / cp1emu.c
index cac529a..9dfcd7f 100644 (file)
@@ -643,9 +643,14 @@ static inline int cop1_64bit(struct pt_regs *xcp)
        return !test_thread_flag(TIF_32BIT_FPREGS);
 }
 
+static inline bool hybrid_fprs(void)
+{
+       return test_thread_flag(TIF_HYBRID_FPREGS);
+}
+
 #define SIFROMREG(si, x)                                               \
 do {                                                                   \
-       if (cop1_64bit(xcp))                                            \
+       if (cop1_64bit(xcp) && !hybrid_fprs())                          \
                (si) = (int)get_fpr32(&ctx->fpr[x], 0);                 \
        else                                                            \
                (si) = (int)get_fpr32(&ctx->fpr[(x) & ~1], (x) & 1);    \
@@ -653,7 +658,7 @@ do {                                                                        \
 
 #define SITOREG(si, x)                                                 \
 do {                                                                   \
-       if (cop1_64bit(xcp)) {                                          \
+       if (cop1_64bit(xcp) && !hybrid_fprs()) {                        \
                unsigned i;                                             \
                set_fpr32(&ctx->fpr[x], 0, si);                         \
                for (i = 1; i < ARRAY_SIZE(ctx->fpr[x].val32); i++)     \