PLCT Lab

Compilers, Runtimes, and Emulators.

View on GitHub

This Month in PLCT: Issue 37 (September 1, 2022)

Preface

At the PLCT lab and the TAISIER team, we had a busy August preparing and hosting the second RISC-V Summit in China. Due to the ongoing pandemic, we have decided to hold the summit remotely, with over 12 sessions held concurrently in different cities in China. We would like to thank everyone for making this year’s summit our largest one yet and a successful example for concurrent sessions in different local venues.

Last month also saw significant growth in our TAISIER. We grew our roster to 20 full-time staff members, began work on a RISC-V port for a distro named OpenAnolis, awarded title to our first LV4 intern, and commenced work with our BJ67 operating system observation project with over 8 interns.

In September, the PLCT lab will experiment with building an > 1,024-node RISC-V cluster. We look forward to working with you in this new project.

V8 for RISC-V

General updates.

OpenJDK for RV32GC (Shi Ningning [史宁宁])

  1. Fix some reg num problems https://github.com/openjdk-riscv/jdk11u/pull/464
  2. clean the code in sharedRuntime_riscv32.cpp https://github.com/openjdk-riscv/jdk11u/pull/466
  3. rewrite the long_move() https://github.com/openjdk-riscv/jdk11u/pull/469
  4. Fix the bug of regname https://github.com/openjdk-riscv/jdk11u/pull/471
  5. change the relationship between j_rargx and c_rargx https://github.com/openjdk-riscv/jdk11u/pull/472
  6. Fix the instructions offset in vtableStubs_riscv32.cpp https://github.com/openjdk-riscv/jdk11u/pull/473
  7. Fix the instructs in riscv32.ad
    • Fix the subL_reg_reg https://github.com/openjdk-riscv/jdk11u/pull/474
    • Fix the mulL() https://github.com/openjdk-riscv/jdk11u/pull/475
    • Fix the loadConL https://github.com/openjdk-riscv/jdk11u/pull/476
    • Fix the divL/modL https://github.com/openjdk-riscv/jdk11u/pull/479
    • Fix the storeL and storeimmL0 https://github.com/openjdk-riscv/jdk11u/pull/480
    • Fix loadConD0 https://github.com/openjdk-riscv/jdk11u/pull/482
    • Fix the storeLConditional https://github.com/openjdk-riscv/jdk11u/pull/485
    • Fix the compareAndSwapL https://github.com/openjdk-riscv/jdk11u/pull/487
    • Fix the compareAndSwapLAcq() https://github.com/openjdk-riscv/jdk11u/pull/488
    • Fix the compareAndExchangeL https://github.com/openjdk-riscv/jdk11u/pull/489
    • Fix the compareAndExchangeLAcq https://github.com/openjdk-riscv/jdk11u/pull/490
    • Fix the weakCompareAndSwapL https://github.com/openjdk-riscv/jdk11u/pull/492
    • Fix the weakCompareAndSwapLAcq https://github.com/openjdk-riscv/jdk11u/pull/493
    • Fix the get_and_setI/F https://github.com/openjdk-riscv/jdk11u/pull/494
    • Fix the get_and_setIAcq/setLAcq https://github.com/openjdk-riscv/jdk11u/pull/495
  8. Improve the div system https://github.com/openjdk-riscv/jdk11u/pull/478
  9. Improve the code style of loadUS2L https://github.com/openjdk-riscv/jdk11u/pull/486
  10. Improve the xchg system https://github.com/openjdk-riscv/jdk11u/pull/496
  11. Improve the atomic_add system https://github.com/openjdk-riscv/jdk11u/pull/497
  1. JDK mainline regression testing on SiFive Unmatched.
    • Tier 1-3 tests clean.
    • Need more testing for Tier 4.
  2. Pull requests merged into mainline:
    • https://github.com/openjdk/jdk/pull/9766 (8291952: riscv: Remove PRAGMA_NONNULL_IGNORED)
    • https://github.com/openjdk/jdk/pull/9872 (8292338: aarch64: Use cbnz instruction in gen_continuation_enter when possible)
    • https://github.com/openjdk/jdk/pull/10079 (8293050: RISC-V: Remove redundant non-null assertions about macro-assembler)
  3. Pull requests approved/under review for mainline:
    • https://github.com/openjdk/jdk/pull/9770 (8291893: riscv: remove fence.i used in user space)
    • https://github.com/openjdk/jdk/pull/9763 (8291947: riscv: fail to build after JDK-8290840)
    • https://github.com/openjdk/jdk/pull/9889 (8292407: Improve Weak CAS VarHandle/Unsafe tests resilience under spurious failures)
    • https://github.com/openjdk/jdk/pull/9970 (8292713: Unsafe.allocateInstance should be intrinsified without UseUnalignedAccesses)
    • https://github.com/openjdk/jdk/pull/9889 (8292867: RISC-V: Simplify weak CAS return value handling)
    • https://github.com/openjdk/jdk/pull/10056 (8293007: riscv: failed to build after JDK-8290025)
    • https://github.com/openjdk/jdk/pull/9936 (8292575: riscv: Represent Registers as values)
    • https://github.com/openjdk/jdk/pull/10057 (8293011: riscv: Duplicated stubs to interpreter for static calls)
    • https://github.com/openjdk/jdk/pull/10075 (8293065: Zero build failure on AArch64 and RISCV64 after JDK-8293007)
    • https://github.com/openjdk/jdk/pull/10065 (8293035: Cleanup MacroAssembler::movoop code patching logic aarch64 riscv)
  4. JBS issues reported:
    • https://bugs.openjdk.org/browse/JDK-8292859 (test/hotspot/jtreg/gc/shenandoah/compiler/BarrierInInfiniteLoop.java timeouts after JDK-8292285)
  5. Sponsored pull requests to mainline:
    • https://github.com/openjdk/jdk/pull/9821 (8292187: aarch64: Remove duplicate header files)
    • https://github.com/openjdk/jdk/pull/10057 (8293011: riscv: Duplicated stubs to interpreter for static calls)
  6. Commits for the RV64 Loom port:
    • https://github.com/RealFYang/jdk/commit/48b13a13f19b38ba70e8e61c3739bdc659e7776c (riscv: Implement TemplateInterpreterGenerator::generate_Continuation_doYield_entry)
    • https://github.com/RealFYang/jdk/commit/f19e4ea5c3e4345e0f074c0d538ccbe1d5b2e956 (riscv: Implement gen_continuation_enter)
    • https://github.com/RealFYang/jdk/commit/e10bb9ecde9471950ae5d2c407474115ee71407f (riscv: Implement continuation_enter_setup, fill_continuation_entry and continuation_enter_cleanup)
    • https://github.com/RealFYang/jdk/commit/dc3d4c991d04f5c90fdada6c7b19b66477c3335e (Remove check_emit_size parameter from MacroAssembler::trampoline_call)
    • https://github.com/RealFYang/jdk/commit/f27df4a679e9298c1349d3e4a0a016fb4aea9bfd (Add new parameter check_emit_size for MacroAssembler::trampoline_call)
    • https://github.com/RealFYang/jdk/commit/d903bbc277f6f7f8f76f01acaa95a41c0c653a2c (Implement NativePostCallNop and NativeDeoptInstruction for riscv)
    • https://github.com/RealFYang/jdk/commit/01f4bc1e0f3c019eb0e2e48aedde5f0fa1a7fbd0 (Implement SmallRegisterMap for riscv)
    • https://github.com/RealFYang/jdk/commit/f19f79ef813e46fff809ab5b81ee592e4fde3293 (Implement stackChunkOopDesc::relativize_frame_pd and stackChunkOopDesc::derelativize_frame_pd for riscv)
    • https://github.com/RealFYang/jdk/commit/8a615c8bd45102689d5a0a471aef18c12f1625a3 (Implement LIRGenerator::do_continuation_doYield for riscv)
    • https://github.com/RealFYang/jdk/commit/5d2fe824e3f5c09bff940d67deef709716cb0d03 (Small refactoring for AbstractInterpreter::layout_activation)
  7. GHA support for RISC-V (based on Ubuntu 22.04):
    • https://github.com/openjdk/jdk/pull/10086 (8283929: GHA: Add RISC-V build config)

OpenJDK Upstreaming (Zhang Dingli [张定立])

OpenJDK Upstreaming (Cao Gui [曹贵])

OpenJDK8 Backporting (Zhang Xiang [章翔])

  1. Build support.
    • https://github.com/zhangxiang-plct/jdk8u/pull/1
    • https://github.com/zhangxiang-plct/jdk8u/pull/4
    • https://github.com/zhangxiang-plct/jdk8u/pull/5
    • Build routine, https://github.com/zhangxiang-plct/jdk8u/issues/2
  2. Build fixes.
    • https://github.com/zhangxiang-plct/jdk8u/pull/13
    • https://github.com/zhangxiang-plct/jdk8u/pull/14
    • https://github.com/zhangxiang-plct/jdk8u/pull/15
    • https://github.com/zhangxiang-plct/jdk8u/pull/17
    • https://github.com/zhangxiang-plct/jdk8u/pull/19
    • https://github.com/zhangxiang-plct/jdk8u/pull/20
    • https://github.com/zhangxiang-plct/jdk8u/pull/22
    • https://github.com/zhangxiang-plct/jdk8u/pull/23
    • https://github.com/zhangxiang-plct/jdk8u/pull/24
    • https://github.com/zhangxiang-plct/jdk8u/pull/26
    • https://github.com/zhangxiang-plct/jdk8u/pull/27
    • https://github.com/zhangxiang-plct/jdk8u/pull/29
    • https://github.com/zhangxiang-plct/jdk8u/pull/30

Clang/LLVM for RISC-V

gollvm

mold

Note: Further testing pending.

GNU Toolchain for RISC-V

AOSP for RISC-V

Arch Linux for RISC-V

Gentoo for RISC-V

Nixpkgs for RISC-V

Firefox (SpiderMonkey) on RV64GCV

With help from the V8 work group.

DynamoRIO RV64GC Enablement

Preliminary support for RV64GC implemented in DynamoRIO, which will now build on RV64GC (no additional feature supported).

Current five-stage road map for DyanmoRIO’s RV64GC support:

  1. Introduce RISC-V platform-specific functions, frameworks, definitions, etc., allowing DynamoRIO to build on RISC-V. (Done)
  2. Setup RISC-V CI for automated compilation and testing. (In Progress)
  3. Refine RISC-V platform-specific functions and definitions, make DynamoRIO’s built-in example tools functional.
  4. Refine RISC-V unit- and feature-tests, setup CI for automated testing and instruments for long-term maintenance.
  5. Continue RISC-V feature enablement for more complex programs, prepare for long-term maintenance.

See https://gist.github.com/bekcpear/7c9e710ee5b674888fcf5e5d8445dc16 for a more detailed to-do list.

OpenCV for RV64GCV

As part of our GSoC 2022 project, we are currently implementing a new Universal Intrinsic backend for RVV (RISC-V Vector), making the existing Universal Intrinsic framework compatible with scalable (variable-length) backends.

Previously, we have already finished implementing the aforementioned changes to the Universal Intrinsic framework. In August, we have implemented all platform-specific Universal Intrinsic functions and introduced respective unit tests and submitted relevant patches to upstream:

As a result, the new Universal Intrinsic backend for RVV not only supports variable register lengths, it also improves performance significantly over the original backend design, which had an issue where it generated redundant Load/Store instructions. As a next step, we plan to optimize hot-spot functions OpenCV’s image processing module and acquire RVV-enabled devices for performance testing.

For more details on this project:

Experimental SIMD in LIBCXX

LuaJIT RV64G porting

Our intern has unfortunated resigned. We are currently in search for a new intern.

gem5

Spike

QEMU

Other Support for RISC-V International

Please stay tuned.

SAIL/ACT

Please stay tuned.

OpenArkCompiler Community

Shi Ninging (史宁宁) continues to work on compiling the OpenArkCompiler Weekly, which received the 128th edition.

You may find new weekly editions of the OpenArkCompiler Weekly on Sundays on…

MLIR

Please stay tuned.

Upstream RVV Dialect Proposal

Google’s IREE partner Diego proposed an RFC for a generic Vector Masking Representation in MLIR, https://discourse.llvm.org/t/rfc-vector-masking-representation-in-mlir/64964

References

OSPP Mentorship

Buddy Compiler

Website

buddy-mlir

New features:

buddy-benchmark

New features:

Chisel / FIRRTL (CAAT Work Group)

coreboot for riscv

Please stay tuned.

openocd

opensbi

Submitted various patches to upstream.

U-Boot

The Aya Theorem Prover

👉View current pull requests here👈

You may find the full list of August changes here.

RISC-V Platform Evaluation

RVLab

  1. Created a frontend for RVLab’s hardware management platform using Vue.js.
    • Learning to make of Vue.js’ parent and child component functionalities - using value passing and function calls in various dialog interfaces.
    • Completed device distribution, device editing, relay listing, new/delete relays, and delete device pages in the hardware management interface.
    • Completed user management, user roles, role listing, new/delete roles, delete user pages.
    • Completed the User Profile interface, as well as a functional Change Password page.
    • Successfully deployed the RVLab hardware management platform locally on a Ubuntu 22.04 system using Dockerfile and docker compose. This platform will be deployed for production in a virtual machine. Due to the fact that the MQTT server was deployed in the RVLab’s internal network, the virtual machine will require both Internet and intranet access.
    • Revised Flask backend code to adapt to the Vue frontend.
  2. RVLab infrastructure provisioning.
    • Installed the latest Debian image on one Unmatched board.

openEuler for RISC-V

See TAISIER’s bi-weekly reports, https://github.com/isrc-cas/tarsier-oerv/

Debian for RISC-V

Now published in a bi-weekly format, please find these reports at the debian-riscv mailing list.