mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 20:29:30 +00:00
Otherwise the legalizer would just scalarize everything. Support for mulhi in the targets isn't that great yet so on most targets we get exactly the same scalarized output. Add a test for x86 vector udiv. I had to disable the mulhi nodes on ARM because there aren't any patterns for it. As far as I know ARM has instructions for getting the high part of a multiply so this should be fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207315 91177308-0d34-0410-b5e6-96231b3b80d8
46 lines
913 B
LLVM
46 lines
913 B
LLVM
; RUN: llc -march=x86-64 -mcpu=core2 < %s | FileCheck %s -check-prefix=SSE
|
|
; RUN: llc -march=x86-64 -mcpu=core-avx2 < %s | FileCheck %s -check-prefix=AVX
|
|
|
|
define <4 x i32> @test1(<4 x i32> %a) {
|
|
%div = udiv <4 x i32> %a, <i32 7, i32 7, i32 7, i32 7>
|
|
ret <4 x i32> %div
|
|
|
|
; SSE-LABEL: test1:
|
|
; SSE: pmuludq
|
|
; SSE: pshufd $57
|
|
; SSE: pmuludq
|
|
; SSE: shufps $-35
|
|
; SSE: psubd
|
|
; SSE: psrld $1
|
|
; SSE: padd
|
|
; SSE: psrld $2
|
|
|
|
; AVX-LABEL: test1:
|
|
; AVX: vpmuludq
|
|
; AVX: vpshufd $57
|
|
; AVX: vpmuludq
|
|
; AVX: vshufps $-35
|
|
; AVX: vpsubd
|
|
; AVX: vpsrld $1
|
|
; AVX: vpadd
|
|
; AVX: vpsrld $2
|
|
}
|
|
|
|
define <8 x i32> @test2(<8 x i32> %a) {
|
|
%div = udiv <8 x i32> %a, <i32 7, i32 7, i32 7, i32 7,i32 7, i32 7, i32 7, i32 7>
|
|
ret <8 x i32> %div
|
|
|
|
; AVX-LABEL: test2:
|
|
; AVX: vpermd
|
|
; AVX: vpmuludq
|
|
; AVX: vshufps $-35
|
|
; AVX: vpmuludq
|
|
; AVX: vshufps $-35
|
|
; AVX: vpsubd
|
|
; AVX: vpsrld $1
|
|
; AVX: vpadd
|
|
; AVX: vpsrld $2
|
|
}
|
|
|
|
; TODO: sdiv -> pmuldq
|