Title: [280173] trunk/Source/WTF
Revision
280173
Author
[email protected]
Date
2021-07-22 04:48:39 -0700 (Thu, 22 Jul 2021)

Log Message

Add CPU(RISCV64)
https://bugs.webkit.org/show_bug.cgi?id=228178

Patch by Zan Dobersek <[email protected]> on 2021-07-22
Reviewed by Adrian Perez de Castro.

Detect when compiling for the RISC-V 64-bit architecture and define
the WTF_CPU_RISCV64 macro under that condition, enabling use of
CPU(RISCV64) build guards.

* wtf/PageBlock.h: Use 4 kB as the page size ceiling for CPU(RISCV64).
* wtf/PlatformCPU.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (280172 => 280173)


--- trunk/Source/WTF/ChangeLog	2021-07-22 10:54:07 UTC (rev 280172)
+++ trunk/Source/WTF/ChangeLog	2021-07-22 11:48:39 UTC (rev 280173)
@@ -1,3 +1,17 @@
+2021-07-22  Zan Dobersek  <[email protected]>
+
+        Add CPU(RISCV64)
+        https://bugs.webkit.org/show_bug.cgi?id=228178
+
+        Reviewed by Adrian Perez de Castro.
+
+        Detect when compiling for the RISC-V 64-bit architecture and define
+        the WTF_CPU_RISCV64 macro under that condition, enabling use of
+        CPU(RISCV64) build guards.
+
+        * wtf/PageBlock.h: Use 4 kB as the page size ceiling for CPU(RISCV64).
+        * wtf/PlatformCPU.h:
+
 2021-07-21  Miguel Gomez  <[email protected]>
 
         [GTK][WPE] Allow the user to configure the MemoryPressureHandler inside the web process

Modified: trunk/Source/WTF/wtf/PageBlock.h (280172 => 280173)


--- trunk/Source/WTF/wtf/PageBlock.h	2021-07-22 10:54:07 UTC (rev 280172)
+++ trunk/Source/WTF/wtf/PageBlock.h	2021-07-22 11:48:39 UTC (rev 280173)
@@ -48,7 +48,7 @@
 constexpr size_t CeilingOnPageSize = 16 * KB;
 #elif CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || CPU(UNKNOWN)
 constexpr size_t CeilingOnPageSize = 64 * KB;
-#elif OS(WINDOWS) || CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64)
+#elif OS(WINDOWS) || CPU(X86) || CPU(X86_64) || CPU(ARM) || CPU(ARM64) || CPU(RISCV64)
 constexpr size_t CeilingOnPageSize = 4 * KB;
 #else
 #error Must set CeilingOnPageSize in PageBlock.h when adding a new CPU architecture!

Modified: trunk/Source/WTF/wtf/PlatformCPU.h (280172 => 280173)


--- trunk/Source/WTF/wtf/PlatformCPU.h	2021-07-22 10:54:07 UTC (rev 280172)
+++ trunk/Source/WTF/wtf/PlatformCPU.h	2021-07-22 11:48:39 UTC (rev 280173)
@@ -277,6 +277,14 @@
 
 #endif /* ARM */
 
+/* CPU(RISCV64) - RISC-V 64-bit */
+#if    defined(__riscv) \
+    && defined(__riscv_xlen) \
+    && (__riscv_xlen == 64)
+#define WTF_CPU_RISCV64 1
+#define WTF_CPU_KNOWN 1
+#endif
+
 #if !CPU(KNOWN)
 #define WTF_CPU_UNKNOWN 1
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to