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

Issue 647443005: Change usage of naclcall and nacljmp pseudo-instructions to match x86 gas (Closed)

Created:
6 years, 2 months ago by Derek Schuff
Modified:
6 years, 2 months ago
CC:
native-client-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Visibility:
Public.

Description

Change usage of naclcall and nacljmp pseudo-instructions to match x86 gas x86 gas uses "call" for direct calls and "naclcall" for indirect calls, and implicitly handles bundle-align-to-end for all calls in nacl mode; previously we used "naclcall" for all calls which used bundle alignment. This makes the assembler automatically align bare "call" instructions. On x86-32 we remove our custom nacl-flavored call instruction in favor of the bare call. On x86-64 we still need a different codegen target for isel that takes a 32-bit operand due to our pointer-size differences, but we also sandbox bare call instructions. Also for 64-bit forms of "nacljmp %foo, %r15" gas uses 32-bit operands (nacljmp %r11d, %r15), whereas we had been using 64-bit operands (nacljmp %r11, %r15). Using a 32-bit operand makes some sense since the pointers are 32 bits; using a 64-bit operand makes some sense since the entire register is cleared, but it's better to match. The operands used in codegen are the same so again this is mostly just a change in assembler spelling that's invisible to the compiler. R=jvoung@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=3966 Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-llvm.git;a=commit;h=e9104b5e4a843c4dd440be5b14ebbdd2912a99c8

Patch Set 1 #

Total comments: 2

Patch Set 2 : remove NACL_call32d and auto-align bare call #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -31 lines) Patch
M lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp View 1 2 chunks +2 lines, -0 lines 0 comments Download
M lib/Target/X86/MCTargetDesc/X86MCNaCl.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M lib/Target/X86/MCTargetDesc/X86MCNaCl.cpp View 1 4 chunks +25 lines, -5 lines 0 comments Download
M lib/Target/X86/X86InstrNaCl.td View 1 3 chunks +2 lines, -4 lines 2 comments Download
M lib/Target/X86/X86MCInstLower.cpp View 1 1 chunk +1 line, -6 lines 0 comments Download
M lib/Target/X86/X86NaClRewritePass.cpp View 1 4 chunks +6 lines, -4 lines 4 comments Download
M test/CodeGen/X86/fast-isel-x86-64.ll View 2 chunks +2 lines, -2 lines 0 comments Download
A test/MC/X86/AlignedBundling/nacl-call-auto-align-to-end.s View 1 1 chunk +47 lines, -0 lines 0 comments Download
M test/NaCl/X86/nacl-calls.ll View 1 2 chunks +6 lines, -6 lines 0 comments Download
M test/NaCl/X86/nacl-read-tp-intrinsic.ll View 1 1 chunk +1 line, -1 line 0 comments Download
M test/NaCl/X86/nacl-setlongjmp-intrinsics.ll View 1 1 chunk +2 lines, -2 lines 0 comments Download
M test/NaCl/X86/pnacl-avoids-r11-x86-64.ll View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
Derek Schuff
I had hoped to get rid of NACL_CALL32d and replace it with just CALLpcrel32, but ...
6 years, 2 months ago (2014-10-14 00:04:34 UTC) #1
jvoung (off chromium)
https://codereview.chromium.org/647443005/diff/1/lib/Target/X86/X86InstrNaCl.td File lib/Target/X86/X86InstrNaCl.td (right): https://codereview.chromium.org/647443005/diff/1/lib/Target/X86/X86InstrNaCl.td#newcode64 lib/Target/X86/X86InstrNaCl.td:64: "call\t$dst">; How does this affect the asm parser, if ...
6 years, 2 months ago (2014-10-14 15:30:24 UTC) #2
Derek Schuff
https://codereview.chromium.org/647443005/diff/1/lib/Target/X86/X86InstrNaCl.td File lib/Target/X86/X86InstrNaCl.td (right): https://codereview.chromium.org/647443005/diff/1/lib/Target/X86/X86InstrNaCl.td#newcode64 lib/Target/X86/X86InstrNaCl.td:64: "call\t$dst">; On 2014/10/14 15:30:23, jvoung wrote: > How does ...
6 years, 2 months ago (2014-10-14 23:39:32 UTC) #3
jvoung (off chromium)
LGTM https://codereview.chromium.org/647443005/diff/20001/lib/Target/X86/X86InstrNaCl.td File lib/Target/X86/X86InstrNaCl.td (right): https://codereview.chromium.org/647443005/diff/20001/lib/Target/X86/X86InstrNaCl.td#newcode106 lib/Target/X86/X86InstrNaCl.td:106: "call\t$dst">; Hmm, interesting -- is there no problem ...
6 years, 2 months ago (2014-10-15 00:38:14 UTC) #4
Derek Schuff
Committed patchset #2 (id:20001) manually as e9104b5e4a843c4dd440be5b14ebbdd2912a99c8 (presubmit successful).
6 years, 2 months ago (2014-10-15 17:14:00 UTC) #5
Derek Schuff
6 years, 2 months ago (2014-10-15 17:14:14 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/647443005/diff/20001/lib/Target/X86/X86InstrN...
File lib/Target/X86/X86InstrNaCl.td (right):

https://codereview.chromium.org/647443005/diff/20001/lib/Target/X86/X86InstrN...
lib/Target/X86/X86InstrNaCl.td:106: "call\t$dst">;
On 2014/10/15 00:38:14, jvoung wrote:
> Hmm, interesting -- is there no problem w/ this because the type of the
> immediate doesn't clash with CALL64pcrel32 ?

No, there doesn't seem to be; I assume that's the reason why.

https://codereview.chromium.org/647443005/diff/20001/lib/Target/X86/X86NaClRe...
File lib/Target/X86/X86NaClRewritePass.cpp (right):

https://codereview.chromium.org/647443005/diff/20001/lib/Target/X86/X86NaClRe...
lib/Target/X86/X86NaClRewritePass.cpp:629: //   naclcall __nacl_read_tp@PLT
On 2014/10/15 00:38:14, jvoung wrote:
> "call __nacl_read_tp" now?

Done.

https://codereview.chromium.org/647443005/diff/20001/lib/Target/X86/X86NaClRe...
lib/Target/X86/X86NaClRewritePass.cpp:658: //   naclcall __nacl_read_tp@PLT
On 2014/10/15 00:38:14, jvoung wrote:
> same

Done.

Powered by Google App Engine
This is Rietveld 408576698