@@ -261,53 +261,72 @@ pub unsafe fn atomic_fence<const ORD: AtomicOrdering>();
261
261
pub unsafe fn atomic_singlethreadfence < const ORD : AtomicOrdering > ( ) ;
262
262
263
263
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
264
- /// if supported; otherwise, it is a no-op.
264
+ /// for the given address if supported; otherwise, it is a no-op.
265
265
/// Prefetches have no effect on the behavior of the program but can change its performance
266
266
/// characteristics.
267
267
///
268
- /// The `locality ` argument must be a constant integer and is a temporal locality specifier
269
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
268
+ /// The `LOCALITY ` argument is a temporal locality specifier ranging from (0) - no locality,
269
+ /// to (3) - extremely local keep in cache.
270
270
///
271
271
/// This intrinsic does not have a stable counterpart.
272
272
#[ rustc_intrinsic]
273
273
#[ rustc_nounwind]
274
- pub unsafe fn prefetch_read_data < T > ( data : * const T , locality : i32 ) ;
274
+ #[ miri:: intrinsic_fallback_is_spec]
275
+ pub const fn prefetch_read_data < T , const LOCALITY : i32 > ( data : * const T ) {
276
+ // This operation is a no-op, unless it is overridden by the backend.
277
+ let _ = data;
278
+ }
279
+
275
280
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
276
- /// if supported; otherwise, it is a no-op.
281
+ /// for the given address if supported; otherwise, it is a no-op.
277
282
/// Prefetches have no effect on the behavior of the program but can change its performance
278
283
/// characteristics.
279
284
///
280
- /// The `locality ` argument must be a constant integer and is a temporal locality specifier
281
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
285
+ /// The `LOCALITY ` argument is a temporal locality specifier ranging from (0) - no locality,
286
+ /// to (3) - extremely local keep in cache.
282
287
///
283
288
/// This intrinsic does not have a stable counterpart.
284
289
#[ rustc_intrinsic]
285
290
#[ rustc_nounwind]
286
- pub unsafe fn prefetch_write_data < T > ( data : * const T , locality : i32 ) ;
291
+ #[ miri:: intrinsic_fallback_is_spec]
292
+ pub const fn prefetch_write_data < T , const LOCALITY : i32 > ( data : * const T ) {
293
+ // This operation is a no-op, unless it is overridden by the backend.
294
+ let _ = data;
295
+ }
296
+
287
297
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
288
- /// if supported; otherwise, it is a no-op.
298
+ /// for the given address if supported; otherwise, it is a no-op.
289
299
/// Prefetches have no effect on the behavior of the program but can change its performance
290
300
/// characteristics.
291
301
///
292
- /// The `locality ` argument must be a constant integer and is a temporal locality specifier
293
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
302
+ /// The `LOCALITY ` argument is a temporal locality specifier ranging from (0) - no locality,
303
+ /// to (3) - extremely local keep in cache.
294
304
///
295
305
/// This intrinsic does not have a stable counterpart.
296
306
#[ rustc_intrinsic]
297
307
#[ rustc_nounwind]
298
- pub unsafe fn prefetch_read_instruction < T > ( data : * const T , locality : i32 ) ;
308
+ #[ miri:: intrinsic_fallback_is_spec]
309
+ pub const fn prefetch_read_instruction < T , const LOCALITY : i32 > ( data : * const T ) {
310
+ // This operation is a no-op, unless it is overridden by the backend.
311
+ let _ = data;
312
+ }
313
+
299
314
/// The `prefetch` intrinsic is a hint to the code generator to insert a prefetch instruction
300
- /// if supported; otherwise, it is a no-op.
315
+ /// for the given address if supported; otherwise, it is a no-op.
301
316
/// Prefetches have no effect on the behavior of the program but can change its performance
302
317
/// characteristics.
303
318
///
304
- /// The `locality ` argument must be a constant integer and is a temporal locality specifier
305
- /// ranging from (0) - no locality, to (3) - extremely local keep in cache.
319
+ /// The `LOCALITY ` argument is a temporal locality specifier ranging from (0) - no locality,
320
+ /// to (3) - extremely local keep in cache.
306
321
///
307
322
/// This intrinsic does not have a stable counterpart.
308
323
#[ rustc_intrinsic]
309
324
#[ rustc_nounwind]
310
- pub unsafe fn prefetch_write_instruction < T > ( data : * const T , locality : i32 ) ;
325
+ #[ miri:: intrinsic_fallback_is_spec]
326
+ pub const fn prefetch_write_instruction < T , const LOCALITY : i32 > ( data : * const T ) {
327
+ // This operation is a no-op, unless it is overridden by the backend.
328
+ let _ = data;
329
+ }
311
330
312
331
/// Executes a breakpoint trap, for inspection by a debugger.
313
332
///
0 commit comments