File tree Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Expand file tree Collapse file tree 3 files changed +40
-3
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ set(riscv_files
131131  riscv_ntlh.h
132132  sifive_vector.h
133133  andes_vector.h
134+   riscv_mips.h
134135  )
135136
136137set (spirv_files
Original file line number Diff line number Diff line change 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 
Original file line number Diff line number Diff line change 11// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6 
22// RUN: %clang_cc1 -triple riscv32-linux-elf -O3  -target-feature +xmipsexectl -emit-llvm -o - %s  | FileCheck %s 
33
4+ #include <riscv_mips.h> 
5+ 
46// CHECK-LABEL: define dso_local void @test_mips_pause( 
57// CHECK-SAME: ) local_unnamed_addr #[[ATTR0:[0-9]+]] { 
68// CHECK-NEXT:  [[ENTRY:.*:]] 
911// 
1012void  test_mips_pause ()
1113{
12- 	__builtin_riscv_mips_pause ();
14+ 	__mips_pause ();
1315}
1416
1517// CHECK-LABEL: define dso_local void @test_mips_ehb( 
@@ -20,7 +22,7 @@ void test_mips_pause()
2022// 
2123void  test_mips_ehb ()
2224{
23- 	__builtin_riscv_mips_ehb ();
25+ 	__mips_ehb ();
2426}
2527
2628// CHECK-LABEL: define dso_local void @test_mips_ihb( 
@@ -31,5 +33,5 @@ void test_mips_ehb()
3133// 
3234void  test_mips_ihb ()
3335{
34- 	__builtin_riscv_mips_ihb ();
36+ 	__mips_ihb ();
3537}
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments