summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/nativeGen/X86/CodeGen.hs4
-rw-r--r--testsuite/tests/codeGen/should_run/all.T3
2 files changed, 4 insertions, 3 deletions
diff --git a/compiler/nativeGen/X86/CodeGen.hs b/compiler/nativeGen/X86/CodeGen.hs
index 9f0af9429d..8bbc9f5dfc 100644
--- a/compiler/nativeGen/X86/CodeGen.hs
+++ b/compiler/nativeGen/X86/CodeGen.hs
@@ -1940,7 +1940,9 @@ genCCall dflags is32Bit (PrimTarget (MO_PopCnt width)) dest_regs@[dst]
args@[src] bid = do
sse4_2 <- sse4_2Enabled
let platform = targetPlatform dflags
- if sse4_2
+ -- N.B. 64-bit population count is not supported on 32-bit platforms, even
+ -- with SSE4.2. Fall back to C implementation in this case
+ if sse4_2 && not (is32Bit && width == W64)
then do code_src <- getAnyReg src
src_r <- getNewRegNat format
let dst_r = getRegisterReg platform (CmmLocal dst)
diff --git a/testsuite/tests/codeGen/should_run/all.T b/testsuite/tests/codeGen/should_run/all.T
index 7e5ed24a7d..2a777f4c9d 100644
--- a/testsuite/tests/codeGen/should_run/all.T
+++ b/testsuite/tests/codeGen/should_run/all.T
@@ -79,8 +79,7 @@ test('cgrun069',
['cgrun069', [('cgrun069_cmm.cmm', '')], ''])
test('cgrun070', normal, compile_and_run, [''])
test('cgrun071',
- [when(have_cpu_feature('sse4_2'), extra_hc_opts('-msse4.2')),
- when(arch('i386'), expect_broken(17247))],
+ [when(have_cpu_feature('sse4_2'), extra_hc_opts('-msse4.2'))],
compile_and_run, [''])
test('cgrun072', normal, compile_and_run, [''])
test('cgrun075', normal, compile_and_run, [''])