arm64cpuid.pl 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/usr/bin/env perl
  2. $flavour = shift;
  3. $output = shift;
  4. $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
  5. ( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
  6. ( $xlate="${dir}perlasm/arm-xlate.pl" and -f $xlate) or
  7. die "can't locate arm-xlate.pl";
  8. open OUT,"| \"$^X\" $xlate $flavour $output";
  9. *STDOUT=*OUT;
  10. $code.=<<___;
  11. #include "arm_arch.h"
  12. .text
  13. .arch armv8-a+crypto
  14. .align 5
  15. .globl _armv7_neon_probe
  16. .type _armv7_neon_probe,%function
  17. _armv7_neon_probe:
  18. orr v15.16b, v15.16b, v15.16b
  19. ret
  20. .size _armv7_neon_probe,.-_armv7_neon_probe
  21. .globl _armv7_tick
  22. .type _armv7_tick,%function
  23. _armv7_tick:
  24. #ifdef __APPLE__
  25. mrs x0, CNTPCT_EL0
  26. #else
  27. mrs x0, CNTVCT_EL0
  28. #endif
  29. ret
  30. .size _armv7_tick,.-_armv7_tick
  31. .globl _armv8_aes_probe
  32. .type _armv8_aes_probe,%function
  33. _armv8_aes_probe:
  34. aese v0.16b, v0.16b
  35. ret
  36. .size _armv8_aes_probe,.-_armv8_aes_probe
  37. .globl _armv8_sha1_probe
  38. .type _armv8_sha1_probe,%function
  39. _armv8_sha1_probe:
  40. sha1h s0, s0
  41. ret
  42. .size _armv8_sha1_probe,.-_armv8_sha1_probe
  43. .globl _armv8_sha256_probe
  44. .type _armv8_sha256_probe,%function
  45. _armv8_sha256_probe:
  46. sha256su0 v0.4s, v0.4s
  47. ret
  48. .size _armv8_sha256_probe,.-_armv8_sha256_probe
  49. .globl _armv8_pmull_probe
  50. .type _armv8_pmull_probe,%function
  51. _armv8_pmull_probe:
  52. pmull v0.1q, v0.1d, v0.1d
  53. ret
  54. .size _armv8_pmull_probe,.-_armv8_pmull_probe
  55. ___
  56. print $code;
  57. close STDOUT;