![]() |
|
|
#1 |
|
Dec 2016
1 Posts |
I'm attempting to compile mprime on an aarch64-based system and am running into some issues.
- Can you provide the source code for factor64.c so that it can be compiled for aarch64? - Can you provide guidance on where the fldcw and fnstcw instructions are being referenced when compiling gwnum? Presumably cctraipy.s is being generated in one of the compilation steps but I'm not seeing it. It appears as though mprime or some supporting libraries rely specifically on instructions that aren't available in the ARMv8 CPU architecture, specifically fnstcw and fldcw. Code:
root@aarch64-test:~/p95v2810/gwnum# make clean && make -f makeaarch64 gcc -I.. -DAARCH64 -O2 -c cpuid.c gcc -I.. -DAARCH64 -O2 -c gwnum.c gcc -I.. -DAARCH64 -O2 -c gwtables.c gcc -I.. -DAARCH64 -O2 -c gwthread.c gcc -I.. -DAARCH64 -O2 -c gwini.c gwini.c: In function ‘writeIniFile’: gwini.c:148:3: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] (void) _write (fd, buf, (unsigned int) strlen (buf)); ^ gcc -I.. -DAARCH64 -O2 -c gwutil.c g++ -I.. -I../qd -DAARCH64 -O2 -c gwdbldbl.cpp /tmp/cctraipy.s: Assembler messages: /tmp/cctraipy.s:4374: Error: unknown mnemonic `fnstcw' -- `fnstcw [x29,116]' /tmp/cctraipy.s:4383: Error: unknown mnemonic `fldcw' -- `fldcw [x29,118]' /tmp/cctraipy.s:4716: Error: unknown mnemonic `fldcw' -- `fldcw [x29,116]' /tmp/cctraipy.s:4928: Error: unknown mnemonic `fnstcw' -- `fnstcw [x29,52]' /tmp/cctraipy.s:4937: Error: unknown mnemonic `fldcw' -- `fldcw [x29,54]' /tmp/cctraipy.s:4998: Error: unknown mnemonic `fldcw' -- `fldcw [x29,52]' <snip> makeaarch64:32: recipe for target 'gwdbldbl.o' failed make: *** [gwdbldbl.o] Error 1 Code:
/usr/bin/ld: factor64.o: Relocations in generic ELF (EM: 62) factor64.o: error adding symbols: File in wrong format |
|
|
|
|
|
#2 |
|
(loop (#_fork))
Feb 2006
Cambridge, England
23·11·73 Posts |
The fnstcw and fldcw instructions manipulate the control word for the x87 FPU, to determine whether instructions will work in single, double or extended precision, as well as the rounding mode and the infinity control; the rounding mode is fairly critical for getting double-double-precision to work.
The instructions are generated in qd/dd.h around line 260 There is nothing analogous to the precision control in AArch64, though fiddling with the FPCR will let you set flush-to-zero, NaN propagation, and the rounding mode: Code:
MRS <Xt>, FPCR; Read FPCR into Xt MSR FPCR, <Xt>; Write Xt to FPCR |
|
|
|
|
|
#3 |
|
P90 years forever!
Aug 2002
Yeehaw, FL
11101011101112 Posts |
The rather harmless gwini.c warning should be fixed in 29.1 although source is not available yet.
Factor64.o is created from MASM source. I can give you the source code, but MASM only runs under windows. I then use Agner Fog's objconv program to convert from Windows COFF object file format to ELF file format. The easiest solution would be to see if there are any options in Agner Fog's program to create an object file you can use. In version 29.1, I've started using HJWasm which is an open source MASM replacement. Thus, in version 29.1 and later I can provide the MASM sources for you to assemble in a variety of environments. See if HJWasm works for you. If it does that provides us with a path forward. Version 29.1 also uses the hwloc library -- I don't know if a version of that library is available for your architecture. |
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compiling mfaktc on Mac OS X | dozba | GPU Computing | 23 | 2017-10-03 19:50 |
| Compiling GNFS sievers on AArch64 platform | wombatman | Programming | 11 | 2017-03-11 03:12 |
| compiling GMP-ECM | ATH | GMP-ECM | 69 | 2017-01-04 12:03 |
| compiling mprime | ATH | Software | 9 | 2015-02-15 12:59 |
| Compiling 24.14 | CBoland | Software | 6 | 2007-08-01 00:11 |