Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: qemu/qemu
base: e53e2e2a1bfe
Choose a base ref
...
head repository: qemu/qemu
compare: 64d3be986f9e
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Jul 31, 2023

  1. target/openrisc: Set EPCR to next PC on FPE exceptions

    The architecture specification calls for the EPCR to be set to "Address
    of next not executed instruction" when there is a floating point
    exception (FPE).  This was not being done, so fix it by using the same
    pattern as syscall.  Also, we move this logic down to be done for
    instructions not in the delay slot as called for by the architecture
    manual.
    
    Without this patch FPU exceptions will loop, as the exception handling
    will always return back to the failed floating point instruction.
    
    This was not noticed in earlier testing because:
    
     1. The compiler usually generates code which clobbers the input operand
        such as:
    
          lf.div.s r19,r17,r19
    
     2. The target will store the operation output before to the register
        before handling the exception.  So an operation such as:
    
          float a = 100.0f;
          float b = 0.0f;
          float c = a / b;    /* lf.div.s r19,r17,r19 */
    
        Will first execute:
    
          100 / 0    -> Store inf to c (r19)
                     -> triggering divide by zero exception
                     -> handle and return
    
        Then it will execute:
    
          100 / inf  -> Store 0 to c  (no exception)
    
    To confirm the looping behavior and the fix I used the following:
    
        float fpu_div(float a, float b) {
    	float c;
    	asm volatile("lf.div.s %0, %1, %2"
    		      : "+r" (c)
    		      : "r" (a), "r" (b));
    	return c;
        }
    
    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Stafford Horne <shorne@gmail.com>
    stffrdhrn committed Jul 31, 2023
    Copy the full SHA
    765fdc1 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2023

  1. Merge tag 'or1k-pull-request-20230809' of https://github.com/stffrdhr…

    …n/qemu into staging
    
    OpenRISC FPU Fix for 8.1
    
    A patch to pass the correct exception address when handling floating
    point exceptions.
    
    # -----BEGIN PGP SIGNATURE-----
    #
    # iQIzBAABCAAdFiEE2cRzVK74bBA6Je/xw7McLV5mJ+QFAmTT95sACgkQw7McLV5m
    # J+TV2g/8CTpOm2bvyFF0YmRhmTBit0kqyDcX1Shi8/2SMO4++CCpIp1mlaxdHZKe
    # swdOqIqJeCl3+v+z4xN3ubNMis1Gac8DmXVpVmnUoocDS6m0zM3ly9kETKjYy2vn
    # +GLGzOJ+GnPeQ2oApWwOyCqdCwSx2ZuIYK+FRKIx8T1pRm4Nb1gGP6nRKYAy0+C9
    # aINdaQEZrFMKl8mlEuGcNmw5YDVvT6M9+KAMaNG0AzG8N9oMCo8VZpeY4z0qkZVp
    # forksGucRoWVZ5JWl6kzcPAxxAf49olRx0njfbbUcUlyXtsVQpNhPPsdDGAE5gLu
    # 8kHqtRG5OIJUvsZUaedHmJW9BsISnKqIhB7keG72xeBCYPqsKkzpWotq79I50hWY
    # arTvAbyEwNCPEi1kpevveuGokoKsHKr/6yJRsA2VXM5AFhIy54DkLNz6Zh8W1OGA
    # Nst45kSt7tQsTwxXHTHWGO6gRK/7ZtSr/afsEYZCz9vRUnb4UMeBBAuM9u0W+WYZ
    # +hEZivQI7AEVuFbfzCTpw96jAPg4tpJ0JzC0o3Vh/EKIZahrPdzvmBlsV15geu4/
    # xa5PBWRFpySLEO/6/I9XrIux8wjQ1NHOTC6NtJkH33tu9tJ9pfmyRs+jdUiNwWyd
    # mMz0jvDUhjGaqUYSbXDvBLcSAIKbpXpnay2StSt0S/Enr08KU+o=
    # =yZi9
    # -----END PGP SIGNATURE-----
    # gpg: Signature made Wed 09 Aug 2023 01:31:23 PM PDT
    # gpg:                using RSA key D9C47354AEF86C103A25EFF1C3B31C2D5E6627E4
    # gpg: Good signature from "Stafford Horne <shorne@gmail.com>" [unknown]
    # gpg: WARNING: This key is not certified with a trusted signature!
    # gpg:          There is no indication that the signature belongs to the owner.
    # Primary key fingerprint: D9C4 7354 AEF8 6C10 3A25  EFF1 C3B3 1C2D 5E66 27E4
    
    * tag 'or1k-pull-request-20230809' of https://github.com/stffrdhrn/qemu:
      target/openrisc: Set EPCR to next PC on FPE exceptions
    
    Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
    rth7680 committed Aug 9, 2023
    Copy the full SHA
    64d3be9 View commit details
    Browse the repository at this point in the history