Skip to content

Intrinsics support for Zihintntl extension #30

@aswaterman

Description

@aswaterman

The Zihintntl extension has recently passed AR. The spec is here: https://github.com/riscv/riscv-isa-manual/blob/10eea63205f371ed649355f4cf7a80716335958f/src/zihintntl.tex

During the AR, we wanted to raise the issue of whether and how the extension would be exposed in the RISC-V C API. Can y'all ponder the following and opine?

In x86, for example, _mm_stream_pi (https://github.com/gcc-mirror/gcc/blob/e75da2ace6b6f634237259ef62cfb2d3d34adb10/gcc/config/i386/xmmintrin.h#L1279-L1291) is roughly equivalent to c.ntl.all; sd in RISC-V.

(ARMv8 has LDNP/STNP instructions, but I couldn't find an intrinsics mapping for them.)

Zihintntl is more general than x86's solution in a few dimensions:

  • NTL hints can be used on both loads and stores (in x86, there are only non-temporal stores, AFAIK)
  • NTL hints can be used on any kind of load and store (in x86, it's only MMX/SSE/AVX, AFAIK)
  • NTL hints can express a memory hierarchy level (x86 can only express the equivalent of ntl.all, AFAIK)

With this in mind, the questions for the RISC-V C API folks are: how do we expose this facility in the RISC-V C API? How much of its generality do we expose? Do you foresee any impediments?

cc @kito-cheng @ptomsich

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions