use configuration directive to set mips fpu mode
authorYunQiang Su <wzssyqa@gmail.com>
Sun, 3 Dec 2023 21:41:14 +0000 (22:41 +0100)
committerJérémy Lal <kapouer@melix.org>
Sun, 3 Dec 2023 21:41:14 +0000 (22:41 +0100)
Forwarded: https://github.com/paul99/v8m-rb/issues/192
Last-Update: 2015-09-29

Gbp-Pq: Topic mips
Gbp-Pq: Name fpu.patch

deps/v8/src/base/cpu.cc

index 571a1b6a2c2779de9338c3017f26336c95bdef61..a4a7b6549bfd7ea1b1ffc8b0cc35232e95f4746b 100644 (file)
@@ -197,22 +197,11 @@ static uint32_t ReadELFHWCaps() {
 
 #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
 }