Bug 238008 - [RISC-V] Support the C (compressed instructions) standard extension
Summary: [RISC-V] Support the C (compressed instructions) standard extension
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 237775
  Show dependency treegraph
 
Reported: 2022-03-17 01:12 PDT by Zan Dobersek
Modified: 2022-03-24 01:12 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zan Dobersek 2022-03-17 01:12:03 PDT
The initial RISCV64 support is based on RV64I and RV32I instruction sets which impose instruction values that are 32 bits in size. Memory usage efficiency would improve with the adoption of compressed instructions as specified in the C standard extension, enabling generation of instructions that are only 16 bits wide. The spec is quite bullish:

```
Typically, 50%–60%
of the RISC-V instructions in a program can be replaced with RVC instructions, resulting in a
25%–30% code-size reduction.
```

The 32-bit instruction size was taken for granted with good effect in implementing linking and repatching on JIT code, so decoupling these assumptions will be some work.

Also, the extension is just that -- an extension. We need a solid way of detecting it at runtime and adjusting accordingly.
Comment 1 Radar WebKit Bug Importer 2022-03-24 01:12:15 PDT
<rdar://problem/90753189>