cosmopolitan/libc/intrin
Justine Tunney 398f0c16fb Add SNI support to redbean and improve SSL perf
This change makes SSL virtual hosting possible. You can now load
multiple certificates for multiple domains and redbean will just
figure out which one to use, even if you only have 1 ip address.
You can also use a jumbo certificate that lists all your domains
in the the subject alternative names.

This change also makes performance improvements to MbedTLS. Here
are some benchmarks vs. cc1920749e

                                   BEFORE    AFTER   (microsecs)
suite_ssl.com                     2512881   191738 13.11x faster
suite_pkparse.com                   36291     3295 11.01x faster
suite_x509parse.com                854669   120293  7.10x faster
suite_pkwrite.com                    6549     1265  5.18x faster
suite_ecdsa.com                     53347    18778  2.84x faster
suite_pk.com                        49051    18717  2.62x faster
suite_ecdh.com                      19535     9502  2.06x faster
suite_shax.com                      15848     7965  1.99x faster
suite_rsa.com                      353257   184828  1.91x faster
suite_x509write.com                162646    85733  1.90x faster
suite_ecp.com                       20503    11050  1.86x faster
suite_hmac_drbg.no_reseed.com       19528    11417  1.71x faster
suite_hmac_drbg.nopr.com            12460     8010  1.56x faster
suite_mpi.com                      687124   442661  1.55x faster
suite_hmac_drbg.pr.com              11890     7752  1.53x faster

There aren't any special tricks to the performance imporvements.
It's mostly due to code cleanup, assembly and intel instructions
like mulx, adox, and adcx.
2021-07-23 13:56:13 -07:00
..
addvdi3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
addvsi3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
addvti3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
asan.c Add SNI support to redbean and improve SSL perf 2021-07-23 13:56:13 -07:00
asan.internal.h Make redbean StoreAsset() work better 2021-05-14 05:44:37 -07:00
intrin.mk Remove undefined behaviors 2021-05-16 11:16:28 -07:00
macros.h Add chibicc 2020-12-06 16:20:21 -08:00
mpsadbw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
mpsadbw.h Make minor improvements 2020-12-23 23:42:56 -08:00
mpsadbws.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
mulvdi3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
mulvsi3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
mulvti3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
negvdi2.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
negvsi2.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
negvti2.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
ntgetversion.c Eliminate some flakes 2021-02-03 06:25:27 -08:00
onarithmeticoverflow.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
pabsb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pabsb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pabsd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pabsd.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pabsw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pabsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
packssdw.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
packssdw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
packsswb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
packsswb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
packusdw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
packusdw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
packuswb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
packuswb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
paddb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
paddb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
paddd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
paddd.h Remove undefined behaviors 2021-05-16 11:16:28 -07:00
paddq.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
paddq.h Remove undefined behaviors 2021-05-16 11:16:28 -07:00
paddsb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
paddsb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
paddsw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
paddsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
paddusb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
paddusb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
paddusw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
paddusw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
paddw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
paddw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
palignr.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
palignr.h Make minor improvements 2020-12-23 23:42:56 -08:00
palignrs.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
pand.c Change license 2020-12-27 17:18:44 -08:00
pand.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pandn.c Change license 2020-12-27 17:18:44 -08:00
pandn.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pavgb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pavgb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pavgw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pavgw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pcmpeqb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pcmpeqb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pcmpeqd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pcmpeqd.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pcmpeqw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pcmpeqw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pcmpgtb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pcmpgtb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pcmpgtd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pcmpgtd.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pcmpgtw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pcmpgtw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pdep.c Change license 2020-12-27 17:18:44 -08:00
pdep.h Make improvements 2020-12-01 03:43:40 -08:00
pext.c Change license 2020-12-27 17:18:44 -08:00
pext.h Make improvements 2020-12-01 03:43:40 -08:00
phaddd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
phaddd.h Remove undefined behaviors 2021-05-16 11:16:28 -07:00
phaddsw.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
phaddsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
phaddw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
phaddw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
phsubd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
phsubd.h Remove undefined behaviors 2021-05-16 11:16:28 -07:00
phsubsw.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
phsubsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
phsubw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
phsubw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmaddubsw.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
pmaddubsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmaddwd.c Change license 2020-12-27 17:18:44 -08:00
pmaddwd.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmaxsw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pmaxsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmaxub.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
pmaxub.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pminsw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pminsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pminub.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
pminub.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmovmskb.c Change license 2020-12-27 17:18:44 -08:00
pmovmskb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmulhrsw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pmulhrsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmulhuw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pmulhuw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmulhw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pmulhw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmulld.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pmulld.h Remove undefined behaviors 2021-05-16 11:16:28 -07:00
pmullw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pmullw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pmuludq.c Change license 2020-12-27 17:18:44 -08:00
pmuludq.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
por.c Change license 2020-12-27 17:18:44 -08:00
por.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psadbw.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
psadbw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pshufb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pshufb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pshufd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pshufd.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pshufhw.c Change license 2020-12-27 17:18:44 -08:00
pshufhw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pshuflw.c Change license 2020-12-27 17:18:44 -08:00
pshuflw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pshufw.c Change license 2020-12-27 17:18:44 -08:00
pshufw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psignb.c Change license 2020-12-27 17:18:44 -08:00
psignb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psignd.c Remove undefined behaviors 2021-05-16 11:16:28 -07:00
psignd.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psignw.c Change license 2020-12-27 17:18:44 -08:00
psignw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pslld.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pslld.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pslldq.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
pslldq.h Make minor improvements 2020-12-23 23:42:56 -08:00
pslldqs.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
pslldv.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psllq.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psllq.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psllqv.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psllw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psllw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psllwv.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psrad.c Remove undefined behaviors 2021-05-16 11:16:28 -07:00
psrad.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psradv.c Remove undefined behaviors 2021-05-16 11:16:28 -07:00
psraw.c Remove undefined behaviors 2021-05-16 11:16:28 -07:00
psraw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psrawv.c Remove undefined behaviors 2021-05-16 11:16:28 -07:00
psrld.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psrld.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psrldq.c Make more functions friendly to Address Sanitizer 2021-02-02 03:45:31 -08:00
psrldq.h Make minor improvements 2020-12-23 23:42:56 -08:00
psrldqs.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
psrldv.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psrlq.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psrlq.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psrlqv.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psrlw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psrlw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psrlwv.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubb.h Make terminal ui binaries work well everywhere 2020-10-19 06:38:31 -07:00
psubd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubd.h Remove undefined behaviors 2021-05-16 11:16:28 -07:00
psubq.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubq.h Remove undefined behaviors 2021-05-16 11:16:28 -07:00
psubsb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubsb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psubsw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubsw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psubusb.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubusb.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psubusw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubusw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
psubw.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
psubw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
punpckhbw.c Change license 2020-12-27 17:18:44 -08:00
punpckhbw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
punpckhdq.c Change license 2020-12-27 17:18:44 -08:00
punpckhdq.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
punpckhqdq.c Change license 2020-12-27 17:18:44 -08:00
punpckhqdq.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
punpckhwd.c Change license 2020-12-27 17:18:44 -08:00
punpckhwd.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
punpcklbw.c Change license 2020-12-27 17:18:44 -08:00
punpcklbw.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
punpckldq.c Change license 2020-12-27 17:18:44 -08:00
punpckldq.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
punpcklqdq.c Change license 2020-12-27 17:18:44 -08:00
punpcklqdq.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
punpcklwd.c Change license 2020-12-27 17:18:44 -08:00
punpcklwd.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
pxor.c Change license 2020-12-27 17:18:44 -08:00
pxor.h Add x86_64-linux-gnu emulator 2020-08-25 04:43:42 -07:00
repmovsb.h Get address sanitizer mostly working 2020-09-03 05:44:37 -07:00
repstosb.h Make improvements 2020-09-14 00:02:34 -07:00
shufpd.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
shufpd.h Fix bugs and have emulator emulate itself 2020-08-31 05:17:31 -07:00
shufps.c Make SSL handshakes much faster 2021-07-11 23:17:47 -07:00
shufps.h Fix bugs and have emulator emulate itself 2020-08-31 05:17:31 -07:00
somanyasan.S Make redbean StoreAsset() work better 2021-05-14 05:44:37 -07:00
subvdi3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
subvsi3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
subvti3.S Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
ubsan.c Remove undefined behaviors 2021-05-16 11:16:28 -07:00