[PATCH] D18802: Improve support for i386 and i486 CPUs.

James Y Knight via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 12:19:01 PDT 2016


jyknight created this revision.
jyknight added a subscriber: llvm-commits.
jyknight added a dependency: D18201: Switch over targets to use AtomicExpandPass, and clean up target atomics code..

As far as "normal" instructions go, only a few are present in the 586
but not in the earlier processors: the 486 doesn't have CMPXCHG8B, and
386 is additionally missing BSWAP, CMPXCHG, and XADD.

Previously, llvm would emit these instructions even if you asked to
target a 386.

XADD and CMPXCHG are used only for atomics; we now ask AtomicExpandPass
to deal with expanding to libcalls on these CPUs, so it's trivial to
avoid emitting those.

BSWAP, then, is all that remains to be dealt with. It gets a custom
expansion, because the 3 ROR instructions is better than the default
expansion for bswap (which can't take advantage of the partial register
updating on x86.)

Depends on D18201

http://reviews.llvm.org/D18802

Files:
  lib/Target/X86/X86.td
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86InstrCompiler.td
  lib/Target/X86/X86InstrInfo.cpp
  lib/Target/X86/X86InstrInfo.td
  lib/Target/X86/X86Subtarget.h
  test/CodeGen/X86/2010-10-08-cmpxchg8b.ll
  test/CodeGen/X86/atomic-cpus.ll
  test/CodeGen/X86/atomic-flags.ll
  test/CodeGen/X86/atomic-pointer.ll
  test/CodeGen/X86/atomic_mi.ll
  test/CodeGen/X86/bswap.ll
  test/CodeGen/X86/cmpxchg-clobber-flags.ll
  test/CodeGen/X86/nocx16.ll
  test/CodeGen/X86/peephole-na-phys-copy-folding.ll
  test/Transforms/AtomicExpand/X86/expand-atomic-rmw-initial-load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18802.52723.patch
Type: text/x-patch
Size: 29749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160405/6ba3ff98/attachment.bin>


More information about the llvm-commits mailing list