nodejs/debian/patches/2017_mips_configure_fpu.patch

35 lines
801 B
Diff

Description: use configuration directive to set mips fpu mode
Author: YunQiang Su <wzssyqa@gmail.com>
Forwarded: https://github.com/paul99/v8m-rb/issues/192
Last-Update: 2015-09-29
--- a/deps/v8/src/base/cpu.cc
+++ b/deps/v8/src/base/cpu.cc
@@ -140,22 +140,11 @@
#if V8_HOST_ARCH_MIPS
int __detect_fp64_mode(void) {
- double result = 0;
- // Bit representation of (double)1 is 0x3FF0000000000000.
- __asm__ volatile(
- ".set push\n\t"
- ".set noreorder\n\t"
- ".set oddspreg\n\t"
- "lui $t0, 0x3FF0\n\t"
- "ldc1 $f0, %0\n\t"
- "mtc1 $t0, $f1\n\t"
- "sdc1 $f0, %0\n\t"
- ".set pop\n\t"
- : "+m"(result)
- :
- : "t0", "$f0", "$f1", "memory");
-
- return !(result == 1);
+#ifdef FPU_MODE_FP64
+ return 1;
+#else
+ return 0;
+#endif
}