This is an archive of the discontinued LLVM Phabricator instance.

x86: Emit LOCK prefix after DATA16
ClosedPublic

Authored by jfb on Dec 11 2014, 3:37 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

jfb updated this revision to Diff 17196.Dec 11 2014, 3:37 PM
jfb retitled this revision from to x86: Emit LOCK prefix after DATA16.
jfb updated this object.
jfb edited the test plan for this revision. (Show Details)
jfb added reviewers: craig.topper, jvoung.
jfb added a subscriber: Unknown Object (MLST).
jvoung accepted this revision.Dec 12 2014, 2:40 PM
jvoung edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 12 2014, 2:40 PM
This revision was automatically updated to reflect the committed changes.