[compiler-rt] Sanitizer/MIPS: Use $t9 for preemptible function call (PR #76894)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 15:52:49 PST 2024


MaskRay wrote:

The old comment is:

```
>>! In D158491#4658118, @MaskRay wrote:
> This seems to need a rebase.
> 

I will do so.

>> On MIPS pre-R6, instruction b can only work within 64KiB, which is not enough now.
> 
> I think this is wrong. The b instruction has a range of +-128KiB.
> 

Yes. It is +-128KiB.

> Is the range different on R6? If not, omit "On MIPS pre-R6".
> 

Yes, and No.
R6 introduces a new instruction: BC, its range is 2^28 Bytes.

Normally, If we just write `b XX` asm code, the r6 assembler will convert it to `bc YY`. 

>> which is not enough now.
> 
> which leads to relocation overflows for ... (ideally give an example error message).
> 

Thanks. I will add one.

> 
>> For __mips64, we can get GOT by:
> 
> For 64-bit,
> 
>> MIPSr6 has instruction bc, which can jump long enough.
> 
> The patch utilizes bc for r6 but the title implies that the change is a no-op for r6.

Putting `bc` here, can make things more clear.
In fact, no matter `b` or `bc` here, `BC` will be used eventually. 
```

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


More information about the llvm-commits mailing list