惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
V
V2EX
博客园 - 【当耐特】
Vercel News
Vercel News
雷峰网
雷峰网
爱范儿
爱范儿
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Azure Blog
Microsoft Azure Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
NISL@THU
NISL@THU
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Attack and Defense Labs
Attack and Defense Labs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
P
Proofpoint News Feed
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
Kaspersky official blog
I
InfoQ
Google Online Security Blog
Google Online Security Blog
L
LINUX DO - 最新话题
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
V
Visual Studio Blog
AI
AI
Schneier on Security
Schneier on Security
B
Blog RSS Feed
T
Tor Project blog
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Cyber Attacks, Cyber Crime and Cyber Security
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
V2EX - 技术
V2EX - 技术
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
Arctic Wolf
Webroot Blog
Webroot Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main

Hacker News

Introducing Claude Opus 4.7 Qwen Studio The Future of Everything is Lies, I Guess: Where Do We Go From Here? GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis Moving a large-scale metrics pipeline from StatsD to OpenTelemetry / Prometheus GitHub - Nightmare-Eclipse/RedSun: The Red Sun vulnerability repository GitHub - SethPyle376/hiraeth: Local AWS emulator focused on fast integration testing, with SQS support, SQLite-backed state, and a debug-friendly web UI. GitHub - macOS26/Agent: Any AI, replaces Claude Code, Cursor, OpenClaw. Over 18 LLM providers (Claude, OpenAI, Gemini, Ollama, Zai, HF, Qwen) wired into a native Mac app that writes code, builds Xcode projects, bumps versions, manages git, automates Safari, use AppleScript, JS or Accessibility, extend Agent! w/ MCP Servers, run tasks from your iPhone via Messages. YouTube now lets you turn off Shorts I Made a Terminal Pager Burgers | マクドナルド公式 Commands — HackerNews CLI documentation ChatGPT for Excel PiCore - Raspberry Pi Port of Tiny Core Linux Live Nation illegally monopolized ticketing market, jury finds Google Broke Its Promise to Me. Now ICE Has My Data. Founding Engineer at Adaptional | Y Combinator CRISPR takes important step toward silencing Down syndrome’s extra chromosome GitHub - saffron-health/libretto: The AI toolkit for building reliable browser automations US v. Heppner (S.D.N.Y. 2026) no attorney-client privilege for AI chats [pdf] Unexpected €54k billing spike in 13 hours: Firebase browser key without API restrictions used for Gemini requests Retrofitting JIT Compilers into C Interpreters IPv6 – Google The Accursèd Alphabetical Clock Cybersecurity Looks Like Proof of Work Now Fragments: April 14 Cal.com Goes Closed Source: Why AI Security Is Forcing Our Decision | Cal.com - Scheduling Software for Online Bookings Laravel raised money and now injects ads directly into your agent When moving fast, talking is the first thing to break Too much Discussion of the XOR swap trick – Heather Cafe Introduction to Spherical Harmonics for Graphics Programmers The Grand Line Building a Z-Machine in the worst possible language High-Level Rust: Getting 80% of the Benefits with 20% of the Pain GitHub - duguyue100/midnight-captain: Inspired by Midnight Commander, tailored to my taste. How to build a `git diff` driver · Jamie Tanna | Software Engineer Center for Responsible, Decentralized Intelligence at Berkeley The Local Universe’s Expansion Rate Is Clearer Than Ever, but Still Doesn’t Add Up - A new synthesis of astronomical measurements confirms a persistent mismatch that could point to physics beyond current models The air throughout our homes is infused with microplastics. But there are things you can do to breathe less of them The disturbing white paper Red Hat is trying to erase from the internet – OSnews The Future of Everything is Lies, I Guess: Annoyances ‘Abhorrent’: the inside story of the Polymarket gamblers betting millions on war Productive procrastination — Max van IJsselmuiden maps, territory and LMs 447 Terabytes per Square Centimetre at Zero Retention Energy: Non-Volatile Memory at the Atomic Scale on Fluorographane Show HN: Pardonned.com – A searchable database of US Pardons 20 Years on AWS and Never Not My Job The Seasons are Wrong Artemis II crew splashes down near San Diego after historic moon mission We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs How a dancer with ALS used brainwaves to perform live On filing the corners off my MacBooks Installing every* Firefox extension OpenClaw’s memory is unreliable, and you don’t know when it will break Steve Blank Nowhere Is Safe Chimpanzees in Uganda locked in vicious 'civil war', say researchers watgo - a WebAssembly Toolkit for Go linux/Documentation/process/coding-assistants.rst at master · torvalds/linux GitHub - callumlocke/json-formatter: Makes JSON easy to read. Founding Product Engineer at Bild AI | Y Combinator A compelling title that is cryptic enough to get you to take action on it GitHub - Keychron/Keychron-Keyboards-Hardware-Design: Industrial design files for Keychron keyboards and mice. 100+ models with CAD assets in STEP, DXF, DWG, and PDF. Source-available, with commercial use allowed for original compatible accessories within the license terms. [ANNOUNCE] WireGuardNT v0.11 and WireGuard for Windows v0.6 Released 1D-Chess Helium Is Hard to Replace Cooperative Vectors Introduction | Evolve Keeping a Postgres queue healthy — PlanetScale Our response to the Axios developer tool compromise Do Americans read print books, e-books or audiobooks more? The Zettelkasten Method in Obsidian: A Practical Setup Guide Artemis II Is Competency Porn and We Are Starving For It WeakC4 Flight Viz — Cockpit View A Mexican surveillance giant you’ve never heard of is now watching the U.S. border Surelock: Deadlock-Free Mutexes for Rust RISC-V 101 – what is it and what does it mean for Canonical? | Ubuntu The Problem That Built an Industry How Much Linear Memory Access Is Enough? | Solidean Investigating Split Locks on x86-64 Simplest hash functions Sybilproof reputation mechanisms (2005) [pdf] What is a property? How Complex is my Code? Static code analysis in Kotlin — tools overview Toffoli gates are all you need PGLite evangelism dcmake: a new CMake debugger UI Clojure on Fennel part one: Persistent Data Structures Fragments: April 2 Python Release Python install manager 26.1 The Life and Death of the Book Review - Liberties Introducing Database Traffic Control — PlanetScale Bitcoin miners are losing $19,000 on every BTC produced as difficulty drops 7.8% God sleeps in the minerals Building slogbox Apple Silicon and Virtual Machines: Beating the 2 VM Limit Who was “Not Even Wrong” first? Pokemon Evolution Vs Darwinian Evolution The APL Programming Language Source Code
RISC-V and Floating-Point
2026-05-18 · via Hacker News

RISC-V support for floating-point arithmetic is a topic we have partially covered in a few previous posts but we felt like it deserves a full overview post of its own.

RISC-V base ISA (RV32I or RV64I) does not define any floating-point instructions. RISC-V provides extensions to the base ISA to bring such support for floating-point arithmetic.

The map of ratified floating-point ISA extensions (and their dependencies) is presented in the figures below. The first figure presents both scalar and vector ratified floating-point extensions. The listed scalar extensions are built around a dedicated scalar floating-point register file (FRF).

There exists a mirror set of scalar floating-point extensions operating from the general purpose register file (XRF). They are listed in the figure below:

RISC-V introduced support for floating-point through the F extension. This extension specifies a new register file (FRF) with FLEN-bit wide registers, and a set of operations to perform single precision floating-point (and related) operations. It builds on the 2008 revision of the IEEE-754 standard and includes basic operations (addition, subtraction, division/square root, conversions, …), but also the Fused Multiply-Add (FMA) which was not present in the original version of the IEEE-754 standard (1985).

RISC-V Architects made the choice of assigning a dedicated register file for floating-point operands and results of floating-point operations. We covered this in a previous post:

Compared to a unified integer1/floating-point register file, this choice implies additional cost for supporting Floating-Point as it adds 32 extra registers and the need for dedicated floating-point load/store and data moves between FRF and XRF; at the same time it simplifies register allocation in programs and provide more flexibility to assign architectural storage to floating-point data operands without competing for the same storage resources as the general purpose operations. The separate register files offer an extra layer of flexibility: general purpose register width, XLEN, can differ from floating-point register width, FLEN; allowing to tune the register size for the actual workload needs. For example RV32 + D requires 32 x 32-bit general purpose architectural registers (well actually “31 x”, since x0 is free) and 32 x 64-bit floating-point registers; similarly RV64 + F requires 31 x 64-bit general purpose registers and 32 x 32-bit floating-point registers: you just pay for what you need.

The base floating-point extension to the RISC-V ISA, the F extension, specifies format operations which make implementations compliant with the IEEE 754 standard (in particular its 2008 revision).

The IEEE-754 standard is the most widely accepted floating-point arithmetic standards for CPUs, so selecting it appear as a natural choice for RISC-V.

You can find a brief history of the IEEE 754 standard(s) in this post:

The F extension defines RISC-V support for single-precision format (IEEE-754’s binary32, sometimes dubbed FP32) and an associated of general operations (including conversions from and to integer formats). RISC-V floating-point support is built around IEEE-754 formats.

Historically, the second Floating-Point extension is the D extension, bringing scalar support for double precision format (IEEE-754’s binary64) and instructions operating on it.

A Quadruple Precision (IEEE-754’s binary128) extension, dubbed Q, has also been specified. It seems it has seen only limited interest from the RISC-V community and limited adoption.

The original set of F, D, Q extensions has since been extended with support for half precision (IEEE 754’s binary16) which was added with the Zfh and Zfhmin instruction set extensions. Zfhmin is a strict subset of Zfh and only contains basic data moves and conversions.

Note: One of the rationales behind Zfhmin is that it allows implementaters to chose to only support binary16 as a storage format and not bother with a full scalar support; saving hardware and still allowing computing on half precision datum after a promotion to binary32.

The F extension (scalar support for single precision) is mandated for most of the other floating-point extensions. For example, it is required to enable half precision support (Zfh or Zfhmin) or vector floating-point support (Zve32f onward).

Later in this post, we will cover the IEEE-754 support on the vector side and also look at support for non-standard floating-point formats.

The F extension has been extended by the Zfa extension which offers a few useful scalar floating-point operations. Zfa operations include a floating-point load immediate instruction (with 32 useful floating-point constants), a set of quiet floating-point comparisons, various rounding to integer values (in floating-point format) and a few other operations.

We covered Zfa in more details in this post:

Zfa is defined for the 3 standard formats (binary32, binary64, and binary16) with respective dependency on the F, D, and Zfh.

Note: fli.h is defined if and only if Zfh or Zvfh are defined. Since Zvfh depends on Zfhmin, it means that Zfhmin is necessary but not sufficient for fli.h to exist. The rationale being that if they are no vector support fli.h is not very useful on its own, e.g. using fli.s makes more sense than fli.h followed by fcvt.s.h.

Part of the extra cost of RISC-V floating-point support, namely the additional floating-point register file, can be avoided by selecting the Zfinx family of Floating-Point support for RISC-V. In this case, floating-point operations operate from general purpose registers. Zfinx should be read as “Z-F-in-X”, and indicates that the operations from the F extension are implemented using the XRF, a.k.a. the general purpose register file.

RISC-V specifies Zfinx as the equivalent to the F extension (single precision support), Zdinx as the equivalent to the D extension, and finally Zhinx / Zhinxmin as the equivalents to Zfh / Zfhmin. Those extensions reuse the F / D / Zfh / Zfhmin encodings and remove a few instructions (namely floating-point loads, stores and moves between register files) which would be redundant with existing general purpose instructions.

Note: Zfinx does not specify NaN boxing when a 32-bit F value is stored in a XLEN=64 RV64 register; it mandates sign extension (same as for integer values).

The baseline vector support for floating-point in RISC-V comes with RVV 1.0 which specifies support for single and double precision support.

The support is even more comprehensive than on the scalar side:

RVV 1.0 defines vector variants for all existing scalar instructions, but also instructions without scalar counterparts:

  • Widening addition/subtraction/multiply/multiply-accumulate instructions

  • Reciprocal and reciprocal square-root estimate instructions

  • Narrowing float-to-float conversions with rounding towards odd

One difference to notice is that contrary to their scalar counterparts, the vector multiply-accumulate instructions are destructive: one of the operand is overwritten as the destination. Multiple variants are defined with different “destructive” scheme:

Note: Both vfmacc and vfmadd implement FMA-like semantic: fused multiply-add with a single final rounding.

The vector extension also defines vector-specific operations: floating-point reductions (sum/min/max), vector-scalar/vector-vector variants (including reverse vector-scalar operations such as vfrdiv.vf and vfrsub.vf).

Later extensions, Zvfhmin and Zvfh, added large (resp. minimal) vector support for half precision / binary16. More recently minimal support for BFloat16 was added with Zvfbfmin (conversions) and Zvfbfwma (widening multiply-accumulate BF16.FP32).

A few non standard floating-point formats have made their apparition into ratified or under-specification RISC-V extensions. Some formats inherit from IEEE 754 patterns (e.g., BFloat16) others differ more widely (e.g., OpenCompute’s OFP8).

The first one is BFloat16 (a.k.a. BrainFloat16). This 16-bit floating-point format was never officially listed in any IEEE 754 specifications (at least up to the 2019 revision) but draws from the standard pattern: same encodings, same bias defintion, same special values. The original definition2 corresponds to a truncation of IEEE 754 binary32 (keeping only the upper 16 bits) and the original specification of operation on BFloat16 numbers specifies that subnormal numbers should be flushed to zero. RISC-V does use the standard encoding definition but mandate full subnormal support (adhering to IEEE 754 floating-point arithmetic mandate).

On the scalar side, RISC-V ISA can be extended with Zfbfmin (spec source) which defines basic data moves and BFloat16 conversions from/to single precision.

On the vector side, RISC-V can be extended with either basic data moves and conversions with Zvfbfmin or with widening multiply-accumulate with Zvfbfwma.

Those extensions were covered in a previous post:

Those 3 extensions are ratified and listed as optional into the user level RISC-V Application profile, RVA23U64. Thus, it can be expected that many RISC-V implementation will support them.

A new extension bringing extended vector BFloat16 support ro RVV is making its way through RISC-V specification process: Zfvfbfa.

The extension project is available as a pull-request against the official riscv-isa-manual repo. We covered this extension in this section from a previous post.

Zvfbfa represents a very large step towards full vector BFloat16 support compared to Zvfbfmin and Zvfbfwma: it offers almost as wide of a support for BFloat16 as Zve32f does for binary32. The only excluded operations are “division, square root, reductions, and conversions to/from integers wider than 8 bits”.

Note: at the time of writing (April 2026), there are no specified instructions to convert from half precision from/to BFloat16. Such conversions would have to go through single precision. It is assumed that such cases are rare and would not justify the opcode allocation. Similarly there are not mixed format operations, e.g. a widening product between half precision and BFloat16 with a binary32 result.

With the growing interest for small precision formats (e.g. 8-bit floating-point), RISC-V has been extended to support other non-IEEE floating-point formats. An example is Open Compute’s 8-bit floating-point formats: OFP8 with the Zvfofp8min vector extension project. This extension defines a few conversions instructions from/to both binary32 and BFloat16.

We cover this on-going extension project in RISC-V and MX Scaling Formats.

In this post we also presented another extension project to offer vector conversions from OpenCompute 4-bit floating-point format E2M1 and OFP8 E4M3 format: Zvfofp4min. At the time of writing, this extension is not an official RISC-V International project but it is likely to become one if interest for smaller and smaller floating-point formats continues to grow.

Let’s briefly review an incomplete subset of the upcoming RISC-V projects related to floating-point arithmetic.

It seems support for micro-scaling is a recurring ask and it will certainly materialize as one or more future RISC-V extensions.

Micro-scaling is a concept standardized by OpenCompute MX scaling format standard which defines the storage and operations on a block of values associated with a shared scaling factor.

More formally, there are n values stored v_0, v_1, …, v_{n-1} and a stored scaling factor S and the actual values represented are (v_0 * S), (v_1 * S), …, (v_{n-1} * S). So the storage of a value is split between an element and a shared scale factor. Assuming v_i used an e-bit encoding and S uses an s-bit encoding, n values are represented using n.e + s bits, rather than n.(e+s). Depending on the overlap between element and scale encoding, the actual saving might be less than (n-1).s bits and the algorithm used to determine the scale may also reduce the accuracy of some or all the elements.

Although scaling format support can already be implemented with existing or in-progress extensions (e.g. Zve32f+ Zfvfba + Zvfofp8min), it could be made more efficient by introducing instructions which operates directly on MX encoded blocks: handling the interpretation of the block value as part of the operation without having to explicitly lay down a sequence of multiple instructions.

This future work applies to both OpenCompute MX-Scaling Formats and IEEE P3109 formats (described in the next section).

IEEE is currently working on a standard for smaller formats (16-bit and less) targeted at machine learning applications and offering a very large space of possible formats.

We covered the status of the spec effort in this section of this previous post:

P3109 has made very different choices compared to OCP: while OCP specifies a small number of formats (2 OFP8 formats and 6 MX Scaling formats), P3109 defines a framework than can be used to specifies 100s of different formats. P3109 also defines a large number of primitives operations (including non-linear functions).

It is not the intent of P3109 that any hardware implementations support the full range of formats but rather than they select a relevant subset. For RISC-V, this will certainly mean defining one or more profile which the ecosystem could organize around.

P3109 is neither compatible with OFP8/MX-scaling formats, nor with IEEE 754 definition (e.g. it does not match the definition requirement for emax).

Although no official RISC-V project to support P3109 exist at the time of writing, it is highly likely that one or more will be spawned once P3109 gets closer to ratification.

RISC-V offers a rich support for floating-point, both on the scalar and the vector sides. This support ranges from the low-end Zfinx (scalar floating-point support operating on the general purpose register file) to the extensive V extension (with full single and double precision vector support). This support has been extended with half precision and BFloat16 support; and other extensions are in development. We covered a few in this post, but there are many other on-going efforts involving floating-point at RISC-V International including:

  • Specification for Dot Product and Matrix Operations (these would justify their own post series).

    • long dot product, batched dot product

    • Various flavors of matrix extensions: IME, VME, AME

  • Specifications for Data-Independent Execution Latency Floating-Point operations (for the implementation of cryptographic primitives).

In its on-going development work, RISC-V International faces a few challenges. For example, RVI has to tackle the existence of multiple competing standard (ratified or in project) for small floating-point formats. There are two distincts (and often opposite) mandates: specify rapidly to address key market/ecosystem need and specify for the long term, one would not want to waste time and encoding space working on supporting a set of formats which would be abandoned by the time the extension specification is ratified. RVIA can rely on its active member ecosystem to bubble-up critical need and work on long-term support while the member companies continues to experiment with custom extensions.

If you think someone could benefit from reading this post or could contribute to the RISC-V floating-point effort, feel free to share this post with them:

Share

To stay informed about the on-going floating-point development at RVI (or contribute), you can join the following RISC-V groups:

minimal support often means support for conversions and data moves but no arithmetic operations.

Each extension name should be a link to the source of its specification on riscv-isa-manual or a pull-request introducing the specification (for in-development)

Scalar extensions with dedicated floating-point registers:

  • F: baseline scalar floating-point support for single precision (binary32)

  • D: baseline scalar floating-point support for double precision (binary64)

  • Q: baseline scalar floating-point support for quad precision (binary128)

  • Zfh: baseline scalar floating-point support for half precision (binary16)

  • Zfhmin: minimal scalar floating-point support for half precision (binary16)

  • Zfa: additional scalar floating-point support (extends F, D, Zfh/Zvfh)

  • Zfbfmin: minimal scalar floating-point support for BFloat16

Scalar extensions operating from general purpose registers:

  • Zfinx: baseline scalar floating-point support for single precision (binary32)

  • Zdinx: baseline scalar floating-point support for double precision (binary64)

  • Zhinx: baseline scalar floating-point support for half precision (binary16)

  • Zhinxmin: minimal scalar floating-point support for half precision (binary16)

Vector extensions:

  • Zve32f: baseline vector floating-point support single precision (binary32)

  • Zve64d: baseline vector floating-point support double precision (binary64)

  • Zvfh: baseline vector floating-point support half precision (binary16)

  • Zvfhmin: minimal vector floating-point support half precision (binary16)

  • Zvfbfmin: minimal vector floating-point support for BFloat16

  • Zvfbfwma: widening BFloat16 multiply-accumulate vector floating-point support

  • Zvfbfa: baseline vector floating-point support BFloat16 (in development)

  • Zvfofp8min: minimal vector floating-point support for OFP8 (in development)

  • Zvfofp4min: minimal vector floating-point support for OFP4 (project, unofficial repo)

Notes:

  • The dependencies are not listed here (see figure at the beginning of this post): e.g. supporting D means supporting F (so both baseline single and double precision scalar support).

  • Zve64d and v extensions offer identical floating-point support (Zve64d implies Zve32f)

1

general purpose would be more apt than integer register file

No posts