Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Figure out which target features are required/incompatible for which ABI #131799

Open
Labels
A-ABIArea: Concerning the application binary interface (ABI)A-floating-pointArea: Floating point numbers and arithmeticA-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
@RalfJung

Description

@RalfJung

The context for this is#116344: some target features change the way floats are passed between functions. Changing those target features is unsound as code compiled for the same target may now use different ABIs.

In#134794, I am adding the infrastructure to have the compiler recognize this. But this infrastructure needs to be fed with information about which ABIs exist (e.g. softfloat/hardfloat), and which target features they require or are incompatible with. This will have to be done for each architecture we support.

  • x86 (32bit and 64bit):
    • soft-float can be set to swap the ABI; if unset, a hardfloat ABI is used
    • 32bit: uses float registers if!soft-float && x87 (seehere). IOW, hardfloat ABI requiresx87.
    • 64bit: floats are passed via SSE registers, so likely!soft-float && sse is the relevant check -- IOW, hardfloat ABI requiressse/sse2.
  • arm
    • soft-float can be set to swap the ABI; if unset, a hardfloat ABI is used
    • uses float registers if!soft-float && fpregs (seehere), so hardfloat ABI requiresfpregs
  • aarch64
  • riscv
    • "RISC-V has a similar ABI split. -F/-D/-Q is your softfloat/nofloat, but it also comes with the Zfinx/Zdinx/Zqinx variants where floating-point values are carried in the regular registers and the floating-point register file is deleted. Your float-function-features would be +F,-Zfinx, +D,-Zdinx for riscv64gc-unknown-linux (linux does not permit finx). Although I don't think this is as much of a problem because the platform states that +F,+Zfinx is illegal?" (fromhere)
    • For RISC-V targets, the float ABI can be specified by the llvm_abiname target option. As long as this happens,f/d can be enabled without changing the ABI (LLVM doesn't support q yet). Disabling target features required by the requested ABIwill cause LLVM to ignore the ABI. The zfinx/zdinx features don't affect the ABI.
    • Also seeSome-Ctarget-features must be restrained on RISCV #132618
  • loongarch: seehere
  • s390x: seehere andhere
  • powerpc
  • wasm
  • sparc
  • nvptx

Tier 3 only:

  • bpf
  • csky
  • hexagon
  • mips
  • m68k
  • more?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ABIArea: Concerning the application binary interface (ABI)A-floating-pointArea: Floating point numbers and arithmeticA-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp