[GHC] #12134: PowerPC 64-bit: Foreign functions with more than 8 float parameters broken

#12134: PowerPC 64-bit: Foreign functions with more than 8 float parameters broken -------------------------------------+------------------------------------- Reporter: trommler | Owner: trommler Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 (NCG) | Keywords: ccall | Operating System: Linux Architecture: powerpc64 | Type of failure: Incorrect result | at runtime Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Consider the following: {{{#!c void many_floats(float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8, float f9, float f10, float f11, float f12, float f13, float f14) { printf("%f\n%f\n%f\n%f\n%f\n%f\n%f\n%f\n%f\n%f\n%f\n%f\n%f\n%f\n", f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14); } }}} and {{{#!hs foreign import ccall "many_floats" many :: CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> CFloat -> IO () main = many 1.5 2.5 3.5 4.5 5.5 6.5 7.5 8.5 9.5 10.5 11.5 12.5 13.5 14.5 }}} gives {{{ 1.500000 2.500000 3.500000 4.500000 5.500000 6.500000 7.500000 8.500000 0.000000 0.000000 3.000000 14.500000 13.500000 0.000000 }}} on PowerPC 64-bit Linux. According to the ABI for PowerPC 64-bit ELF v1.9 and ELF v2.0 the first 13 floating or double parameters are passed in floating point registers. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12134 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12134: PowerPC 64-bit: Foreign functions with more than 8 float parameters broken -------------------------------------+------------------------------------- Reporter: trommler | Owner: trommler Type: bug | Status: patch Priority: normal | Milestone: 8.0.2 Component: Compiler (NCG) | Version: 8.0.1 Resolution: | Keywords: ccall Operating System: Linux | Architecture: powerpc64 Type of failure: Incorrect result | Test Case: at runtime | ffi/should_run/T12134 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2327 Wiki Page: | -------------------------------------+------------------------------------- Changes (by trommler): * status: new => patch * testcase: => ffi/should_run/T12134 * differential: => Phab:D2327 * milestone: => 8.0.2 Comment: The patch in Phab:D2327 fixes it and adds a regression test. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12134#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12134: PowerPC 64-bit: Foreign functions with more than 8 float parameters broken
-------------------------------------+-------------------------------------
Reporter: trommler | Owner: trommler
Type: bug | Status: patch
Priority: normal | Milestone: 8.0.2
Component: Compiler (NCG) | Version: 8.0.1
Resolution: | Keywords: ccall
Operating System: Linux | Architecture: powerpc64
Type of failure: Incorrect result | Test Case:
at runtime | ffi/should_run/T12134
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2327
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12134: PowerPC 64-bit: Foreign functions with more than 8 float parameters broken -------------------------------------+------------------------------------- Reporter: trommler | Owner: trommler Type: bug | Status: merge Priority: normal | Milestone: 8.0.2 Component: Compiler (NCG) | Version: 8.0.1 Resolution: | Keywords: ccall Operating System: Linux | Architecture: powerpc64 Type of failure: Incorrect result | Test Case: at runtime | ffi/should_run/T12134 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2327 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge Comment: This should likely go into 8.0.2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12134#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12134: PowerPC 64-bit: Foreign functions with more than 8 float parameters broken
-------------------------------------+-------------------------------------
Reporter: trommler | Owner: trommler
Type: bug | Status: merge
Priority: normal | Milestone: 8.0.2
Component: Compiler (NCG) | Version: 8.0.1
Resolution: | Keywords: ccall
Operating System: Linux | Architecture: powerpc64
Type of failure: Incorrect result | Test Case:
at runtime | ffi/should_run/T12134
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2327
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12134: PowerPC 64-bit: Foreign functions with more than 8 float parameters broken -------------------------------------+------------------------------------- Reporter: trommler | Owner: trommler Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler (NCG) | Version: 8.0.1 Resolution: fixed | Keywords: ccall Operating System: Linux | Architecture: powerpc64 Type of failure: Incorrect result | Test Case: at runtime | ffi/should_run/T12134 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2327 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12134#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC