07 Oct, 2011

3 commits


16 Mar, 2011

1 commit

  • Conversion from float to integer should based on both the instruction
    encoding and the sign of the operand.

    A simple testcase to show the issue:

    static float fm;
    static signed int si_min = (-2147483647 - 1);
    static unsigned int ui;
    int main()
    {
    fm = (float) si_min; ;
    ui = (unsigned int)fm;
    printf("ui=%d, should be %d\n", ui, si_min);

    return 0;
    }
    Result: ui=-1, should be -2147483648

    Signed-off-by: Shan Hai
    Signed-off-by: Kumar Gala

    Shan Hai
     

15 Mar, 2011

1 commit

  • This erratum can occur if a single-precision floating-point,
    double-precision floating-point or vector floating-point instruction on a
    mispredicted branch path signals one of the floating-point data interrupts
    which are enabled by the SPEFSCR (FINVE, FDBZE, FUNFE or FOVFE bits). This
    interrupt must be recorded in a one-cycle window when the misprediction is
    resolved. If this extremely rare event should occur, the result could be:

    The SPE Data Exception from the mispredicted path may be reported
    erroneously if a single-precision floating-point, double-precision
    floating-point or vector floating-point instruction is the second
    instruction on the correct branch path.

    According to errata description, some efp instructions which are not
    supposed to trigger SPE exceptions can trigger the exceptions in this case.
    However, as we haven't emulated these instructions here, a signal will
    send to userspace, and userspace application would exit.

    This patch re-issue the efp instruction that we haven't emulated,
    so that hardware can properly execute it again if this case happen.

    Signed-off-by: Liu Yu
    Signed-off-by: Kumar Gala

    Liu Yu
     

13 Oct, 2010

1 commit


11 Mar, 2009

1 commit


03 Dec, 2008

2 commits

  • This patch add the handlers of SPE/EFP exceptions.
    The code is used to emulate float point arithmetic,
    when MSR(SPE) is enabled and receive EFP data interrupt or EFP round interrupt.

    This patch has no conflict with or dependence on FP math-emu.

    The code has been tested by TestFloat.

    Now the code doesn't support SPE/EFP instructions emulation
    (it won't be called when receive program interrupt),
    but it could be easily added.

    Signed-off-by: Liu Yu
    Signed-off-by: Kumar Gala

    Liu Yu
     
  • FP_DECL_EX is already used, so ret is redundant.
    And FP_SET_EXCEPTION will add status into return value.

    Signed-off-by: Liu Yu
    Signed-off-by: Kumar Gala

    Liu Yu
     

01 Oct, 2008

1 commit

  • The math emulation code is centered around a set of generic macros that
    provide the core of the emulation that are shared by the various
    architectures and other projects (like glibc). Each arch implements its
    own sfp-machine.h to specific various arch specific details.

    For historic reasons that are now lost the powerpc math-emu code had
    its own version of the common headers. This moves us to using the
    kernel generic version and thus getting fixes when those are updated.

    Also cleaned up exception/error reporting from the FP emulation functions.

    Signed-off-by: Kumar Gala

    Kumar Gala
     

01 Jul, 2008

1 commit


01 Apr, 2008

1 commit


24 Jan, 2008

1 commit


14 Dec, 2007

1 commit

  • This patch fixes rounding bug in emulation for double float operating on PowerPC platform.

    When pack double float operand, it need to truncate the tail due to the limited precision.
    If the truncated part is not zero, the last bit of work bit (totally 3 bits) need to '|' 1.

    This patch is completed in _FP_FRAC_SRS_2(X,N,sz) (arch/powerpc/math-emu/op-2.h).
    Originally the code leftwards rotates the operand to just keep the truncated part,
    then check whether it is zero. However, the number it rotates is not correct when
    N is not smaller than _FP_W_TYPE_SIZE, and it will cause the work bit '|' 1 in the improper case.

    This patch fixes this issue.

    Signed-off-by: Liu Yu
    Signed-off-by: Kumar Gala

    Liu Yu
     

16 Oct, 2007

1 commit

  • Its legal for the stfiwx instruction to have RA = 0 as part of its
    effective address calculation. This is illegal for all other XE
    form instructions.

    Add code to compute the proper effective address for stfiwx if
    RA = 0 rather than treating it as illegal.

    Signed-off-by: Kumar Gala

    Kumar Gala
     

26 Sep, 2006

1 commit


01 Jul, 2006

1 commit


28 Mar, 2006

1 commit

  • Towards the goal of having arch/powerpc not build anything over in arch/ppc
    move math-emu over. Also, killed some references to arch/ppc/ in the
    arch/powerpc Makefile which should belong in drivers/ when the particular
    sub-arch's move over to arch/powerpc.

    Signed-off-by: Kumar Gala

    Kumar Gala