MIPS: Fix asm constraints "f" and "r" for softfloat (#79116)llvmorg-18.1.0llvmorg-18.1.0-rc4
commit461274b81d8641eab64d494accddc81d7db8a09e
authorYunQiang Su <syq@debian.org>
Tue, 27 Feb 2024 06:08:36 +0000 (27 14:08 +0800)
committerTom Stellard <tstellar@redhat.com>
Tue, 27 Feb 2024 17:18:54 +0000 (27 09:18 -0800)
treee1be320fbeea1122cd0d243440f8463cf003ac68
parente2182a6b91f5001bd9b52e3b1fe6beac434e5fe5
MIPS: Fix asm constraints "f" and "r" for softfloat (#79116)

This include 2 fixes:
        1. Disallow 'f' for softfloat.
        2. Allow 'r' for softfloat.

Currently, 'f' is accpeted by clang, then LLVM meets an internal error.

'r' is rejected by LLVM by: couldn't allocate input reg for constraint
'r'.

Fixes: #64241, #63632

---------

Co-authored-by: Fangrui Song <i@maskray.me>
(cherry picked from commit c88beb4112d5bbf07d76a615ab7f13ba2ba023e6)
clang/lib/Basic/Targets/Mips.h
clang/test/CodeGen/Mips/inline-asm-constraints.c [new file with mode: 0644]
clang/test/Sema/inline-asm-validate-mips.c [new file with mode: 0644]
llvm/lib/Target/Mips/MipsISelLowering.cpp
llvm/test/CodeGen/Mips/inlineasm-constraints-softfloat.ll [new file with mode: 0644]