Skip to content

Latest commit

 

History

History
545 lines (423 loc) · 37.2 KB

2023-06-01.en.md

File metadata and controls

545 lines (423 loc) · 37.2 KB

This Month in PLCT: Issue 46 (June 1, 2023)

Preface

May has been a monumental month for the PLCT Lab. Last month, three of our members presented at the EuroLLVM 2023 conference in Glasgow, Scottland. This has been PLCT's first trip abroad. Another item of note is that we have officially announced "RUYISDK," our official WeChat outlet. In the future, you will find coverage on our products, developer profiles, and more.

In June, we will hold our first RuyiSDK Open Day 如意开放日, where we will share development progression on our SDK components. Event schedules and registration information will be available on the "RUYISDK" page.

Featured Items

V8 for RISC-V

Backported upstream patches:

  1. 4553932: [riscv][masm] Improve Instance Type Checks in Builtins::Call/Construct | https://chromium-review.googlesource.com/c/v8/v8/+/4553932
  2. 4541408: [riscv] Unify pointer size | https://chromium-review.googlesource.com/c/v8/v8/+/4541408
  3. 4543857: [riscv][static-roots]Port static-root | https://chromium-review.googlesource.com/c/v8/v8/+/4543857
  4. 4525059: [riscv] Implement probe mmu mode | https://chromium-review.googlesource.com/c/v8/v8/+/4525059
  5. 4541402: [riscv] Support acq/rel accesses and atomic accesses on tagged | https://chromium-review.googlesource.com/c/v8/v8/+/4541402
  6. 4521076: [riscv]Enable caged heap | https://chromium-review.googlesource.com/c/v8/v8/+/4521076
  7. 4505078: [riscv][builtins] Remake Api callback thunk wrappers calling convention | https://chromium-review.googlesource.com/c/v8/v8/+/4505078

OpenJDK Upstreaming (RV64)

OpenJDK Upstreaming (Zhang Dingli [张定立])

  • Submitted and merged JDK-mainline patches.
    • openjdk/jdk#13862 | (8307609: RISC-V: Added support for Extract, Compress, Expand and other nodes for Vector API)(as co-authur)
    • openjdk/jdk#14138 | (8308817: RISC-V: Support VectorTest node for Vector API )(as co-authur)
    • openjdk/jdk#14166 | (8308915: RISC-V: Improve temporary vector register usage avoiding the use of v0)
    • openjdk/jdk#14197 | (8308997: RISC-V: Sign extend when comparing 32-bit value with zero instead of testing the sign bit)(as co-authur)
  • Backport jdk17u:

OpenJDK Upstreaming (Cao Gui [曹贵])

  • Upstreamed patches.
    • openjdk/jdk#13862 | (8307609: RISC-V: Added support for Extract, Compress, Expand and other nodes for Vector API)(as co-author)
    • openjdk/jdk#14138 | (8308817: RISC-V: Support VectorTest node for Vector API )(as co-author)
    • openjdk/jdk#14197 | (8308997: RISC-V: Sign extend when comparing 32-bit value with zero instead of testing the sign bit)(as co-author)
  • Backported patches for the riscv-port-jdk17u repo.

OpenJDK8 Porting (Zhang Xiang [章翔])

No update this month.

Clang/LLVM RISC-V Porting

You may find more of our code review by searching under the names of the authors above.

gollvm

All patches were updated or revised, awaiting next round of review.

GNU Toolchain

Arch Linux for RISC-V

Porting Progress

[core] 257 / 264 (97.34%) [extra] 12185 / 13244 (92.00%)

Get in Touch

Important Changes

  • Finished merging community into extra
  • Enabled several kernel configs to support All Winner D1
  • Lichee Pi 4a image and rootfs link 1
    • Note that this file's designed usage is to replace the inner rootfs provided by this image: link 2
fastboot flash ram uboot.bin
fastboot reboot
fastboot flash uboot uboot.bin
fastboot flash boot boot.ext4
fastboot flash root rootfs.ext4  # <-- only this file is from the first link

Upstreamed Work

  • glibc: [PATCH v3] riscv: Add macros for FPUCW/fcsr in fpu_control.h link
  • gcc: [RFC PATCH] driver: unfilter default library path [PR 104707] link
  • qemu: linux-user: Add some ioctls for mesa amdgpu support link
    • tutorial for running graphic softwares inside qemu-user with AMD Radeom Graphic Card: link
  • gnu-efi: CHAR8 needs to be defined; BOOLEAN does not need to be defined here link
  • box64: riscv64 support (4 PRs by xctan @ Arch Linux RISC-V) (Please refer to #Box64 section)
  • rust: Bump cc for bootstrap link
  • libopenshot:
    • Fix Frame::GetSamplesPerFrame when channels = 0 link
    • Fix Stabilize_Video test for platforms that doesn't use fast color space conversion link
  • napi-rs:
    • feat(target): add support for riscv64gc-unknown-linux-gnu link
    • docs(README): update platform support status link
  • lychee: test(client): make exponential_backoff better link
  • alt-pytest-asyncio: test: fix flaky test on slow machines link
  • jumpy: build: upgrade mimalloc to 0.1.36. link
  • JuPyMake: Split compiler flags by whitespace. link
  • pyalpm: test: fix test_db_{grpcache_pkg_segfault,read_grp} link
  • syscalls:
    • Add RISC-V support link
    • Add fetch for arch-specific syscalls link
  • nix: Add implementation of PTRACE_{GET,SET}REGSET link
  • plz: Add riscv64 support link

Gentoo for RISC-V

Stats: 7810/18757, 41.64% (https://whale.plctlab.org/riscv/support-statistics/)

Nixpkgs for RISC-V

Firefox (SpiderMonkey) for RV64GCV

  1. https://phabricator.services.mozilla.com/D177449
  2. https://phabricator.services.mozilla.com/D178616
  3. https://bugzilla.mozilla.org/show_bug.cgi?id=1831496

DynamoRIO for RV64GC

This month, we worked predominantly on RV64-related infrastructures, but programs still do not run. We aim to see Hello World running on DynamoRIO in the coming month.

Merged pull requests:

Pending pull requests:

OpenCV for RISC-V

[WIP] Automated OpenCV Universal Intrinsic code migrator for the RVV backend.

LIBCXX Experimental/simd

LuaJIT for RV64G

This month, we focused our work on JIT tracing. We tuned the trace number handling scheme and revamped the exit number handler. Additionally, the interpreter has received some adjustments and the IR assembler has picked up many fixes.

gem5

  • Added the vcompress instruction.
  • Added the vle8ff.v, vle16ff.v, vle32ff.v, and vle64ff.v instructions.
  • Fixed a bug in the makeWriter function.

At the time of writing, we have implemented all RISC-V vector instructions, with the exception of segment load/restore. You may find our work-in-progress code at the plct-gem5 repository's rvv-cpu branch for testing and feedback.

Spike

Updated BF16 support to v0.6.0, riscv-software-src/riscv-isa-sim#1321

QEMU

box64

This month, we continued to improve the dynamic recompiler for the RV64 JIT backend and continued work on abstraction libraries. We care pleased to report that the RV64 backend is now usable! As we get closer to a new release, the box64 author also wrote a report on the forthcoming RISC-V support.

Upstreamed pull requests.

Other Support for RISC-V International

SAIL/ACT

OpenArkCompiler Community

Shi Ninging (史宁宁) continues to work on compiling the OpenArkCompiler Weekly, which just published its 163th issue.

You may find new weekly issues of the OpenArkCompiler Weekly on Sundays on...

MLIR

PLCT MLIR @ EuroLLVM 2023

EuroLLVM 2023 (https://llvm.swoogo.com/2023eurollvm)

  • Buddy Compiler: An MLIR-based Compilation Framework for Deep Learning Co-design (Speaker: Hongbin Zhang)
  • RISC-V Vector Extension Support in MLIR: Motivation, Abstraction, and Application (Speaker: Hongbin Zhang)
  • Buddy-CAAS: Compiler As A Service for MLIR (Speaker: Hongbin Zhang)
  • Image Processing Ops as first class citizens in MLIR: write once, vectorise everywhere! (Speaker: Prathamesh Tagore)

Upstream Work

Proposed a unified RRV and ARM SVE vectorization design with the following observations:

MLIR Sparsity

Buddy Compiler

buddy-caas

Buddy Compiler As A Service(Buddy-CAAS)- https://buddy.isrc.ac.cn/

  • Supports x86 and RISC-V backends, as well as quick code verification and testing across multiple backends.
  • Added support for more use cases, each with default Pass Pipeline and configuration support.

buddy-mlir

Code repository: https://github.com/buddy-compiler/buddy-mlir

  • Added buddy-lsp-server.
  • Added support for Fast Fourier Transform.
  • Added an one-step building method.

buddy-benchmark

Code repository: https://github.com/buddy-compiler/buddy-benchmark

  • Added the linpackc vectorization benchmark.

Chisel/FIRRTL (CAAT)

  • Completed preliminary design for RISC-V Vector long vector RTL and commenced review in reference to Buddy Compiler use cases.
  • Submitted revision suggestions for Land and LSU bottlenecks, began work on refactoring Lane.
  • Commenced work on Chisel-CIRCT bind using MLIR C-API and jextract.

coreboot for riscv

No update this month.

openocd

No update this month.

opensbi

u-boot

No update this month.

Aya Theorem Prover

Watch Aya Prover

Watch Aya VSCode

Watch Aya Intellij Plugin

eBPF

RISC-V Platform Evaluation

This month, we improved our SPEC CPU automation scripts, which is now able to download and build specific GCC/LLVM versions, run SPEC CPU2017 tests, and output benchmark results. Moreover, for SPEC CPU tuning, we began to survey impact of all compiler flags used by SPEC2017 to help improve results. Do achieve this, we used a script to collect all compiler flags used and rank them by the frequency on which they were used.

  1. SPEC CPU automation script.

https://github.com/mollybuild/RISCV-Measurement/tree/master/scripts/Run-SPEC-CPU

  1. SPEC CPU2017 compiler flags survey.

Collection and sorting results, https://github.com/mollybuild/RISCV-Measurement/tree/master/scripts/getflags

The following image shows compiler flags used by SPEC CPU2017, sorted by frequency:

image

Testing and Development

  • Kernel CI deployment.
    • Implemented Unmatch and VisionFive jobs under LAVA.
    • Adapted kernelci-docker code and deployed Kernel CI frontend and backend databases.
    • Implemented interoperation between LAVA jobs and kernelci.
    • Implemented an automation script in Python to create lab and lab tokens using Kernel CI's backend API, https://github.com/jiewu-plct/kernel-ci/blob/main/creat-lab.py
    • Fixed an issue where logs could not be reviewed on the kernelci interface.
    • Fixed implicit token access via kernelci backend with LAVA jobs.
    • LTP syscalls use case now runs via LAVA on Unmatched.
    • Assembled documentation on deploying and using LAVA and Kernel CI, https://github.com/jiewu-plct/kernel-ci
  • Automation scripts.

Useful Links