Page MenuHomeFreeBSD

Refactor skein_block_asm.s to assemble with LLVM integrated assembler
Needs ReviewPublic

Authored by gldisater_gmail.com on Jan 5 2019, 8:28 PM.

Details

Reviewers
jmg
cem
Summary

The LLVM integrated assembler doesn't support the extensive macro system that GNU as does. To implement the code without the heavy macros I wrote a C program to use C's macros to unroll all the code and printf each instruction to create interim files that were combined to make skein_block_asm.S that LLVM would compile. As looping would require the assembler to have the macro support it lacks all the loop code was removed. As the SKEIN_DEBUG code wasn't in use by FreeBSD I also removed it.

Test Plan

Tested with libmd's make test target

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

markj added a subscriber: emaste.Jan 7 2019, 10:50 PM
cem added a reviewer: cem.Aug 3 2019, 4:18 AM
emaste added inline comments.Aug 15 2019, 7:24 PM
lib/libmd/Makefile
120

Need to remove MK_BINUTILS_BOOTSTRAP test here and either move AFLAGS to ACFLAGS or drop if not needed any longer

emaste added a subscriber: jhb.Aug 15 2019, 7:30 PM
cem added a comment.Aug 17 2019, 1:45 AM

Ugh. Did you just preprocess it with as to de-macro it? It'd be nice to not lose that abstraction. Does IAS not support any form of macros?

Here is the files I use to create skein_block_asm.S - https://github.com/gldisater/genskein

When I did the original work in Nov, I wasn't able to get even a simple macro to work with the rotation constants (RC_256_0_0, etc.) but I found the bug in the genskein.c that was causing that issue, as well as a bug in the SkeinMix macro.