You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

25 line
660 B

  1. // +build amd64,!noasm
  2. package p503
  3. import cpu "github.com/cloudflare/p751sidh/internal/utils"
  4. // There couple of reasons for having those variables here:
  5. // * to have an access to them from assembly
  6. // TODO(kk): Is there a way to access variable from different package?
  7. // If it is then probably this file could be moved to internal
  8. // and we don't need to have many copies of that
  9. // * make it easy to vendor the library
  10. // * make it possible to test all functionalities
  11. var useMULX bool
  12. var useADXMULX bool
  13. func recognizecpu() {
  14. useMULX = cpu.HasBMI2
  15. useADXMULX = cpu.HasADX && cpu.HasBMI2
  16. }
  17. func init() {
  18. recognizecpu()
  19. }