Skip to content

Commit

Permalink
handle AVX-512 mask register usage in fips delocation process
Browse files Browse the repository at this point in the history
  • Loading branch information
pittma committed Nov 15, 2023
1 parent 20cfdbb commit 0a3fbc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions util/fipstools/delocate/delocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,13 @@ Args:
case ruleRegisterOrConstant, ruleLocalLabelRef:
args = append(args, d.contents(fullArg))

// The AVX-512 mask register is appended to its
// preceding `RegisterOrConstant` without whitespace
// or a comma.
case ruleAVX512Token:
tail := &args[len(args)-1];
*tail += d.contents(fullArg);

case ruleMemoryRef:
symbol, offset, section, didChange, symbolIsLocal, memRef := d.parseMemRef(arg.up)
changed = didChange
Expand Down
2 changes: 1 addition & 1 deletion util/fipstools/delocate/delocate.peg
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ LocalLabel <- [0-9][0-9$]*
LocalLabelRef <- [0-9][0-9$]*[bf]
Instruction <- InstructionName (WS InstructionArg ((WS? ','? WS?) InstructionArg)*)?
InstructionName <- [[A-Z]][[A-Z.0-9]]* [.+\-]?
InstructionArg <- IndirectionIndicator? (ARMConstantTweak / RegisterOrConstant / LocalLabelRef / TOCRefHigh / TOCRefLow / GOTLocation / GOTSymbolOffset / MemoryRef) AVX512Token*
InstructionArg <- IndirectionIndicator? (ARMConstantTweak / RegisterOrConstant / LocalLabelRef / TOCRefHigh / TOCRefLow / GOTLocation / GOTSymbolOffset / MemoryRef / AVX512Token)
GOTLocation <- '$_GLOBAL_OFFSET_TABLE_-' LocalSymbol
GOTSymbolOffset <- ('$' SymbolName '@GOT' 'OFF'?) / (":got:" SymbolName)
AVX512Token <- WS? '{' '%'? [0-9a-z]* '}'
Expand Down

0 comments on commit 0a3fbc1

Please sign in to comment.