Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix generated GMP assembly sources on x86_64 linux #733

Merged
merged 3 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ on:
branches:
- develop
paths:
- '*.bazel'
- '.bazelrc'
- '.github/workflows/**.yml'
- 'PACE'
- 'VERSION'
- 'bazel/**'
- 'build.zig'
- 'build.zig.zon'
- 'ext/**'
- '!ext/**.md'
- 'pkg/**'
- '.github/workflows/**.yml'
- '*.sh'

jobs:
urbit:
Expand Down
325 changes: 1 addition & 324 deletions ext/gmp/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -18,328 +18,6 @@ pub fn build(b: *std.Build) void {

lib.linkLibC();

// TODO: The values here should be provided programmatically
const config_h = b.addConfigHeader(.{
.style = .{
.autoconf = dep_c.path("config.in"),
},
.include_path = "config.h",
}, .{
.GMP_MPARAM_H_SUGGEST = "./mpn/arm64/gmp-mparam.h",
.HAVE_ALARM = 1,
.HAVE_ALLOCA = 1,
.HAVE_ALLOCA_H = 1,
.HAVE_ATTRIBUTE_CONST = 1,
.HAVE_ATTRIBUTE_MALLOC = 1,
.HAVE_ATTRIBUTE_MODE = 1,
.HAVE_ATTRIBUTE_NORETURN = 1,
.HAVE_CLOCK = 1,
.HAVE_CLOCK_GETTIME = 1,
.HAVE_DECL_FGETC = 1,
.HAVE_DECL_FSCANF = 1,
.HAVE_DECL_OPTARG = 1,
.HAVE_DECL_SYS_ERRLIST = 1,
.HAVE_DECL_SYS_NERR = 1,
.HAVE_DECL_UNGETC = 1,
.HAVE_DECL_VFPRINTF = 1,
.HAVE_DLFCN_H = 1,
.HAVE_DOUBLE_IEEE_LITTLE_ENDIAN = 1,
.HAVE_FCNTL_H = 1,
.HAVE_FLOAT_H = 1,
.HAVE_GETPAGESIZE = 1,
.HAVE_GETRUSAGE = 1,
.HAVE_GETTIMEOFDAY = 1,
.HAVE_INTMAX_T = 1,
.HAVE_INTPTR_T = 1,
.HAVE_INTTYPES_H = 1,
.HAVE_LANGINFO_H = 1,
.HAVE_LIMB_LITTLE_ENDIAN = 1,
.HAVE_LOCALECONV = 1,
.HAVE_LOCALE_H = 1,
.HAVE_LONG_DOUBLE = 1,
.HAVE_LONG_LONG = 1,
.HAVE_MEMORY_H = 1,
.HAVE_MEMSET = 1,
.HAVE_MMAP = 1,
.HAVE_MPROTECT = 1,
.HAVE_NATIVE_mpn_add_n = 1,
.HAVE_NATIVE_mpn_add_nc = 1,
.HAVE_NATIVE_mpn_addlsh1_n = 1,
.HAVE_NATIVE_mpn_addlsh2_n = 1,
.HAVE_NATIVE_mpn_and_n = 1,
.HAVE_NATIVE_mpn_andn_n = 1,
.HAVE_NATIVE_mpn_bdiv_dbm1c = 1,
.HAVE_NATIVE_mpn_bdiv_q_1 = 1,
.HAVE_NATIVE_mpn_pi1_bdiv_q_1 = 1,
.HAVE_NATIVE_mpn_cnd_add_n = 1,
.HAVE_NATIVE_mpn_cnd_sub_n = 1,
.HAVE_NATIVE_mpn_com = 1,
.HAVE_NATIVE_mpn_copyd = 1,
.HAVE_NATIVE_mpn_copyi = 1,
.HAVE_NATIVE_mpn_gcd_11 = 1,
.HAVE_NATIVE_mpn_gcd_22 = 1,
.HAVE_NATIVE_mpn_hamdist = 1,
.HAVE_NATIVE_mpn_invert_limb = 1,
.HAVE_NATIVE_mpn_ior_n = 1,
.HAVE_NATIVE_mpn_iorn_n = 1,
.HAVE_NATIVE_mpn_lshift = 1,
.HAVE_NATIVE_mpn_lshiftc = 1,
.HAVE_NATIVE_mpn_mod_34lsub1 = 1,
.HAVE_NATIVE_mpn_mul_1 = 1,
.HAVE_NATIVE_mpn_mul_1c = 1,
.HAVE_NATIVE_mpn_nand_n = 1,
.HAVE_NATIVE_mpn_nior_n = 1,
.HAVE_NATIVE_mpn_popcount = 1,
.HAVE_NATIVE_mpn_rsblsh1_n = 1,
.HAVE_NATIVE_mpn_rsblsh2_n = 1,
.HAVE_NATIVE_mpn_rsh1add_n = 1,
.HAVE_NATIVE_mpn_rsh1sub_n = 1,
.HAVE_NATIVE_mpn_rshift = 1,
.HAVE_NATIVE_mpn_sqr_diag_addlsh1 = 1,
.HAVE_NATIVE_mpn_sub_n = 1,
.HAVE_NATIVE_mpn_sub_nc = 1,
.HAVE_NATIVE_mpn_sublsh1_n = 1,
.HAVE_NATIVE_mpn_sublsh2_n = 1,
.HAVE_NATIVE_mpn_xor_n = 1,
.HAVE_NATIVE_mpn_xnor_n = 1,
.HAVE_NL_LANGINFO = 1,
.HAVE_NL_TYPES_H = 1,
.HAVE_POPEN = 1,
.HAVE_PROCESSOR_INFO = 1,
.HAVE_PTRDIFF_T = 1,
.HAVE_QUAD_T = 1,
.HAVE_RAISE = 1,
.HAVE_SIGACTION = 1,
.HAVE_SIGALTSTACK = 1,
.HAVE_STACK_T = 1,
.HAVE_STDINT_H = 1,
.HAVE_STDLIB_H = 1,
.HAVE_STRCHR = 1,
.HAVE_STRERROR = 1,
.HAVE_STRINGS_H = 1,
.HAVE_STRING_H = 1,
.HAVE_STRNLEN = 1,
.HAVE_STRTOL = 1,
.HAVE_STRTOUL = 1,
.HAVE_SYSCONF = 1,
.HAVE_SYSCTL = 1,
.HAVE_SYSCTLBYNAME = 1,
.HAVE_SYS_MMAN_H = 1,
.HAVE_SYS_PARAM_H = 1,
.HAVE_SYS_RESOURCE_H = 1,
.HAVE_SYS_STAT_H = 1,
.HAVE_SYS_SYSCTL_H = 1,
.HAVE_SYS_TIMES_H = 1,
.HAVE_SYS_TIME_H = 1,
.HAVE_SYS_TYPES_H = 1,
.HAVE_TIMES = 1,
.HAVE_UINT_LEAST32_T = 1,
.HAVE_UNISTD_H = 1,
.HAVE_VSNPRINTF = 1,
.LSYM_PREFIX = "L",
.LT_OBJDIR = ".libs/",
.PACKAGE = "gmp",
.PACKAGE_BUGREPORT = "[email protected], see https://gmplib.org/manual/Reporting-Bugs.html",
.PACKAGE_NAME = "GNU MP",
.PACKAGE_STRING = "GNU MP 6.2.1",
.PACKAGE_TARNAME = "gmp",
.PACKAGE_URL = "http://www.gnu.org/software/gmp/",
.PACKAGE_VERSION = "6.2.1",
.RETSIGTYPE = null,
.SIZEOF_MP_LIMB_T = 8,
.SIZEOF_UNSIGNED = 4,
.SIZEOF_UNSIGNED_LONG = 8,
.SIZEOF_UNSIGNED_SHORT = 2,
.SIZEOF_VOID_P = 8,
.STDC_HEADERS = 1,
.TIME_WITH_SYS_TIME = 1,
.TUNE_SQR_TOOM2_MAX = "SQR_TOOM2_MAX_GENERIC",
.VERSION = "6.2.1",
.WANT_FFT = 1,
.WANT_TMP_ALLOCA = 1,
.YYTEXT_POINTER = 1,
.restrict = .__restrict,
.AC_APPLE_UNIVERSAL_BUILD = null,
.HAVE_ATTR_GET = null,
.HAVE_CALLING_CONVENTIONS = null,
.HAVE_CPUTIME = null,
.HAVE_DOUBLE_IEEE_BIG_ENDIAN = null,
.HAVE_DOUBLE_IEEE_LITTLE_SWAPPED = null,
.HAVE_DOUBLE_VAX_D = null,
.HAVE_DOUBLE_VAX_G = null,
.HAVE_DOUBLE_CRAY_CFP = null,
.HAVE_GETSYSINFO = null,
.HAVE_HIDDEN_ALIAS = null,
.HAVE_HOST_CPU_FAMILY_alpha = null,
.HAVE_HOST_CPU_FAMILY_m68k = null,
.HAVE_HOST_CPU_FAMILY_power = null,
.HAVE_HOST_CPU_FAMILY_powerpc = null,
.HAVE_HOST_CPU_FAMILY_x86 = null,
.HAVE_HOST_CPU_FAMILY_x86_64 = null,
.HAVE_HOST_CPU_alphaev67 = null,
.HAVE_HOST_CPU_alphaev68 = null,
.HAVE_HOST_CPU_alphaev7 = null,
.HAVE_HOST_CPU_m68020 = null,
.HAVE_HOST_CPU_m68030 = null,
.HAVE_HOST_CPU_m68040 = null,
.HAVE_HOST_CPU_m68060 = null,
.HAVE_HOST_CPU_m68360 = null,
.HAVE_HOST_CPU_powerpc604 = null,
.HAVE_HOST_CPU_powerpc604e = null,
.HAVE_HOST_CPU_powerpc750 = null,
.HAVE_HOST_CPU_powerpc7400 = null,
.HAVE_HOST_CPU_supersparc = null,
.HAVE_HOST_CPU_i386 = null,
.HAVE_HOST_CPU_i586 = null,
.HAVE_HOST_CPU_i686 = null,
.HAVE_HOST_CPU_pentium = null,
.HAVE_HOST_CPU_pentiummmx = null,
.HAVE_HOST_CPU_pentiumpro = null,
.HAVE_HOST_CPU_pentium2 = null,
.HAVE_HOST_CPU_pentium3 = null,
.HAVE_HOST_CPU_pentium4 = null,
.HAVE_HOST_CPU_core2 = null,
.HAVE_HOST_CPU_nehalem = null,
.HAVE_HOST_CPU_westmere = null,
.HAVE_HOST_CPU_sandybridge = null,
.HAVE_HOST_CPU_ivybridge = null,
.HAVE_HOST_CPU_haswell = null,
.HAVE_HOST_CPU_broadwell = null,
.HAVE_HOST_CPU_skylake = null,
.HAVE_HOST_CPU_silvermont = null,
.HAVE_HOST_CPU_goldmont = null,
.HAVE_HOST_CPU_k8 = null,
.HAVE_HOST_CPU_k10 = null,
.HAVE_HOST_CPU_bulldozer = null,
.HAVE_HOST_CPU_piledriver = null,
.HAVE_HOST_CPU_steamroller = null,
.HAVE_HOST_CPU_excavator = null,
.HAVE_HOST_CPU_zen = null,
.HAVE_HOST_CPU_bobcat = null,
.HAVE_HOST_CPU_jaguar = null,
.HAVE_HOST_CPU_s390_z900 = null,
.HAVE_HOST_CPU_s390_z990 = null,
.HAVE_HOST_CPU_s390_z9 = null,
.HAVE_HOST_CPU_s390_z10 = null,
.HAVE_HOST_CPU_s390_z196 = null,
.HAVE_HOST_CPU_s390_zarch = null,
.HAVE_INVENT_H = null,
.HAVE_LIMB_BIG_ENDIAN = null,
.HAVE_MACHINE_HAL_SYSINFO_H = null,
.HAVE_NATIVE_mpn_add_n_sub_n = null,
.HAVE_NATIVE_mpn_addaddmul_1msb0 = null,
.HAVE_NATIVE_mpn_addlsh_n = null,
.HAVE_NATIVE_mpn_addlsh1_nc = null,
.HAVE_NATIVE_mpn_addlsh2_nc = null,
.HAVE_NATIVE_mpn_addlsh_nc = null,
.HAVE_NATIVE_mpn_addlsh1_n_ip1 = null,
.HAVE_NATIVE_mpn_addlsh2_n_ip1 = null,
.HAVE_NATIVE_mpn_addlsh_n_ip1 = null,
.HAVE_NATIVE_mpn_addlsh1_nc_ip1 = null,
.HAVE_NATIVE_mpn_addlsh2_nc_ip1 = null,
.HAVE_NATIVE_mpn_addlsh_nc_ip1 = null,
.HAVE_NATIVE_mpn_addlsh1_n_ip2 = null,
.HAVE_NATIVE_mpn_addlsh2_n_ip2 = null,
.HAVE_NATIVE_mpn_addlsh_n_ip2 = null,
.HAVE_NATIVE_mpn_addlsh1_nc_ip2 = null,
.HAVE_NATIVE_mpn_addlsh2_nc_ip2 = null,
.HAVE_NATIVE_mpn_addlsh_nc_ip2 = null,
.HAVE_NATIVE_mpn_addmul_1c = null,
.HAVE_NATIVE_mpn_addmul_2 = null,
.HAVE_NATIVE_mpn_addmul_3 = null,
.HAVE_NATIVE_mpn_addmul_4 = null,
.HAVE_NATIVE_mpn_addmul_5 = null,
.HAVE_NATIVE_mpn_addmul_6 = null,
.HAVE_NATIVE_mpn_addmul_7 = null,
.HAVE_NATIVE_mpn_addmul_8 = null,
.HAVE_NATIVE_mpn_addmul_2s = null,
.HAVE_NATIVE_mpn_div_qr_1n_pi1 = null,
.HAVE_NATIVE_mpn_div_qr_2 = null,
.HAVE_NATIVE_mpn_divexact_1 = null,
.HAVE_NATIVE_mpn_divexact_by3c = null,
.HAVE_NATIVE_mpn_divrem_1 = null,
.HAVE_NATIVE_mpn_divrem_1c = null,
.HAVE_NATIVE_mpn_divrem_2 = null,
.HAVE_NATIVE_mpn_gcd_1 = null,
.HAVE_NATIVE_mpn_lshsub_n = null,
.HAVE_NATIVE_mpn_mod_1 = null,
.HAVE_NATIVE_mpn_mod_1_1p = null,
.HAVE_NATIVE_mpn_mod_1c = null,
.HAVE_NATIVE_mpn_mod_1s_2p = null,
.HAVE_NATIVE_mpn_mod_1s_4p = null,
.HAVE_NATIVE_mpn_modexact_1_odd = null,
.HAVE_NATIVE_mpn_modexact_1c_odd = null,
.HAVE_NATIVE_mpn_mul_2 = null,
.HAVE_NATIVE_mpn_mul_3 = null,
.HAVE_NATIVE_mpn_mul_4 = null,
.HAVE_NATIVE_mpn_mul_5 = null,
.HAVE_NATIVE_mpn_mul_6 = null,
.HAVE_NATIVE_mpn_mul_basecase = null,
.HAVE_NATIVE_mpn_mullo_basecase = null,
.HAVE_NATIVE_mpn_preinv_divrem_1 = null,
.HAVE_NATIVE_mpn_preinv_mod_1 = null,
.HAVE_NATIVE_mpn_redc_1 = null,
.HAVE_NATIVE_mpn_redc_2 = null,
.HAVE_NATIVE_mpn_rsblsh_n = null,
.HAVE_NATIVE_mpn_rsblsh1_nc = null,
.HAVE_NATIVE_mpn_rsblsh2_nc = null,
.HAVE_NATIVE_mpn_rsblsh_nc = null,
.HAVE_NATIVE_mpn_rsh1add_nc = null,
.HAVE_NATIVE_mpn_rsh1sub_nc = null,
.HAVE_NATIVE_mpn_sbpi1_bdiv_r = null,
.HAVE_NATIVE_mpn_sqr_basecase = null,
.HAVE_NATIVE_mpn_sqr_diagonal = null,
.HAVE_NATIVE_mpn_sublsh_n = null,
.HAVE_NATIVE_mpn_sublsh1_nc = null,
.HAVE_NATIVE_mpn_sublsh2_nc = null,
.HAVE_NATIVE_mpn_sublsh_nc = null,
.HAVE_NATIVE_mpn_sublsh1_n_ip1 = null,
.HAVE_NATIVE_mpn_sublsh2_n_ip1 = null,
.HAVE_NATIVE_mpn_sublsh_n_ip1 = null,
.HAVE_NATIVE_mpn_sublsh1_nc_ip1 = null,
.HAVE_NATIVE_mpn_sublsh2_nc_ip1 = null,
.HAVE_NATIVE_mpn_sublsh_nc_ip1 = null,
.HAVE_NATIVE_mpn_submul_1c = null,
.HAVE_NATIVE_mpn_tabselect = null,
.HAVE_NATIVE_mpn_udiv_qrnnd = null,
.HAVE_NATIVE_mpn_udiv_qrnnd_r = null,
.HAVE_NATIVE_mpn_umul_ppmm = null,
.HAVE_NATIVE_mpn_umul_ppmm_r = null,
.HAVE_OBSTACK_VPRINTF = null,
.HAVE_PSP_ITICKSPERCLKTICK = null,
.HAVE_PSTAT_GETPROCESSOR = null,
.HAVE_READ_REAL_TIME = null,
.HAVE_SIGSTACK = null,
.HAVE_SPEED_CYCLECOUNTER = null,
.HAVE_SSTREAM = null,
.HAVE_STD__LOCALE = null,
.HAVE_SYSSGI = null,
.HAVE_SYS_ATTRIBUTES_H = null,
.HAVE_SYS_IOGRAPH_H = null,
.HAVE_SYS_PROCESSOR_H = null,
.HAVE_SYS_PSTAT_H = null,
.HAVE_SYS_SYSINFO_H = null,
.HAVE_SYS_SYSSGI_H = null,
.HAVE_SYS_SYSTEMCFG_H = null,
.HOST_DOS64 = null,
.NO_ASM = null,
.SSCANF_WRITABLE_INPUT = null,
.WANT_ASSERT = null,
.WANT_FAKE_CPUID = null,
.WANT_FAT_BINARY = null,
.WANT_OLD_FFT_FULL = null,
.WANT_PROFILING_GPROF = null,
.WANT_PROFILING_INSTRUMENT = null,
.WANT_PROFILING_PROF = null,
.WANT_TMP_REENTRANT = null,
.WANT_TMP_NOTREENTRANT = null,
.WANT_TMP_DEBUG = null,
.WORDS_BIGENDIAN = null,
.X86_ASM_MULX = null,
.@"inline" = null,
.@"volatile" = null,
});

// TODO: Finish this
const gmp_h = b.addConfigHeader(.{
.style = .{
Expand All @@ -357,7 +35,6 @@ pub fn build(b: *std.Build) void {
.CFLAGS = "-O2 -pedantic -march=armv8-a",
});

lib.addConfigHeader(config_h);
lib.addConfigHeader(gmp_h);

// Static headers
Expand Down Expand Up @@ -685,6 +362,7 @@ const x86_64_linux_asm_sources = [_][]const u8{
"gen/x86_64-linux/mpn/mul_2.s",
"gen/x86_64-linux/mpn/mul_basecase.s",
"gen/x86_64-linux/mpn/mullo_basecase.s",
"gen/x86_64-linux/mpn/mulmid_basecase.s",
"gen/x86_64-linux/mpn/nand_n.s",
"gen/x86_64-linux/mpn/nior_n.s",
"gen/x86_64-linux/mpn/popcount.s",
Expand All @@ -703,7 +381,6 @@ const x86_64_linux_asm_sources = [_][]const u8{
"gen/x86_64-linux/mpn/sub_err3_n.s",
"gen/x86_64-linux/mpn/sub_n.s",
"gen/x86_64-linux/mpn/sublsh1_n.s",
"gen/x86_64-linux/mpn/sublsh2_n.s",
"gen/x86_64-linux/mpn/submul_1.s",
"gen/x86_64-linux/mpn/xnor_n.s",
"gen/x86_64-linux/mpn/xor_n.s",
Expand Down
Loading
Loading