Skip to content

[MIPS] microMIPS and MIPS16 don't use jr instruction delay slot and instead always use the version with no delay slot #98560

Open
@GabrielRavier

Description

@GabrielRavier

A function such as:

#include <stdint.h>

uint8_t f(uint8_t x)
{
    return x;
}

gets compiled by GCC to:

f(unsigned char):
        jr      $31
        move    $2,$4

on MIPS with either -mmicromips or -mips16 in use, whereas in those cases LLVM emits:

f(unsigned char):                                  # @f(unsigned char)
        move    $2, $4
        jrc     $ra

I've searched around and could not find anything contradicting the idea that using the version with a delay slot when the delay slot can be filled is faster.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions