@@ -404,6 +404,12 @@ func encode_cmgt16b(a, b, dest Register) (ans uint32) {
404404 return 0x271 << 21 | b .ARMId ()<< 16 | 0xd << 10 | a .ARMId ()<< 5 | dest .ARMId ()
405405}
406406
407+ func encode_not16b (src , dest Register ) uint32 {
408+ // NOT Vd.16B, Vn.16B (alias of MVN)
409+ // Encoding: 0 Q 1 01110 size 10000 00101 10 Rn Rd (Q=1, size=00 for .16B)
410+ return 0x6E205800 | (src .ARMId () << 5 ) | dest .ARMId ()
411+ }
412+
407413func (f * Function ) MaskForCountDestructive (vec , ans Register ) {
408414 // vec is clobbered by this function
409415 f .Comment ("Count the number of bytes to the first 0xff byte and put the result in" , ans )
@@ -690,7 +696,8 @@ func (f *Function) Or(a, b, dest Register) {
690696
691697func (f * Function ) NotSelf (r Register ) {
692698 if f .ISA .Goarch == ARM64 {
693- f .instr ("VMVN" , r .ARMFullWidth (), r .ARMFullWidth ())
699+ f .Comment ("Go assembler doesn't support the VMVN instruction, below we have: NOT" , r .ARMFullWidth ()+ "," , r .ARMFullWidth ())
700+ f .instr ("WORD" , fmt .Sprintf ("$0x%x" , encode_not16b (r , r )))
694701 f .AddTrailingComment (r , "= ~" , r , "(bitwise NOT)" )
695702 return
696703 }
0 commit comments