35 lines · c
1//===----- riscv_mips.h - RISC-V MIPS Intrinsic definitions2//----------------------===//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-exception7//8//===----------------------------------------------------------------------===//9 10#ifndef __RISCV_MIPS_H11#define __RISCV_MIPS_H12 13#if !defined(__riscv)14#error "This header is only meant to be used on riscv architecture"15#endif16 17#define __DEFAULT_FN_ATTRS \18 __attribute__((__always_inline__, __nodebug__, __target__("xmipsexectl")))19 20static __inline__ void __DEFAULT_FN_ATTRS __mips_pause() {21 __builtin_riscv_mips_pause();22}23 24static __inline__ void __DEFAULT_FN_ATTRS __mips_ehb() {25 __builtin_riscv_mips_ehb();26}27 28static __inline__ void __DEFAULT_FN_ATTRS __mips_ihb() {29 __builtin_riscv_mips_ihb();30}31 32#undef __DEFAULT_FN_ATTRS33 34#endif35