Author: adrian
Date: Wed Oct 14 14:29:56 2020
New Revision: 366703
URL: https://svnweb.freebsd.org/changeset/base/366703

Log:
  [skein] Fix compilation on gnu assembler with gcc-6 and gcc-9
  
  For some reason I don't want to really understand, the following
  happens with gnu as.
  
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S: 
Assembler messages:
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:466: 
Error: found '(', expected: ')'
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:466: 
Error: junk at end of line, first unrecognized character is `('
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:795: 
Error: found '(', expected: ')'
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:795: 
Error: junk at end of line, first unrecognized character is `('
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: 
Error: non-constant expression in ".if" statement
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: 
Error: non-constant expression in ".if" statement
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: 
Error: non-constant expression in ".if" statement
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: 
Error: non-constant expression in ".if" statement
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: 
Error: non-constant expression in ".if" statement
  /home/adrian/git/freebsd/src/sys/crypto/skein/amd64/skein_block_asm.S:885: 
Error: non-constant expression in ".if" statement
  
  After an exhaustive search and experimentation at 11pm, I discovered that
  putting them in parentheses fixes the compilation.
  
  Ed pointed out that I could likely fix this in a bunch of other
  locations but I'd rather leave these alone until other options
  are enabled.
  
  Tested:
  
  * gcc-6, amd64
  
  Reviewed by:  emaste

Modified:
  head/sys/crypto/skein/amd64/skein_block_asm.S

Modified: head/sys/crypto/skein/amd64/skein_block_asm.S
==============================================================================
--- head/sys/crypto/skein/amd64/skein_block_asm.S       Wed Oct 14 14:12:15 
2020        (r366702)
+++ head/sys/crypto/skein/amd64/skein_block_asm.S       Wed Oct 14 14:29:56 
2020        (r366703)
@@ -277,7 +277,7 @@ _STK_OFFS_  =   0                   #starting offset f
     StackVar    X_stk  ,8*(WCNT)    #local context vars
     StackVar    ksTwk  ,8*3         #key schedule: tweak words
     StackVar    ksKey  ,8*(WCNT)+8  #key schedule: key   words
-  .if (SKEIN_ASM_UNROLL & (\BLK_BITS)) == 0
+  .if ((SKEIN_ASM_UNROLL) & (\BLK_BITS)) == 0
     StackVar    ksRot ,16*(\KS_CNT) #leave space for "rotation" to happen
   .endif
     StackVar    Wcopy  ,8*(WCNT)    #copy of input block    
@@ -749,7 +749,7 @@ C_label Skein_256_Unroll_Cnt
 # MACRO: eight rounds for 512-bit blocks
 #
 .macro R_512_FourRounds _RR_    #RR = base round number (0 % 8)
-  .if (SKEIN_ASM_UNROLL & 512)
+  .if ((SKEIN_ASM_UNROLL) & 512)
     # here for fully unrolled case.
     _II_ = ((\_RR_)/4) + 1       #key injection counter
     R_512_OneRound  8, 9,10,11,12,13,14,15,%((\_RR_)+0),<movq 
ksKey+8*(((_II_)+3) % 9)+F_O(%rbp),%rax>,,<movq ksKey+8*(((_II_)+4) % 
9)+F_O(%rbp),%rbx>
@@ -978,7 +978,7 @@ rIdx_offs = tmpStk_1024
     movq       %\reg1 , xDebug_1024+8*\w1(%rsp)    # (before inline key 
injection)
  .endif
 _II_ = ((\_RN0_)/4)+1           #injection count
- .if SKEIN_ASM_UNROLL & 1024   #here to do fully unrolled key injection
+ .if (SKEIN_ASM_UNROLL) & 1024   #here to do fully unrolled key injection
     addq        ksKey+ 8*((_II_+\w0) % 17)(%rsp),%\reg0
     addq        ksKey+ 8*((_II_+\w1) % 17)(%rsp),%\reg1
   .if     \w1 == 13                                #tweak injection
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to