Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Side by Side Diff: LOWERING.rst

Issue 1020853011: Subzero: Fix a lowering bug involving xchg and xadd instructions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Similar for cmpxchg and cmpxchg8b. Add documentation. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Target-specific lowering in ICE 1 Target-specific lowering in ICE
2 =============================== 2 ===============================
3 3
4 This document discusses several issues around generating target-specific ICE 4 This document discusses several issues around generating target-specific ICE
5 instructions from high-level ICE instructions. 5 instructions from high-level ICE instructions.
6 6
7 Meeting register address mode constraints 7 Meeting register address mode constraints
8 ----------------------------------------- 8 -----------------------------------------
9 9
10 Target-specific instructions often require specific operands to be in physical 10 Target-specific instructions often require specific operands to be in physical
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 instruction. Using pseudocode:: 211 instruction. Using pseudocode::
212 212
213 t1:eax = call foo(arg1, ...) 213 t1:eax = call foo(arg1, ...)
214 InstFakeKill // eax, ecx, edx 214 InstFakeKill // eax, ecx, edx
215 t2:edx = InstFakeDef(t1) 215 t2:edx = InstFakeDef(t1)
216 v_result_low = t1 216 v_result_low = t1
217 v_result_high = t2 217 v_result_high = t2
218 218
219 If ``v_result_high`` is live but ``v_result_low`` is dead, adding ``t1`` as an 219 If ``v_result_high`` is live but ``v_result_low`` is dead, adding ``t1`` as an
220 argument to ``InstFakeDef`` suffices to keep the ``call`` instruction live. 220 argument to ``InstFakeDef`` suffices to keep the ``call`` instruction live.
221
222 Instructions modifying source operands
223 --------------------------------------
224
225 Some native instructions may modify one or more source operands. For example,
226 the x86 ``xadd`` and ``xchg`` instructions modify both source operands. Some
227 analysis needs to identify every place a ``Variable`` is modified, and it uses
228 the presence of a ``Dest`` variable for this analysis. Since ICE instructions
229 have at most one ``Dest``, the ``xadd`` and ``xchg`` instructions need special
230 treatment.
231
232 A ``Variable`` that is not the ``Dest`` can be marked as modified by adding an
233 ``InstFakeDef``. However, this is not sufficient, as the ``Variable`` may have
234 no more live uses, which could result in the ``InstFakeDef`` being dead-code
235 eliminated. The solution is to add an ``InstFakeUse`` as well.
236
237 To summarize, for every source ``Variable`` that is not equal to the
238 instruction's ``Dest``, append an ``InstFakeDef`` and ``InstFakeUse``
239 instruction to provide the necessary analysis information.
OLDNEW
« no previous file with comments | « no previous file | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698