frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

A glimpse into V8 development for RISC-V

https://riseproject.dev/2025/12/09/a-glimpse-into-v8-development-for-risc-v/
45•floitsch•22h ago

Comments

brucehoult•4w ago
Quote, because unlike on Reddit I couldn't figure out how to do multi para > quotes with code here.

------

Compressed pointers reduce the need for memory by storing pointers as 32-bit unsigned offsets relative to a base register. Decompressing the pointers just consists of adding the offset and register together. As simple as this sounds, it comes with a small complication on our RISC-V 64-bit port. By construction, 32-bit values are always loaded into the 64-bit registers as signed values. This means that we need to zero-extend the 32-bit offset first. Until recently this was done by bit-anding the register with 0xFFFF_FFFF:

    li   t3,1
    slli t3, t3, 32
    addi t3, t3, -1
    and  a0, a0, t3
Now, this code uses the `zext.w` instruction from the Zba extension:

    zext.w a0, a0
-----

This is so strange. Does no one at Google know RISC-V? This has *never* needed more than...

    slli a0, a0, 32
    srli a0, a0, 32
And if they're going to use `Zba`, and zero-extend it and then add it to another register, then why use a separate `zext.w` instruction and `add` instead of ...

    add.uw decompressed, compressed, base
... to zero extend and add in one instruction??

After all, `zext.w` is just an alias for `add.uw` with the `zero` register as the last argument...

They also could have always simply stored the 32 bit offset as signed and pointed the base register 2GB into the memory area instead of using x86/Arm-centric design.

spankalee•20h ago
> Does no one at Google know RISC-V?

These are not current Googlers.

floitsch•4h ago
You are absolutely right, and a follow-up CL fixed the non-Zba code path. At the time of writing of the blog post, the generated code was however still using the 4 instructions instead of just two.

V8 is a huge project and ports almost have to start from backends of existing architectures. Over time we (I recently worked on the RISC-V port) improve the situation.

Note that it's also crucial to stay somehow similar to the x86 and ARM backends as the V8 team frequently makes changes to these and keeping up with them would be a nightmare if the RISC-V backend was too different.

"Does no one at Google know RISC-V" This work wasn't done by Google. Also, you don't hire RISC-V experts, but V8 experts (or other similar VMs) for such a port. I, for example, had never worked with RISC-V before. As such, it can happen that some code of the RISC-V backend is written by engineers that aren't yet experts in RISC-V.

dzaima•3h ago
And, even if not that, the 0x0000_0000_FFFF_FFFF constant could be generated via 2 instrs of

    li    a0, -1
    srli  a0, a0, 32
That said, codegen of constants in RISC-V is a whole insane crazy art-form to do well (especially for a JIT where "try a hundred different strategies" means slow compilation), all to have the hardware rediscover what was already perfectly-known in the first place. (granted, there's a size benefit in cases where there is a good compact form)
jhallenworld•1h ago
>V8 emits a near-jump for all forward jumps. If the target ends up too far away, the near-jump target is adjusted to a jump pool entry that contains a long-jump to the actual target

This sounds weird to me... Why not assume that all jumps need to be long to start with (so that the code is valid), then relax them to short jumps during an N-pass optimization stage- so that you get the smallest possible code?

The AI Econ Seminar

https://cameron.stream/blog/econ-seminar/
1•forthwall•4m ago•0 comments

CSIS: What Just Happened in Venezuela? and What Comes Next?

https://www.youtube.com/watch?v=Fp24V1Ygn04
1•stopbulying•8m ago•0 comments

Greg and the Eternal Brunch – A Philosophy Fairy Story

https://lagomor.ph/2025/02/greg-the-eternal-brunch/
1•ChilledTonic•8m ago•0 comments

Show HN: Titan AI Explore – A curated hub for AI tools, tutorials, and projects

https://www.titanaiexplore.com/
1•chynnahe•8m ago•0 comments

Darwin-photos: Back up iCloud Photos without bloating your Mac

https://github.com/cleanexit0/darwin-photos
1•cleanexit0•10m ago•0 comments

Don't be fooled – everything has changed for the global economy

https://www.ft.com/content/9c8212b8-568f-4ea2-829a-9b7a13b93f1d
1•petethomas•17m ago•1 comments

Z-Image-Base renamed to "Z-Image-Omni-Base" – gen+edit model from Alibaba

https://old.reddit.com/r/ZImageAI/comments/1pm66e6/not_zimagebase_but_zimageomnibase/
1•nmr521521•17m ago•0 comments

Finding high signal people – applying PageRank to Twitter

https://thefourierproject.org/people
1•jfg0•21m ago•0 comments

Urban Surveillance

https://computer.rip/2025-12-26-Flock-and-Urban-Surveillance.html
2•firloop•21m ago•0 comments

Show HN: Cymatica.app

https://www.cymatica.app/
1•_august•24m ago•0 comments

Patterns in deterministic settlement/dispute con in P2P/oracle-resolved systems?

1•Lions2026•26m ago•0 comments

The Monroe Doctrine After 200 Years: Strategic Hinge Period in US History (2023)

https://americandiplomacy.web.unc.edu/2023/08/the-monroe-doctrine-after-200-years-a-strategic-hin...
1•walterbell•29m ago•3 comments

Show HN: Knowing What Matters is coNP-complete (Lean 4 formalized)

https://zenodo.org/records/18140966
1•trissim•32m ago•0 comments

The most popular Go dependency is

https://blog.thibaut-rousseau.com/blog/the-most-popular-go-dependency-is/
1•thunderbong•33m ago•0 comments

AI Is Plastic

https://stephen.bochinski.dev/blog/2026/01/07/ai-is-plastic/
2•sbochins•35m ago•0 comments

Ask HN: Any Perler bead / pixel art hobbyists? Looking for feedback

https://www.perlerbeadpattern.com/
1•pacewang•38m ago•0 comments

AI browsers are straight out of the enshittification playbook

https://www.coryd.dev/posts/2025/ai-browsers-are-straight-out-of-the-enshittification-playbook
4•cdrnsf•45m ago•0 comments

Larry Page is moving business out of CA ahead of a proposed billionaire's tax

https://www.businessinsider.com/larry-page-leave-california-wealth-billionaire-tax-koop-google-20...
4•Alupis•47m ago•4 comments

The game that knows when you're not paying attention

https://patternrecall.vercel.app/
1•mshubham•48m ago•0 comments

Smothering Heights – JP Morgan Asset Management Outlook 2026

https://am.jpmorgan.com/us/en/asset-management/institutional/insights/market-insights/eye-on-the-...
1•prisenco•50m ago•0 comments

Show HN: Graph:Easy ported to TypeScript with GPT-5.2

https://tomisin.space/graph-easy-ts/
1•AntiRush•52m ago•0 comments

Kernel bugs hide for 2 years on average. Some hide for 20

https://pebblebed.com/blog/kernel-bugs
32•kmavm•55m ago•5 comments

Show HN: SludgeReport.io – like that other site but AI, Tech, Startup News

https://sludgereport.io/
1•stets•1h ago•2 comments

PMU Counters on Apple Silicon

https://blog.bugsiki.dev/posts/apple-pmu/
3•signa11•1h ago•0 comments

SimilarWeb: Gen AI Website Traffic Share 2026 Jan [pdf]

https://www.similarweb.com/corp/wp-content/uploads/2026/01/attachment-Global-AI-Tracker-6.pdf
1•shenli3514•1h ago•1 comments

Vison Awards 2025 – Architizer

https://architizer.com/blog/tag/vision-awards/
1•sargstuff•1h ago•0 comments

The Anatomy of an Outstanding AI-Assisted Rendering

https://architizer.com/blog/inspiration/stories/anatomy-of-an-ai-assisted-rendering/
1•sargstuff•1h ago•0 comments

OpenAI Would Like You to Share Your Health Data with ChatGPT

https://www.scientificamerican.com/article/openai-would-like-you-to-share-your-health-data-with-i...
5•geox•1h ago•1 comments

Show HN: Ark Portfolio Tracker – Visualizing Cathie Wood's Holdings

https://www.13radar.com/guru/catherine-wood
1•PanicSellGuru•1h ago•0 comments

Inside An LLM

1•TimeForAChange•1h ago•0 comments