James Y Knight f0eb5587ce
Remove support for 3DNow!, both intrinsics and builtins. (#96246)
This set of instructions was only supported by AMD chips starting in
the K6-2 (introduced 1998), and before the "Bulldozer" family
(2011). They were never much used, as they were effectively superseded
by the more-widely-implemented SSE (first implemented on the AMD side
in Athlon XP in 2001).

This is being done as a predecessor towards general removal of MMX
register usage. Since there is almost no usage of the 3DNow!
intrinsics, and no modern hardware even implements them, simple
removal seems like the best option.

(Clang half originally uploaded in https://reviews.llvm.org/D94213)

Works towards issue #41665 and issue #98272.
2024-07-16 12:08:48 -04:00

55 lines
2.5 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-- -mattr=+sse | FileCheck %s --check-prefix=X86-SSE
; RUN: llc < %s -mtriple=i686-- -mattr=+avx | FileCheck %s --check-prefix=X86-SSE
; RUN: llc < %s -mtriple=i686-- -mattr=+sse,+prfchw | FileCheck %s -check-prefix=X86-PRFCHWSSE
; RUN: llc < %s -mtriple=i686-- -mattr=+prfchw | FileCheck %s -check-prefix=X86-PRFCHWSSE
; RUN: llc < %s -mtriple=i686-- -mcpu=slm | FileCheck %s -check-prefix=X86-PRFCHWSSE
; RUN: llc < %s -mtriple=i686-- -mcpu=btver2 | FileCheck %s -check-prefix=X86-PRFCHWSSE
; RUN: llc < %s -mtriple=i686-- -mcpu=btver2 -mattr=-prfchw | FileCheck %s -check-prefix=X86-SSE
; RUN: llc < %s -mtriple=i686-- -mattr=+prfchw | FileCheck %s -check-prefix=X86-PRFCHWSSE
; Rules:
; sse provides prefetch0/1/2/nta
; supporting prefetchw implicitly provides prefetcht0/1/2/nta as well, as we need something to fall back to for the non-write hint.
define void @t(ptr %ptr) nounwind {
; X86-SSE-LABEL: t:
; X86-SSE: # %bb.0: # %entry
; X86-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-SSE-NEXT: prefetcht2 (%eax)
; X86-SSE-NEXT: prefetcht1 (%eax)
; X86-SSE-NEXT: prefetcht0 (%eax)
; X86-SSE-NEXT: prefetchnta (%eax)
; X86-SSE-NEXT: prefetcht2 (%eax)
; X86-SSE-NEXT: prefetcht1 (%eax)
; X86-SSE-NEXT: prefetcht0 (%eax)
; X86-SSE-NEXT: prefetchnta (%eax)
; X86-SSE-NEXT: retl
;
; X86-PRFCHWSSE-LABEL: t:
; X86-PRFCHWSSE: # %bb.0: # %entry
; X86-PRFCHWSSE-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-PRFCHWSSE-NEXT: prefetcht2 (%eax)
; X86-PRFCHWSSE-NEXT: prefetcht1 (%eax)
; X86-PRFCHWSSE-NEXT: prefetcht0 (%eax)
; X86-PRFCHWSSE-NEXT: prefetchnta (%eax)
; X86-PRFCHWSSE-NEXT: prefetchw (%eax)
; X86-PRFCHWSSE-NEXT: prefetchw (%eax)
; X86-PRFCHWSSE-NEXT: prefetchw (%eax)
; X86-PRFCHWSSE-NEXT: prefetchw (%eax)
; X86-PRFCHWSSE-NEXT: retl
entry:
tail call void @llvm.prefetch( ptr %ptr, i32 0, i32 1, i32 1 )
tail call void @llvm.prefetch( ptr %ptr, i32 0, i32 2, i32 1 )
tail call void @llvm.prefetch( ptr %ptr, i32 0, i32 3, i32 1 )
tail call void @llvm.prefetch( ptr %ptr, i32 0, i32 0, i32 1 )
tail call void @llvm.prefetch( ptr %ptr, i32 1, i32 1, i32 1 )
tail call void @llvm.prefetch( ptr %ptr, i32 1, i32 2, i32 1 )
tail call void @llvm.prefetch( ptr %ptr, i32 1, i32 3, i32 1 )
tail call void @llvm.prefetch( ptr %ptr, i32 1, i32 0, i32 1 )
ret void
}
declare void @llvm.prefetch(ptr, i32, i32, i32) nounwind