x86: Emit LOCK prefix after DATA16
authorJF Bastien <jfb@google.com>
Mon, 15 Dec 2014 22:34:58 +0000 (22:34 +0000)
committerJF Bastien <jfb@google.com>
Mon, 15 Dec 2014 22:34:58 +0000 (22:34 +0000)
commit13c782674a2de3f5cb7ebd3ec15a144b5d5fef9b
treeac255040105730acb77cd16f2f49f88663e24084
parent5f702749c1d6309149049f6d59155fad5a3b6380
x86: Emit LOCK prefix after DATA16

Summary: x86 allows either ordering for the LOCK and DATA16 prefixes, but using GCC+GAS leads to different code generation than using LLVM. This change matches the order that GAS emits the x86 prefixes when a semicolon isn't used in inline assembly (see tc-i386.c comment before define LOCK_PREFIX), and helps simplify tooling that operates on the instruction's byte sequence (such as NaCl's validator). This change shouldn't have any performance impact.

Test Plan: ninja check

Reviewers: craig.topper, jvoung

Subscribers: jfb, llvm-commits

Differential Revision: http://reviews.llvm.org/D6630

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224283 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
test/CodeGen/X86/atomic16.ll