[GHC] #9777: -msse flag could be handled better by the driver

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Moderate (less | Type of failure: Other than a day) | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- I bumped into two small issues with `-msse` and `-msse4.2` flags: 1. GHC accepts any flag of the form `-msseX.Y`, eg. `-msse3.14`. I think we should validate numbers passed by the user or - even better - pre- define a set of allowed `-msse` flags. Currently we have this definition: {{{ Flag "msse" (versionSuffix (\maj min d -> d{ sseVersion = Just (maj, min) })) }}} 2. A direct consequence of above definition is that bash command-line auto-completion does not suggest `-msse4.2` flag. This is somewhat related to Austin's Phab:D165 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Comment (by hvr): I'd prefer an enumeration data type for enumerating the supported SSE versions; there aren't that many SSE versions -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Changes (by jstolarek): * keywords: => newcomer -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -------------------------------------+------------------------------------- Changes (by dredozubov): * owner: => dredozubov -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * related: => #8404 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dredozubov): I've added a simple type to restrict sse versions to major ones and 4.2(it's the only not *.0 version that've been explicitly checked in sources afaik). I'm not so sure if the naming is right on.
A direct consequence of above definition is that bash command-line auto- completion does not suggest -msse4.2 flag. Probably it will work better with --show-options if separate flags will be used(such as -msse2/-msse4 etc).
Please advice and don't bash me too hard, it's my first attempt to work with ghc. :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: | -------------------------------------+------------------------------------- Comment (by jstolarek): I commented on the Phab revision. That's a good start :-) Oh, and when you upload a Phab revision you should fill in the appropriate field in the Trac ticket. BTW. I'm surprised that the changes don't go outside of DynFlags. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: Phab:D497 | -------------------------------------+------------------------------------- Changes (by thomie): * differential: => Phab:D497 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: Phab:D504 | -------------------------------------+------------------------------------- Changes (by dredozubov): * differential: Phab:D497 => Phab:D504 Comment: Thanks for fast feedback! I've updated the code to build on your suggestions. Completely agree on "multiple -msse flags" point. It's completely reasonable to choose last version if multiple flags are provided by user. I feel like there's no need to leave VersionSuffix OptKind constructor(and code related to it), because there will be no application for it - it was commited and used only to support msse flags. I'd gladly supply some tests if i haven't been extremely frustrated how to do this. Any pointers on this matter will be greatly appreciated. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: Phab:D504 | -------------------------------------+------------------------------------- Comment (by jstolarek):
I agree on "multiple -msse flags" point. It's completely reasonable to choose last version if multiple flags were provided by user.
What do you mean by "last version". "Latest SSE version" or "last version given on the command line"? I meant the former. As for tests, you can test that: 1. all `msse` flags are listed by `--show-options` flag 2. incorrect `-msse` flag is rejected (see https://phabricator.haskell.org/D503 for an example how to do that). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: Phab:D504 | -------------------------------------+------------------------------------- Comment (by carter): additionally, im not sure if higher SSE numbers imply support for prior extensions, at least on non intel CPUS (in some cases it certainly does, but That maybe should be checked?) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: Phab:D504 | -------------------------------------+------------------------------------- Comment (by dredozubov): jstolarek, I definitely meant "the latest SSE version". I'll try to look into writing tests for this patch tonight, sadly this week've been really busy and i was unable to work on something else except my day work.
all msse flags are listed by --show-options flag incorrect -msse flag is rejected (see https://phabricator.haskell.org/D503 for an example how to do that).
This test case seems a little off to me. It tests OptKind + --show-options behaviour(which currently works), not patch in question. Maybe it'll be a little better to test that right flag(the latest sse version) would be set, if user provides two or more. carter, afaik for each pair of versions of sse older one will contain subset of instructions from newer. I'm not really an expert on this matter though, so If someone else can verify that - it would be great. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: new Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: Phab:D504 | -------------------------------------+------------------------------------- Comment (by carter): hrm, you might be right. It seems to be true for intel and amd cpus at least. Question: how do clang and GCC handle this logic? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9777: -msse flag could be handled better by the driver
-------------------------------------+-------------------------------------
Reporter: jstolarek | Owner: dredozubov
Type: bug | Status: new
Priority: normal | Milestone:
Component: Driver | Version: 7.9
Resolution: | Keywords: newcomer
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Moderate (less
Type of failure: Other | than a day)
Test Case: | Blocked By:
Blocking: | Related Tickets: #8404
Differential Revisions: Phab:D504 |
-------------------------------------+-------------------------------------
Comment (by Austin Seipp

#9777: -msse flag could be handled better by the driver -------------------------------------+------------------------------------- Reporter: jstolarek | Owner: dredozubov Type: bug | Status: closed Priority: normal | Milestone: Component: Driver | Version: 7.9 Resolution: fixed | Keywords: newcomer Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Moderate (less Type of failure: Other | than a day) Test Case: | Blocked By: Blocking: | Related Tickets: #8404 Differential Revisions: Phab:D504 | -------------------------------------+------------------------------------- Changes (by dredozubov): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9777#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC