@@ -64,9 +64,10 @@ pub fn crcc_w_d_w(a: i64, b: i32) -> i32 {
64
64
/// Generates the cache operation instruction
65
65
#[ inline]
66
66
#[ unstable( feature = "stdarch_loongarch" , issue = "117427" ) ]
67
- pub unsafe fn cacop < const IMM12 : i64 > ( a : i64 , b : i64 ) {
68
- static_assert_simm_bits ! ( IMM12 , 12 ) ;
69
- __cacop ( a, b, IMM12 ) ;
67
+ pub unsafe fn cacop < const IMM5 : i64 , const IMM_S12 : i64 > ( b : i64 ) {
68
+ static_assert_uimm_bits ! ( IMM5 , 5 ) ;
69
+ static_assert_simm_bits ! ( IMM_S12 , 12 ) ;
70
+ __cacop ( IMM5 , b, IMM_S12 ) ;
70
71
}
71
72
72
73
/// Reads the CSR
@@ -125,14 +126,16 @@ pub unsafe fn asrtgt(a: i64, b: i64) {
125
126
#[ inline]
126
127
#[ rustc_legacy_const_generics( 1 ) ]
127
128
#[ unstable( feature = "stdarch_loongarch" , issue = "117427" ) ]
128
- pub unsafe fn lddir < const B : i64 > ( a : i64 ) -> i64 {
129
- __lddir ( a, B )
129
+ pub unsafe fn lddir < const IMM8 : i64 > ( a : i64 ) -> i64 {
130
+ static_assert_uimm_bits ! ( IMM8 , 8 ) ;
131
+ __lddir ( a, IMM8 )
130
132
}
131
133
132
134
/// Loads the page table entry
133
135
#[ inline]
134
136
#[ rustc_legacy_const_generics( 1 ) ]
135
137
#[ unstable( feature = "stdarch_loongarch" , issue = "117427" ) ]
136
- pub unsafe fn ldpte < const B : i64 > ( a : i64 ) {
137
- __ldpte ( a, B )
138
+ pub unsafe fn ldpte < const IMM8 : i64 > ( a : i64 ) {
139
+ static_assert_uimm_bits ! ( IMM8 , 8 ) ;
140
+ __ldpte ( a, IMM8 )
138
141
}
0 commit comments