fix darwin threaded static linking by removing -lpthread option #9189

Summary: Signed-off-by: Bob Ippolito <bob@redivi.com>

Test Plan: See repro instructions in trac #9189

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D120

GHC Trac Issues: #9189
Improve seq documentation; part of trac issue #9390

Summary: Signed-off-by: Michael Snoyman <michael@snoyman.com>

Test Plan: Review documentation change

Reviewers: simonpj, austin

Reviewed By: austin

Subscribers: phaskell, hvr, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D136

GHC Trac Issues: #9390
Eliminate some code duplication in x86 backend (genCCall32/64)

Summary:
No functional changes except in panic messages.

These functions were identical except for
- x87 operations in genCCall32
- the fallback to genCCall32'/64'
- "32" vs "64" in panic messages (one case was wrong!)
- minor syntactic or otherwise non-functional differences.

Test Plan:
Ran "validate --no-dph --slow" before and after the change.
Only differences were two tests that failed before the change but not after,
further investigation revealed that those tests are in fact erratic.

Reviewers: simonmar, austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D139
Make IntAddCOp, IntSubCOp into GenericOps

... in preparation for backend-specific implementations.

No functional changes in this commit (except in panic messages
for ill-formed Cmm).

Differential Revision: https://phabricator.haskell.org/D138
x86: Always generate add instruction in MO_Add2 (#9013)

Test Plan:
 - ran validate
 - ran T9013 test with all ways
 - ran CarryOverflow test with all ways, for good measure

Reviewers: austin, simonmar

Reviewed By: simonmar

Differential Revision: https://phabricator.haskell.org/D137
stg/Prim.h: drop redundant #ifdef

Summary:
Noticed by Herbert Valerio Riedel

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

Test Plan: build test

Reviewers: simonmar, austin, hvr

Reviewed By: hvr

Subscribers: rwbarton, phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D143
Unbreak travis by not passing --no-dph
testsuite/base: update .gitignore

Signed-off-by: Austin Seipp <austin@well-typed.com>
Re-add `--no-dph` option to ./validate

This was removed in bb003086599c2ac166cfb3aa710480713adb5a2f
and caused some buildbots to stop working. So this commit just
re-adds it as a no-op (wrt the current default).
Add bit scan {forward,reverse} insns to x86 NCG

This is a pre-requisite for implementing count-{leading,trailing}-zero
prim-ops (re #9340)

Reviewers: ezyang, rwbarton, simonmar, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D141
Add CMOVcc insns to x86 NCG

This is a pre-requisite for implementing count-{leading,trailing}-zero
prim-ops (re #9340) and may be useful to NCG to help turn some code into
branch-less code sequences.

Test Plan: Compiles and validates in combination with clz/ctz primop impl

Reviewers: ezyang, rwbarton, simonmar, austin

Subscribers: simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D141
x86: zero extend the result of 16-bit popcnt instructions (#9435)

Summary:
The 'popcnt r16, r/m16' instruction only writes the low 16 bits of
the destination register, so we have to zero-extend the result to
a full word as popCnt16# is supposed to return a Word#.

For popCnt8# we could instead zero-extend the input to 32 bits
and then do a 32-bit popcnt, and not have to zero-extend the result.
LLVM produces the 16-bit popcnt sequence with two zero extensions,
though, and who am I to argue?

Test Plan:
 - ran "make TEST=cgrun071 EXTRA_HC_OPTS=-msse42"
 - then ran again adding "WAY=optasm", and verified that
   the popcnt sequences we generate match the ones produced
   by LLVM for its @llvm.ctpop.* intrinsics

Reviewers: austin, hvr, tibbe

Reviewed By: austin, hvr, tibbe

Subscribers: phaskell, hvr, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D147

GHC Trac Issues: #9435
Test #9371 (indexed-types/should_fail/T9371)
Fix Trac #9371.

This was very simple: lists of different lengths are
*maybe* apart, not *surely* apart.
Fix #9415.

Abort typechecking when we detect a superclass cycle error, as
ambiguity checking in the presence of superclass cycle errors can
cause a loop.
Test #9415 (typecheck/should_fail/T9415)
Test #9200. (polykinds/T9200)
Change definition of CUSK for data and class definitions (#9200).

Now, a CUSK is when (and only when) all type variables are annotated.
This allows classes to participate in polymorphic recursion.
Added more testing for #9200. (polykinds/T9200b)
Change treatment of CUSKs for synonyms and families (#9200).