Pseiderer/add nios2 and xtensa 001 (#119)
* double-conversion: enable for nios2
Nios2 supports double conversion, tested using qemu:
./main || echo "correct"
correct
uname -a
Linux buildroot 4.19.16 #4 Sat Aug 3 14:46:48 CEST 2019 nios2 GNU/Linux
Solves build error
In file included from double-conversion.h:42:0,
from number_decimalquantity.cpp:19:
double-conversion-utils.h:119:2: error: #error Target architecture was not detected as supported by Double-Conversion.
#error Target architecture was not detected as supported by Double-Conversion.
detected by buildroot autobuilders:
http://autobuild.buildroot.net/results/91e/91eaec34708d91f8a05af189243be0b7cabce31b/
Patch sent upstream: https://github.com/unicode-org/icu/pull/725
Bug report: https://unicode-org.atlassian.net/browse/ICU-20751
[Bernd: Fixed path]
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
[Added Changelog entry]
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
* double-conversion: enable for xtensa
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
Note:
Double-conversion tested with:
$ cat div.c
double Div_double(double x, double y) { return x / y; }
$ cat main.c
double Div_double(double x, double y);
int main(int argc, char** argv) {
double result = Div_double(89255.0, 1e22);
if (result == 89255e-22) {
printf("correct result %e\n", result);
return 1;
} else {
printf("wrong result %e\n", result);
return 0;
}
}
Tested for xtensa (using qemu_xtensa_lx60_defconfig plus BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE):
$ ./host/bin/xtensa-buildroot-linux-uclibc-gcc -c div.c
$ ./host/bin/xtensa-buildroot-linux-uclibc-gcc -c main.c
$ ./host/bin/xtensa-buildroot-linux-uclibc-gcc -o main main.o div.o
$ ./host/bin/qemu-xtensa -L staging main
correct result 8.925500e-18
diff --git a/Changelog b/Changelog
index 5b54d54..b5ca3e8 100644
--- a/Changelog
+++ b/Changelog
@@ -1,3 +1,7 @@
+2019-10-31:
+ Add support for xtensa architecture.
+ Add support for nios2 architecture.
+
2019-10-12:
Really add support for microblaze. A previous commit was lacking
the necessary line.
diff --git a/double-conversion/utils.h b/double-conversion/utils.h
index 221467f..98ec28b 100644
--- a/double-conversion/utils.h
+++ b/double-conversion/utils.h
@@ -94,6 +94,7 @@
defined(__ARMEL__) || defined(__avr32__) || defined(_M_ARM) || defined(_M_ARM64) || \
defined(__hppa__) || defined(__ia64__) || \
defined(__mips__) || \
+ defined(__nios2__) || \
defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \
defined(__sparc__) || defined(__sparc) || defined(__s390__) || \
@@ -102,7 +103,7 @@
defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \
defined(__riscv) || defined(__e2k__) || \
defined(__or1k__) || defined(__arc__) || \
- defined(__microblaze__) || \
+ defined(__microblaze__) || defined(__XTENSA__) || \
defined(__EMSCRIPTEN__)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(__mc68000__) || \