amd64_instruction_unspecified.tpl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. [+ autogen5 template -*- Scheme -*- am +]
  2. [+ #|
  3. amd64_instruction_unspecified.tpl - template to be included by main.tpl
  4. Copyright (C) 2015 Alex Vong
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software Foundation,
  15. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |# +]
  16. [+ #| What get cleaned by `$ make mostlyclean' |# +]
  17. [+ (if-use-threads
  18. (list
  19. "MOSTLYCLEANFILES = mlucas.cfg\n"
  20. (amd64-rules->sse2-avx-avx2-rules
  21. "MOSTLYCLEANFILES += amd64/*.o\n")
  22. (amd64-rules->sse2-avx-avx2-rules
  23. "MOSTLYCLEANFILES += AMD64_TRICKY_O.tmp AMD64_TRICKY_O.stamp\n"))
  24. (amd64-rules->sse2-avx-avx2-rules
  25. "MOSTLYCLEANFILES += AMD64_NORMAL_O-AMD64_THREADS_O.tmp \
  26. AMD64_NORMAL_O-AMD64_THREADS_O.stamp")
  27. (amd64-rules->sse2-avx-avx2-rules
  28. "MOSTLYCLEANFILES += AMD64_NORMAL_O.tmp AMD64_NORMAL_O.stamp")) +]
  29. [+ #| Recipe of mlucas (wrapper script) |# +]
  30. bin_SCRIPTS = mlucas
  31. [+ (generate-script-making-rule
  32. '("pkglibexecdir")
  33. (script-name->path-name (get "script_in"))
  34. "mlucas"
  35. "mlucas"
  36. (script-name->path-name (get "script_in"))
  37. "echo ' GEN mlucas'"
  38. "./") +]
  39. [+ #| Recipe of sse2/mlucas, avx/mlucas and avx2/mlucas |# +]
  40. nobase_pkglibexec_PROGRAMS = sse2/mlucas avx/mlucas avx2/mlucas
  41. [+ (amd64-rules->sse2-avx-avx2-rules "amd64_mlucas_SOURCES=") +]
  42. [+ (amd64-rules->sse2-avx-avx2-rules
  43. "amd64_mlucas_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_AMD64") +]
  44. [+ (amd64-rules->sse2-avx-avx2-rules
  45. "amd64_mlucas_CFLAGS = $(AM_CFLAGS) -mamd64") +]
  46. [+ (amd64-rules->sse2-avx-avx2-rules
  47. (if-use-threads
  48. (list "amd64_mlucas_LDADD="
  49. (object-name->path-name
  50. "amd64/"
  51. (source-name->object-name (get "normal_c") (get "tricky_c"))))
  52. (list (object-name->path-name
  53. "amd64/"
  54. (source-name->object-name (get "threads_c")))
  55. " -lpthread -lrt")
  56. "")) +]
  57. [+ (amd64-rules->sse2-avx-avx2-rules
  58. (if-use-threads
  59. (list "amd64_mlucas_DEPENDENCIES="
  60. (object-name->path-name
  61. "amd64/"
  62. (source-name->object-name (get "normal_c") (get "tricky_c"))))
  63. (object-name->path-name
  64. "amd64/"
  65. (source-name->object-name (get "threads_c")))
  66. "")) +]
  67. [+ #| Recipe of object files |# +]
  68. [+ (amd64-rules->sse2-avx-avx2-rules
  69. (if-use-threads
  70. ""
  71. (generate-compilation-rule
  72. (append-prev-dir
  73. (source-name->path-name (get "normal_c") (get "threads_c")))
  74. "-DUSE_AMD64 -mamd64 $(NORMALCFLAGS)"
  75. "AMD64_NORMAL_O-AMD64_THREADS_O"
  76. (object-name->path-name
  77. "amd64/"
  78. (source-name->object-name (get "normal_c") (get "threads_c")))
  79. (source-name->path-name (get "normal_c") (get "threads_c"))
  80. "echo ' CC $$AMD64_NORMAL_O $$AMD64_THREADS_O'"
  81. "amd64/")
  82. (generate-compilation-rule
  83. (append-prev-dir
  84. (source-name->path-name (get "normal_c")))
  85. "-DUSE_AMD64 -mamd64 $(NORMALCFLAGS)"
  86. "AMD64_NORMAL_O"
  87. (object-name->path-name
  88. "amd64/"
  89. (source-name->object-name (get "normal_c")))
  90. (source-name->path-name (get "normal_c"))
  91. "echo ' CC $$AMD64_NORMAL_O'"
  92. "amd64/"))) +]
  93. [+ (amd64-rules->sse2-avx-avx2-rules
  94. (generate-compilation-rule
  95. (append-prev-dir (source-name->path-name (get "tricky_c")))
  96. "-DUSE_AMD64 -mamd64 $(TRICKYCFLAGS)"
  97. "AMD64_TRICKY_O"
  98. (object-name->path-name
  99. "amd64/"
  100. (source-name->object-name (get "tricky_c")))
  101. (source-name->path-name (get "tricky_c"))
  102. "echo ' CC $$AMD64_TRICKY_O'"
  103. "amd64/")) +]