[PATCHv2 1/6] powerpc: fix exception clearing in e500 SPE float emulation

2013-12-10 Thread Joseph S. Myers
OW) | current->thread.spefscr_last; __FPU_FPSCR |= (FP_CUR_EXCEPTIONS & FP_EX_MASK); mtspr(SPRN_SPEFSCR, __FPU_FPSCR); + current->thread.spefscr_last = __FPU_FPSCR; current->thread.evr[fc] = vc.wp[0]; regs->gpr[fc] = vc.wp[1]; -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/6] powerpc: fix exception clearing in e500 SPE float emulation

2013-11-22 Thread Joseph S. Myers
fesetenv restores a saved value of spefscr which may both set and clear bits (and then it calls prctl because it needs to do so anyway to restore the saved state for which exceptions were enabled). fesetexceptflag restores saved state of particular exceptions without a trap (so needs to ca

Ping^2 Re: [PATCH 0/6] powerpc/math-emu: e500 SPE float emulation fixes

2013-11-18 Thread Joseph S. Myers
Ping^2. I still haven't seen any comments on any of these patches. -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Ping Re: [PATCH 0/6] powerpc/math-emu: e500 SPE float emulation fixes

2013-11-11 Thread Joseph S. Myers
Ping. I haven't seen any comments on any of these patches. -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/6] powerpc: fix exception clearing in e500 SPE float emulation

2013-11-04 Thread Joseph S. Myers
aware of it. +*/ + __FPU_FPSCR + &= ~(FP_EX_INVALID | FP_EX_UNDERFLOW) | current->thread.spefscr_last; __FPU_FPSCR |= (FP_CUR_EXCEPTIONS & FP_EX_MASK); mtspr(SPRN_SPEFSCR, __FPU_FPSCR); + current->t

[PATCH 6/6] powerpc: fix e500 SPE float SIGFPE generation

2013-11-04 Thread Joseph S. Myers
0; illegal: @@ -867,6 +885,8 @@ int speround_handler(struct pt_regs *regs) pr_debug(" to fgpr: %08x %08x\n", fgpr.wp[0], fgpr.wp[1]); + if (current->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) + return (current->thread.fpexc_mode & PR_FP_EX

[PATCH 5/6] powerpc: fix e500 SPE float to integer and fixed-point conversions

2013-11-04 Thread Joseph S. Myers
Z_high < 0, choose Z2 */ + if (lo_inexact && s_lo) { + if (fp_result) + fgpr.wp[1]++; /* Z_low < 0, choose Z2 */ + else + fgpr.wp[1]--; /* Z_low < 0,

[PATCH 4/6] math-emu: fix floating-point to integer overflow detection

2013-11-04 Thread Joseph S. Myers
ow detection. */ \ _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ } \ -- Joseph S. Myers jos...@code

[PATCH 0/6] powerpc/math-emu: e500 SPE float emulation fixes

2013-11-04 Thread Joseph S. Myers
teger and fixed-point conversions) depends on patch 2 (fix e500 SPE float rounding inexactness detection). Other than that, I think any subset of the patches can be applied in any order, if some subset seems OK but there are concerns about other patches in the series. -- Joseph S. Myer

[PATCH 3/6] math-emu: fix floating-point to integer unsigned saturation

2013-11-04 Thread Joseph S. Myers
signed != 2) \ -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/6] powerpc: fix e500 SPE float rounding inexactness detection

2013-11-04 Thread Joseph S. Myers
& s_lo) + fgpr.wp[1]++; /* Z_low < 0, choose Z2 */ + if (hi_inexact && s_hi) + fgpr.wp[0]++; /* Z_high < 0, choose Z2 */ } break; -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: fix e500 SPE float SIGFPE generation

2013-10-10 Thread Joseph S. Myers
return 1; + } return 0; illegal: @@ -867,6 +885,8 @@ int speround_handler(struct pt_regs *regs) pr_debug(" to fgpr: %08x %08x\n", fgpr.wp[0], fgpr.wp[1]); + if (current->thread.fpexc_mode & PR_FP_EXC_SW_ENABLE) + return (current

Re: [PATCH] powerpc: fix e500 SPE float to integer and fixed-point conversions

2013-10-08 Thread Joseph S. Myers
On Tue, 8 Oct 2013, Joseph S. Myers wrote: > I'll send as a followup the testcase I used for verifying that the > instructions (other than the theoretical conversions to 64-bit > integers) produce the correct results. In addition, this has been > tested with the glibc testsui

[PATCH] powerpc: fix e500 SPE float to integer and fixed-point conversions

2013-10-08 Thread Joseph S. Myers
result) + fgpr.wp[1]++; /* Z_low < 0, choose Z2 */ + else + fgpr.wp[1]--; /* Z_low < 0, choose Z2 */ + } + if (hi_inexact && s_hi) { + if (fp_result) + fgpr.wp[0]++; /* Z_high < 0, choose Z2 */ + else + fgpr.wp[0]--; /* Z_high < 0, choose Z2 */ + } } break; -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] math-emu: fix floating-point to integer overflow detection

2013-10-08 Thread Joseph S. Myers
LE_##wc(r, X, rsize); \ } \ -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://list

[PATCH] math-emu: fix floating-point to integer unsigned saturation

2013-10-08 Thread Joseph S. Myers
) \ -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: fix exception clearing in e500 SPE float emulation

2013-10-05 Thread Joseph S. Myers
mp; FP_EX_MASK); mtspr(SPRN_SPEFSCR, __FPU_FPSCR); + current->thread.spefscr_last = __FPU_FPSCR; current->thread.evr[fc] = vc.wp[0]; regs->gpr[fc] = vc.wp[1]; -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: fix e500 SPE float rounding inexactness detection

2013-10-05 Thread Joseph S. Myers
ose Z2 */ + if (hi_inexact && s_hi) + fgpr.wp[0]++; /* Z_high < 0, choose Z2 */ } break; -- Joseph S. Myers jos...@codesourcery.com ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev