how can I translate this ASM code (search the most significant bit) to the C-backend?
Code: Select all
Procedure.i MSB(Quad.q)
If Quad = 0
ProcedureReturn -1
Else
! MOV rax, [p.v_Quad]
! BSR rax, rax
ProcedureReturn
EndIf
EndProcedure
Debug MSB(%0)
Debug MSB(%1000)
Debug MSB(%10001000)
Debug MSB(%100010001000)