Bug 238008

Summary: [RISC-V] Support the C (compressed instructions) standard extension
Product: WebKit Reporter: Zan Dobersek <zan>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 237775    

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>