From 1bf4d19172879e42eeb595e6337e8b358f6469c9 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 26 Jul 2014 01:52:13 +0000 Subject: [x86] Fix PR20355 (and dups) by not using unsigned multiplication when signed multiplication is requested. While there is not a difference in the *low* half of the result, the *high* half (used specifically to implement the signed division by these constants) certainly is used. The test case I've nuked was actively asserting wrong code. There is a delightful solution to doing signed multiplication even when we don't have it that Richard Smith has crafted, but I'll add the machinery back and implement that in a follow-up patch. This at least restores correctness. llvm-svn: 214007 --- llvm/test/CodeGen/X86/pmul.ll | 8 ++++---- llvm/test/CodeGen/X86/vector-idiv.ll | 16 +++++----------- 2 files changed, 9 insertions(+), 15 deletions(-) (limited to 'llvm/test/CodeGen') diff --git a/llvm/test/CodeGen/X86/pmul.ll b/llvm/test/CodeGen/X86/pmul.ll index 4944d6b9083..e129d5618aa 100644 --- a/llvm/test/CodeGen/X86/pmul.ll +++ b/llvm/test/CodeGen/X86/pmul.ll @@ -84,10 +84,10 @@ entry: } define <2 x i64> @f(<2 x i64> %i, <2 x i64> %j) nounwind { -; CHECK-LABEL: f: -; CHECK: pmuludq -; CHECK: pmuludq -; CHECK: pmuludq +; ALL-LABEL: f: +; ALL: pmuludq +; ALL: pmuludq +; ALL: pmuludq entry: ; Use a call to force spills. call void @foo() diff --git a/llvm/test/CodeGen/X86/vector-idiv.ll b/llvm/test/CodeGen/X86/vector-idiv.ll index ec1ce3da5e1..0214a47f44c 100644 --- a/llvm/test/CodeGen/X86/vector-idiv.ll +++ b/llvm/test/CodeGen/X86/vector-idiv.ll @@ -131,18 +131,12 @@ define <4 x i32> @test8(<4 x i32> %a) { ; SSE41: psrad $2 ; SSE41: padd +; FIXME: scalarized -- there is no signed multiply in SSE. ; SSE-LABEL: test8: -; SSE: pmuludq -; SSE: pshufd $49 -; SSE: pshufd $49 -; SSE: pmuludq -; SSE: shufps $-35 -; SSE: pshufd $-40 -; SSE: psubd -; SSE: padd -; SSE: psrld $31 -; SSE: psrad $2 -; SSE: padd +; SSE: imulq +; SSE: imulq +; SSE: imulq +; SSE: imulq ; AVX-LABEL: test8: ; AVX: vpmuldq -- cgit v1.2.3