| 1 | //===----- riscv_mips.h - RISC-V MIPS Intrinsic definitions |
| 2 | //----------------------===// |
| 3 | // |
| 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #ifndef __RISCV_MIPS_H |
| 11 | #define __RISCV_MIPS_H |
| 12 | |
| 13 | #if !defined(__riscv) |
| 14 | #error "This header is only meant to be used on riscv architecture" |
| 15 | #endif |
| 16 | |
| 17 | #define __DEFAULT_FN_ATTRS \ |
| 18 | __attribute__((__always_inline__, __nodebug__, __target__("xmipsexectl"))) |
| 19 | |
| 20 | static __inline__ void __DEFAULT_FN_ATTRS __mips_pause() { |
| 21 | __builtin_riscv_mips_pause(); |
| 22 | } |
| 23 | |
| 24 | static __inline__ void __DEFAULT_FN_ATTRS __mips_ehb() { |
| 25 | __builtin_riscv_mips_ehb(); |
| 26 | } |
| 27 | |
| 28 | static __inline__ void __DEFAULT_FN_ATTRS __mips_ihb() { |
| 29 | __builtin_riscv_mips_ihb(); |
| 30 | } |
| 31 | |
| 32 | #undef __DEFAULT_FN_ATTRS |
| 33 | |
| 34 | #endif |