Add support for prefetch with locality levels.
authorAustin Seipp <austin@well-typed.com>
Wed, 2 Oct 2013 02:13:14 +0000 (21:13 -0500)
committerAustin Seipp <austin@well-typed.com>
Wed, 2 Oct 2013 02:26:47 +0000 (21:26 -0500)
commitfd74014079f14bd3ab50e328e52c44ef97d40e05
treeda31c992a76d3816a4f1012ceb1eb4e68d0fb556
parent627d1e008cbe4d9318b2466394420a968d1659da
Add support for prefetch with locality levels.

This patch adds support for several new primitive operations which
support using processor-specific instructions to help guide data and
cache locality decisions. We have levels ranging from [0..3]

For LLVM, we generate llvm.prefetch intrinsics at the proper locality
level (similar to GCC.)

For x86 we generate prefetch{NTA, t2, t1, t0} instructions. On SPARC and
PowerPC, the locality levels are ignored.

This closes #8256.

Authored-by: Carter Tazio Schonwald <carter.schonwald@gmail.com>
Signed-off-by: Austin Seipp <austin@well-typed.com>
compiler/cmm/CmmMachOp.hs
compiler/cmm/CmmParse.y
compiler/cmm/PprC.hs
compiler/codeGen/StgCmmPrim.hs
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
compiler/nativeGen/PPC/CodeGen.hs
compiler/nativeGen/SPARC/CodeGen.hs
compiler/nativeGen/X86/CodeGen.hs
compiler/nativeGen/X86/Instr.hs
compiler/nativeGen/X86/Ppr.hs
compiler/prelude/primops.txt.pp