TrenchBoot / landing-zone

An open source implementation of an AMD-V Secure Loader.
GNU General Public License v2.0
23 stars 7 forks source link

Various small code-gen improvements with hashing logic #23

Closed andyhhp closed 4 years ago

andyhhp commented 4 years ago

Net bloat-o-meter report:

64:
add/remove: 0/3 grow/shrink: 1/3 up/down: 26/-188 (-162)
Function                                     old     new   delta
sha1sum                                      389     415     +26
sha256_update                               7612    7610      -2
lz_main                                      269     266      -3
sha256sum                                    214     204     -10
sha256_hash                                   32       -     -32
sha1_init                                     49       -     -49
sha1ctx                                       92       -     -92
Total: Before=60531, After=60369, chg -0.27%

32:
add/remove: 0/3 grow/shrink: 1/3 up/down: 27/-214 (-187)
Function                                     old     new   delta
sha1sum                                      393     420     +27
sha256_update                               7649    7647      -2
sha256sum                                    249     235     -14
lz_main                                      292     271     -21
sha256_hash                                   32       -     -32
sha1_init                                     53       -     -53
sha1ctx                                       92       -     -92
Total: Before=31577, After=31390, chg -0.59%

lto.64:
add/remove: 2/4 grow/shrink: 0/2 up/down: 4698/-5016 (-318)
Function                                     old     new   delta
transform                                      -    4471   +4471
sha1_write                                     -     227    +227
sha256_update.lto_priv                      7902    7900      -2
sha256_hash                                   32       -     -32
sha1ctx.lto_priv                              92       -     -92
lz_main                                     1948    1818    -130
sha1_write.constprop                         256       -    -256
transform.constprop                         4504       -   -4504
Total: Before=60817, After=60499, chg -0.52%

lto.32:
add/remove: 2/4 grow/shrink: 0/2 up/down: 4250/-4548 (-298)
Function                                     old     new   delta
transform                                      -    4068   +4068
sha1_write                                     -     182    +182
sha256_update.lto_priv                      7708    7706      -2
sha256_hash                                   32       -     -32
lz_main                                     1904    1815     -89
sha1ctx.lto_priv                              92       -     -92
sha1_write.constprop                         225       -    -225
transform.constprop                         4108       -   -4108
Total: Before=31381, After=31083, chg -0.95%

Need to double check the stack size and possibly increase it to compensate, but it looks fine from the disassembly.