openssl: anyone building with assembly optimizations enable?

59 views
Skip to first unread message

David Baggett

unread,
Jan 31, 2016, 12:12:14 PM1/31/16
to Native-Client-Discuss
I've got openssl 1.0.2 trunk building for all the NaCl arches with these Configure targets:

"nacl-x86_64-clang-newlib", "cc:-O3 -fomit-frame-pointer -Wall::-DL_ENDIAN -D_REENTRANT -DTERMIOS -DNO_SYSLOG:::SIXTY_FOUR_BIT RC4_CHUNK DES_INT DES_UNROLL:::::::",

"nacl-i386-clang-newlib","cc:-O3 -fomit-frame-pointer -Wall::-DL_ENDIAN -D_REENTRANT -DTERMIOS -DNO_SYSLOG:::BN_LLONG:::",

"nacl-arm-clang-newlib","cc:-O3 -fomit-frame-pointer -Wall::-DL_ENDIAN -D_REENTRANT -DTERMIOS -DNO_SYSLOG:::BN_LLONG::",

"pnacl-le32","gcc:-O3 -fomit-frame-pointer -Wall::-DL_ENDIAN -D_REENTRANT -DNO_SYSLOG -DGETPID_IS_MEANINGLESS -UHAVE_CRYPTODEV::-lnacl_io -lppapi -lc++:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:::::",

Has anyone had any luck enable x86 or arm assembly optimizations? They would approximately double performance if we could get them working.

Dave

Ben Smith

unread,
Feb 2, 2016, 2:02:06 PM2/2/16
to Native-Client-Discuss
NaCl assembly must be sandboxed, so it won't work without porting. If you want to give it a try, the sandbox internals page is a good reference.

David Baggett

unread,
Feb 2, 2016, 4:40:13 PM2/2/16
to Native-Client-Discuss
RIght, I ported a little of assembly for i686/x32/arm already so I know (vaguely) what's involved.

I assume AES-NI and ARM AES instructions are unlikely to ever be supported?

Dave

Petr Hosek

unread,
Feb 2, 2016, 5:35:30 PM2/2/16
to native-cli...@googlegroups.com
If you don't want to do the sandboxing by hand, you can try the experimental auto-sandboxing support. The linked design document has information about the implementation. To enable auto-sandboxing, you need to pass the following flags to nacl-clang (e.g. by appending them to CFLAGS): ' -integrated-as -mllvm -nacl-enable-auto-sandboxing'

If you run into errors, please let us know, we're still debugging the auto-sandboxing implementation (which is why it's not enabled by default yet) and we're looking for more feedback.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at https://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

David Baggett

unread,
Feb 3, 2016, 9:04:19 AM2/3/16
to Native-Client-Discuss
Sweet -- thanks, Petr! I did not know about auto-sandboxing and will give it a try.

Dave
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.

David Baggett

unread,
Feb 3, 2016, 9:53:20 AM2/3/16
to Native-Client-Discuss
Right off the bat I get:

vpaes-x86_64.s:49:2: error: Not enough scratch registers specified
        movdqa  -64(%r11,%r10,1),%xmm1
        ^

I'll investigate further.

Dave

On Tuesday, February 2, 2016 at 5:35:30 PM UTC-5, Petr Hosek wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.

David Baggett

unread,
Feb 3, 2016, 10:24:33 AM2/3/16
to Native-Client-Discuss
OK, I see that I have to provide .scratch directives to help the sandboxing code.
Dave
Reply all
Reply to author
Forward
0 new messages