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

Is it acceptable to pull in nasm as a build dependency? #11109

Closed
AttilaFueloep opened this issue Oct 26, 2020 · 9 comments
Closed

Is it acceptable to pull in nasm as a build dependency? #11109

AttilaFueloep opened this issue Oct 26, 2020 · 9 comments
Labels
Type: Question Issue for discussion

Comments

@AttilaFueloep
Copy link
Contributor

Ask your question!

While trying to speedup AES-GCM using SSE, I found some promising assembler code. which should be relatively easy to port to the ICP. The major problem is that this code is written for the nasm assembler and makes heavy use of macros etc. Porting this to GNU as would require substantial work, if possible at all. I think I've two options to proceed:

1.) Pull in nasm as a new build dependency and use it inside the zfs source tree.

2.) Use nasm inside the intel tree to create object files and disassemble them to GNU as syntax using objconv Those generated files could then be imported to the zfs tree.

I tested option 2.) and it actually works (with a bit of tweaking) but creates really large and unreadable assembler files since all macros, loops etc. are expanded. So I think option 1.) would be the preferred one.

I'd appreciate any feedback which option would be the preferred one.

Which portion of the codebase does your question involve?

Build system and ICP.

@AttilaFueloep AttilaFueloep added the Type: Question Issue for discussion label Oct 26, 2020
@gdevenyi
Copy link
Contributor

I suspect asm code will not be acceptable due to not supporting multiple architectures.

@AttilaFueloep
Copy link
Contributor Author

Are you sure? There already is x86, arm and other assembler code in place to speed up checksums, raidz calculations and encryption. And the ICP is Linux only anyhow, or am I wrong?

@lundman
Copy link
Contributor

lundman commented Oct 26, 2020

I use ICP on both macOS and Windows. But as both are (will be) compiled with clang, what's in the tree just works. I do not know what nasm has in terms of support on either.

@AttilaFueloep
Copy link
Contributor Author

Good to know, did you integrate #9749? I guess not. Regarding nasm, yes it's available on Windows 32/64 and macOS.

@lundman
Copy link
Contributor

lundman commented Oct 26, 2020

I have not yet, but if changes uses simd_x86.h/asm_linkage.h then they should just work - the hard parts are in there :)

@AttilaFueloep
Copy link
Contributor Author

IRC only partly, but that shouldn't be hard to change. I'll have a look.

@AttilaFueloep
Copy link
Contributor Author

@behlendorf Any opinion on this? nasm is available on pretty much any platform, FreeBSD, Illumos, Mac OS,and Windows at least.

@behlendorf
Copy link
Contributor

As long as we made sure it was implemented in such a way that it could be easily disabled. For example when nasm isn't available for whatever reason, I think this would be fine.

@AttilaFueloep
Copy link
Contributor Author

Yes, doing a configure check for nasm/yasm and compiling the code only if available is the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question Issue for discussion
Projects
None yet
Development

No branches or pull requests

4 participants