Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use NASM assembler on x86-64 Linux #3293

Merged
merged 10 commits into from
Jan 8, 2019
Merged

Conversation

nbhuiyan
Copy link
Member

@nbhuiyan nbhuiyan commented Oct 15, 2018

Changes so far include:

  • jilconsts.inc is now generated in NASM format on x86-64 Linux
  • A new makefile variable, NASM_ASSEMBLER is used to specify what platforms should use the NASM files
  • Handle how extern/public symbol names are decorated using the macros DECLARE_EXTERN and DECLARE_PUBLIC

Depends on: #3352 , eclipse-omr/omr#3124

Issue: #3148

@nbhuiyan
Copy link
Member Author

@0xdaryl fyi

@nbhuiyan
Copy link
Member Author

nbhuiyan commented Oct 18, 2018

@0xdaryl , while this PR is labelled as WIP, the only reason for that is that CMakefiles need to be updated so that the Travis CI builds pass. Currently, they will not pass because jilconsts.inc is now generated in NASM format on x86-64 Linux. I believe this can now be reviewed while I can discuss with @dnakamura regarding the necessary CMake and Travis CI changes so that the Travis CI CMake builds builds pass.

@nbhuiyan nbhuiyan force-pushed the nasm-linux branch 2 times, most recently from 99c2778 to 1aeb25d Compare October 22, 2018 16:02
@dnakamura
Copy link
Contributor

Changes are needed to both omr and open j9 to get the cmake part of this working. OMR part: eclipse-omr/omr#3124

Polishing off the openj9 part now

@dnakamura
Copy link
Contributor

Cmake patches ready
nbhuiyan#1 .( Note still depends on OMR changes being merged)

@pshipton pshipton added the depends:omr Pull request is dependent on a corresponding change in OMR label Nov 5, 2018
@nbhuiyan nbhuiyan changed the title WIP: Use NASM assembler on x86-64 Linux Use NASM assembler on x86-64 Linux Nov 13, 2018
@nbhuiyan
Copy link
Member Author

@0xdaryl ready for review as eclipse-omr/omr#3124 has been merged

@dnakamura
Copy link
Contributor

@nbhuiyan once the omr changes get promoted, you can rebase and push, which should re-trigger the travis build

@0xdaryl
Copy link
Contributor

0xdaryl commented Nov 23, 2018

Jenkins test sanity xlinux,win jdk8,jdk11

runtime/compiler/control/CompilationThread.cpp Outdated Show resolved Hide resolved
runtime/compiler/CMakeLists.txt Outdated Show resolved Hide resolved
runtime/compiler/CMakeLists.txt Outdated Show resolved Hide resolved
@nbhuiyan nbhuiyan force-pushed the nasm-linux branch 3 times, most recently from cda1d9f to 36ef459 Compare November 26, 2018 17:22
@nbhuiyan
Copy link
Member Author

@0xdaryl Your review comments have been addressed. Ready for review.

This new variable will make it simpler to specify the platforms
that should be using NASM files. This will not be needed once
all x86 OSes use NASM. Currently, NASM is set up to be used on
OSX and x86-64 Linux.

Signed-off-by: Nazim Uddin Bhuiyan <[email protected]>
nbhuiyan and others added 7 commits December 14, 2018 20:34
Applies to OSes that use NASM. DECLARE_PUBLIC/EXTERN would handle
the extern and global label naming differences between macOS and
Linux. Single-line macros _rax, _rbx, etc would be used for
handling the differences in register mapping when sharing
code between 32 and 64 bit hosts, getting rid of the file
X86RegisterMap.inc.

Signed-off-by: Nazim Uddin Bhuiyan <[email protected]>
X86-64 Linux (along with Mac OSX) now uses consistent format to
declare assembly procedure names in C++ code. Eventually, this
format will be used throughout x86.

Signed-off-by: Nazim Uddin Bhuiyan <[email protected]>
By making use of those macros, which are generated by jilgen,
we no longer have to worry about handling the OS differences when
writing assembly code to work across operating systems. This removes
the need to prepend underscores to global and extern symbol names.

Signed-off-by: Nazim Uddin Bhuiyan <[email protected]>
Signed-off-by: Nazim Uddin Bhuiyan <[email protected]>
NASM v2.14 errors out when entryFallback and methodEntryFallback
are set to equate to extern symbols. EQU is documented as being  meant
to define symbols to constant values.

Signed-off-by: Nazim Uddin Bhuiyan <[email protected]>
x86 platforms that use the NASM assembly files should not use
leading underscores in the JIT helper names. NASM_ASSEMBLER
is defined in asmprotos.h for platforms making use of the NASM
assembly files, and simplifies the preprocessor checks done to use
the correct version of the helper names.

Signed-off-by: Nazim Uddin Bhuiyan <[email protected]>
@0xdaryl
Copy link
Contributor

0xdaryl commented Dec 14, 2018

Jenkins test sanity xlinux,win jdk8,jdk11

@0xdaryl
Copy link
Contributor

0xdaryl commented Jan 7, 2019

Jenkins test sanity xlinux,win,win32 jdk8

@0xdaryl
Copy link
Contributor

0xdaryl commented Jan 7, 2019

Jenkins test sanity xlinux,win jdk11

@0xdaryl
Copy link
Contributor

0xdaryl commented Jan 7, 2019

Jenkins test sanity win32 jdk8

@0xdaryl
Copy link
Contributor

0xdaryl commented Jan 8, 2019

I completed some IBM-internal testing of this PR on Linux x86-32 and the builds and test succeeded. Merging now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:build comp:jit depends:omr Pull request is dependent on a corresponding change in OMR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants