[llvm] [MC] Remove unused `MCAsmBackend::isMicroMips()` method (NFC) (PR #135581)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 13 23:05:59 PDT 2025


MaskRay wrote:

(I will have limited internet access between April 20th and May 4th, and my response time may be delayed..)

(Made some notes about microMIPS. LLVM's support is quite lacking.

In MIPS16 and microMIPS modes, text labels are marked with the `STO_MIPS_MIPS16` or `STO_MIPS_MICROMIPS` bit, and their addresses have bit 0 set.
This affects how labels and their differences are handled in assembly code.

Consider the following example:

```asm
B0 = .
B1:
  move    $25,$4
C0 = .
C1:
  move    $25,$4
.data
.long C0-B0, C1-B0, C0-B1, C1-B1   // gas Output: 2, 3, 1, 2
.long B0, B1, C0, C1               // gas Output: 0, 1, 2, 3; LLVM integrated assembler is wrong
```

In the `.gcc_except_table` section, the call site table uses similar label differences to define code ranges. For example:

```asm
$LFB0 = .
...
$LEHB0 = .
...
$LEHE0 = .
...
$L3:

        .uleb128 $LEHB0-$LFB0   // call site start, variable minus variable
        .uleb128 $LEHE0-$LEHB0  // call site end, variable minus variable
        .uleb128 $L3-$LFB0      // landing pad offset, label minus variable
```

These differences ensure exception handling, as documented in the GCC fix for MIPS16 EH issues ([[committed] Fix a lot of MIPS16 EH failures](https://gcc.gnu.org/pipermail/gcc-patches/2008-November/252316.html)).

In LLVM, `MCAsmInfo::UseAssignmentForEHBegin` is [introduced](https://github.com/llvm/llvm-project/commit/f491704e2297e5986b0fe7277403e35ffabaaec4) to declare the function begin symbol as `$func_begin0 = .` instead of `$func_begin0:`.


https://github.com/llvm/llvm-project/pull/135581


More information about the llvm-commits mailing list