1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! rustc compiler intrinsics.
13 //! The corresponding definitions are in librustc_trans/trans/intrinsic.rs.
17 //! The volatile intrinsics provide operations intended to act on I/O
18 //! memory, which are guaranteed to not be reordered by the compiler
19 //! across other volatile intrinsics. See the LLVM documentation on
22 //! [volatile]: http://llvm.org/docs/LangRef.html#volatile-memory-accesses
26 //! The atomic intrinsics provide common atomic operations on machine
27 //! words, with multiple possible memory orderings. They obey the same
28 //! semantics as C++11. See the LLVM documentation on [[atomics]].
30 //! [atomics]: http://llvm.org/docs/Atomics.html
32 //! A quick refresher on memory ordering:
34 //! * Acquire - a barrier for acquiring a lock. Subsequent reads and writes
35 //! take place after the barrier.
36 //! * Release - a barrier for releasing a lock. Preceding reads and writes
37 //! take place before the barrier.
38 //! * Sequentially consistent - sequentially consistent operations are
39 //! guaranteed to happen in order. This is the standard mode for working
40 //! with atomic types and is equivalent to Java's `volatile`.
43 #![allow(missing_docs)]
45 pub type GlueFn = extern "Rust" fn(*const i8);
56 // Called when a value of type `T` is no longer needed
57 pub drop_glue: GlueFn,
59 // Name corresponding to the type
60 pub name: &'static str,
63 extern "rust-intrinsic" {
65 // NB: These intrinsics take unsafe pointers because they mutate aliased
66 // memory, which is not valid for either `&` or `&mut`.
68 pub fn atomic_cxchg<T>(dst: *mut T, old: T, src: T) -> T;
69 pub fn atomic_cxchg_acq<T>(dst: *mut T, old: T, src: T) -> T;
70 pub fn atomic_cxchg_rel<T>(dst: *mut T, old: T, src: T) -> T;
71 pub fn atomic_cxchg_acqrel<T>(dst: *mut T, old: T, src: T) -> T;
72 pub fn atomic_cxchg_relaxed<T>(dst: *mut T, old: T, src: T) -> T;
74 pub fn atomic_load<T>(src: *const T) -> T;
75 pub fn atomic_load_acq<T>(src: *const T) -> T;
76 pub fn atomic_load_relaxed<T>(src: *const T) -> T;
77 pub fn atomic_load_unordered<T>(src: *const T) -> T;
79 pub fn atomic_store<T>(dst: *mut T, val: T);
80 pub fn atomic_store_rel<T>(dst: *mut T, val: T);
81 pub fn atomic_store_relaxed<T>(dst: *mut T, val: T);
82 pub fn atomic_store_unordered<T>(dst: *mut T, val: T);
84 pub fn atomic_xchg<T>(dst: *mut T, src: T) -> T;
85 pub fn atomic_xchg_acq<T>(dst: *mut T, src: T) -> T;
86 pub fn atomic_xchg_rel<T>(dst: *mut T, src: T) -> T;
87 pub fn atomic_xchg_acqrel<T>(dst: *mut T, src: T) -> T;
88 pub fn atomic_xchg_relaxed<T>(dst: *mut T, src: T) -> T;
90 pub fn atomic_xadd<T>(dst: *mut T, src: T) -> T;
91 pub fn atomic_xadd_acq<T>(dst: *mut T, src: T) -> T;
92 pub fn atomic_xadd_rel<T>(dst: *mut T, src: T) -> T;
93 pub fn atomic_xadd_acqrel<T>(dst: *mut T, src: T) -> T;
94 pub fn atomic_xadd_relaxed<T>(dst: *mut T, src: T) -> T;
96 pub fn atomic_xsub<T>(dst: *mut T, src: T) -> T;
97 pub fn atomic_xsub_acq<T>(dst: *mut T, src: T) -> T;
98 pub fn atomic_xsub_rel<T>(dst: *mut T, src: T) -> T;
99 pub fn atomic_xsub_acqrel<T>(dst: *mut T, src: T) -> T;
100 pub fn atomic_xsub_relaxed<T>(dst: *mut T, src: T) -> T;
102 pub fn atomic_and<T>(dst: *mut T, src: T) -> T;
103 pub fn atomic_and_acq<T>(dst: *mut T, src: T) -> T;
104 pub fn atomic_and_rel<T>(dst: *mut T, src: T) -> T;
105 pub fn atomic_and_acqrel<T>(dst: *mut T, src: T) -> T;
106 pub fn atomic_and_relaxed<T>(dst: *mut T, src: T) -> T;
108 pub fn atomic_nand<T>(dst: *mut T, src: T) -> T;
109 pub fn atomic_nand_acq<T>(dst: *mut T, src: T) -> T;
110 pub fn atomic_nand_rel<T>(dst: *mut T, src: T) -> T;
111 pub fn atomic_nand_acqrel<T>(dst: *mut T, src: T) -> T;
112 pub fn atomic_nand_relaxed<T>(dst: *mut T, src: T) -> T;
114 pub fn atomic_or<T>(dst: *mut T, src: T) -> T;
115 pub fn atomic_or_acq<T>(dst: *mut T, src: T) -> T;
116 pub fn atomic_or_rel<T>(dst: *mut T, src: T) -> T;
117 pub fn atomic_or_acqrel<T>(dst: *mut T, src: T) -> T;
118 pub fn atomic_or_relaxed<T>(dst: *mut T, src: T) -> T;
120 pub fn atomic_xor<T>(dst: *mut T, src: T) -> T;
121 pub fn atomic_xor_acq<T>(dst: *mut T, src: T) -> T;
122 pub fn atomic_xor_rel<T>(dst: *mut T, src: T) -> T;
123 pub fn atomic_xor_acqrel<T>(dst: *mut T, src: T) -> T;
124 pub fn atomic_xor_relaxed<T>(dst: *mut T, src: T) -> T;
126 pub fn atomic_max<T>(dst: *mut T, src: T) -> T;
127 pub fn atomic_max_acq<T>(dst: *mut T, src: T) -> T;
128 pub fn atomic_max_rel<T>(dst: *mut T, src: T) -> T;
129 pub fn atomic_max_acqrel<T>(dst: *mut T, src: T) -> T;
130 pub fn atomic_max_relaxed<T>(dst: *mut T, src: T) -> T;
132 pub fn atomic_min<T>(dst: *mut T, src: T) -> T;
133 pub fn atomic_min_acq<T>(dst: *mut T, src: T) -> T;
134 pub fn atomic_min_rel<T>(dst: *mut T, src: T) -> T;
135 pub fn atomic_min_acqrel<T>(dst: *mut T, src: T) -> T;
136 pub fn atomic_min_relaxed<T>(dst: *mut T, src: T) -> T;
138 pub fn atomic_umin<T>(dst: *mut T, src: T) -> T;
139 pub fn atomic_umin_acq<T>(dst: *mut T, src: T) -> T;
140 pub fn atomic_umin_rel<T>(dst: *mut T, src: T) -> T;
141 pub fn atomic_umin_acqrel<T>(dst: *mut T, src: T) -> T;
142 pub fn atomic_umin_relaxed<T>(dst: *mut T, src: T) -> T;
144 pub fn atomic_umax<T>(dst: *mut T, src: T) -> T;
145 pub fn atomic_umax_acq<T>(dst: *mut T, src: T) -> T;
146 pub fn atomic_umax_rel<T>(dst: *mut T, src: T) -> T;
147 pub fn atomic_umax_acqrel<T>(dst: *mut T, src: T) -> T;
148 pub fn atomic_umax_relaxed<T>(dst: *mut T, src: T) -> T;
151 extern "rust-intrinsic" {
153 pub fn atomic_fence();
154 pub fn atomic_fence_acq();
155 pub fn atomic_fence_rel();
156 pub fn atomic_fence_acqrel();
158 /// Abort the execution of the process.
161 /// Tell LLVM that this point in the code is not reachable,
162 /// enabling further optimizations.
164 /// NB: This is very different from the `unreachable!()` macro!
165 pub fn unreachable() -> !;
167 /// Inform the optimizer that a condition is always true.
168 /// If the condition is false, the behavior is undefined.
170 /// No code is generated for this intrinsic, but the optimizer will try
171 /// to preserve it (and its condition) between passes, which may interfere
172 /// with optimization of surrounding code and reduce performance. It should
173 /// not be used if the invariant can be discovered by the optimizer on its
174 /// own, or if it does not enable any significant optimizations.
175 pub fn assume(b: bool);
177 /// Execute a breakpoint trap, for inspection by a debugger.
180 /// The size of a type in bytes.
182 /// This is the exact number of bytes in memory taken up by a
183 /// value of the given type. In other words, a memset of this size
184 /// would *exactly* overwrite a value. When laid out in vectors
185 /// and structures there may be additional padding between
187 pub fn size_of<T>() -> uint;
189 /// Move a value to an uninitialized memory location.
191 /// Drop glue is not run on the destination.
192 pub fn move_val_init<T>(dst: &mut T, src: T);
194 pub fn min_align_of<T>() -> uint;
195 pub fn pref_align_of<T>() -> uint;
197 /// Get a static pointer to a type descriptor.
198 pub fn get_tydesc<T>() -> *const TyDesc;
200 /// Gets an identifier which is globally unique to the specified type. This
201 /// function will return the same value for a type regardless of whichever
202 /// crate it is invoked in.
203 pub fn type_id<T: 'static>() -> TypeId;
206 /// Create a value initialized to zero.
208 /// `init` is unsafe because it returns a zeroed-out datum,
209 /// which is unsafe unless T is Copy.
210 pub fn init<T>() -> T;
212 /// Create an uninitialized value.
213 pub fn uninit<T>() -> T;
215 /// Move a value out of scope without running drop glue.
217 /// `forget` is unsafe because the caller is responsible for
218 /// ensuring the argument is deallocated already.
220 pub fn forget<T>(_: T) -> ();
222 /// Unsafely transforms a value of one type into a value of another type.
224 /// Both types must have the same size and alignment, and this guarantee
225 /// is enforced at compile-time.
232 /// let v: &[u8] = unsafe { mem::transmute("L") };
233 /// assert!(v == [76u8]);
236 pub fn transmute<T,U>(e: T) -> U;
238 /// Gives the address for the return value of the enclosing function.
240 /// Using this intrinsic in a function that does not use an out pointer
241 /// will trigger a compiler error.
242 pub fn return_address() -> *const u8;
244 /// Returns `true` if a type requires drop glue.
245 pub fn needs_drop<T>() -> bool;
247 /// Returns `true` if a type is managed (will be allocated on the local heap)
248 pub fn owns_managed<T>() -> bool;
250 /// Calculates the offset from a pointer. The offset *must* be in-bounds of
251 /// the object, or one-byte-past-the-end. An arithmetic overflow is also
252 /// undefined behaviour.
254 /// This is implemented as an intrinsic to avoid converting to and from an
255 /// integer, since the conversion would throw away aliasing information.
256 pub fn offset<T>(dst: *const T, offset: int) -> *const T;
258 /// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
259 /// and destination may *not* overlap.
261 /// `copy_nonoverlapping_memory` is semantically equivalent to C's `memcpy`.
265 /// Beyond requiring that both regions of memory be allocated, it is Undefined Behaviour
266 /// for source and destination to overlap. Care must also be taken with the ownership of
267 /// `src` and `dst`. This method semantically moves the values of `src` into `dst`.
268 /// However it does not drop the contents of `dst`, or prevent the contents of `src`
269 /// from being dropped or used.
273 /// A safe swap function:
279 /// fn swap<T>(x: &mut T, y: &mut T) {
281 /// // Give ourselves some scratch space to work with
282 /// let mut t: T = mem::uninitialized();
284 /// // Perform the swap, `&mut` pointers never alias
285 /// ptr::copy_nonoverlapping_memory(&mut t, &*x, 1);
286 /// ptr::copy_nonoverlapping_memory(x, &*y, 1);
287 /// ptr::copy_nonoverlapping_memory(y, &t, 1);
289 /// // y and t now point to the same thing, but we need to completely forget `tmp`
290 /// // because it's no longer relevant.
296 pub fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: uint);
298 /// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
299 /// and destination may overlap.
301 /// `copy_memory` is semantically equivalent to C's `memmove`.
305 /// Care must be taken with the ownership of `src` and `dst`.
306 /// This method semantically moves the values of `src` into `dst`.
307 /// However it does not drop the contents of `dst`, or prevent the contents of `src`
308 /// from being dropped or used.
312 /// Efficiently create a Rust vector from an unsafe buffer:
317 /// unsafe fn from_buf_raw<T>(ptr: *const T, elts: uint) -> Vec<T> {
318 /// let mut dst = Vec::with_capacity(elts);
319 /// dst.set_len(elts);
320 /// ptr::copy_memory(dst.as_mut_ptr(), ptr, elts);
326 pub fn copy_memory<T>(dst: *mut T, src: *const T, count: uint);
328 /// Invokes memset on the specified pointer, setting `count * size_of::<T>()`
329 /// bytes of memory starting at `dst` to `c`.
330 #[experimental = "uncertain about naming and semantics"]
331 pub fn set_memory<T>(dst: *mut T, val: u8, count: uint);
333 /// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with
334 /// a size of `count` * `size_of::<T>()` and an alignment of
335 /// `min_align_of::<T>()`
337 /// The volatile parameter parameter is set to `true`, so it will not be optimized out.
338 pub fn volatile_copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T,
340 /// Equivalent to the appropriate `llvm.memmove.p0i8.0i8.*` intrinsic, with
341 /// a size of `count` * `size_of::<T>()` and an alignment of
342 /// `min_align_of::<T>()`
344 /// The volatile parameter parameter is set to `true`, so it will not be optimized out.
345 pub fn volatile_copy_memory<T>(dst: *mut T, src: *const T, count: uint);
346 /// Equivalent to the appropriate `llvm.memset.p0i8.*` intrinsic, with a
347 /// size of `count` * `size_of::<T>()` and an alignment of
348 /// `min_align_of::<T>()`.
350 /// The volatile parameter parameter is set to `true`, so it will not be optimized out.
351 pub fn volatile_set_memory<T>(dst: *mut T, val: u8, count: uint);
353 /// Perform a volatile load from the `src` pointer.
354 pub fn volatile_load<T>(src: *const T) -> T;
355 /// Perform a volatile store to the `dst` pointer.
356 pub fn volatile_store<T>(dst: *mut T, val: T);
358 /// Returns the square root of an `f32`
359 pub fn sqrtf32(x: f32) -> f32;
360 /// Returns the square root of an `f64`
361 pub fn sqrtf64(x: f64) -> f64;
363 /// Raises an `f32` to an integer power.
364 pub fn powif32(a: f32, x: i32) -> f32;
365 /// Raises an `f64` to an integer power.
366 pub fn powif64(a: f64, x: i32) -> f64;
368 /// Returns the sine of an `f32`.
369 pub fn sinf32(x: f32) -> f32;
370 /// Returns the sine of an `f64`.
371 pub fn sinf64(x: f64) -> f64;
373 /// Returns the cosine of an `f32`.
374 pub fn cosf32(x: f32) -> f32;
375 /// Returns the cosine of an `f64`.
376 pub fn cosf64(x: f64) -> f64;
378 /// Raises an `f32` to an `f32` power.
379 pub fn powf32(a: f32, x: f32) -> f32;
380 /// Raises an `f64` to an `f64` power.
381 pub fn powf64(a: f64, x: f64) -> f64;
383 /// Returns the exponential of an `f32`.
384 pub fn expf32(x: f32) -> f32;
385 /// Returns the exponential of an `f64`.
386 pub fn expf64(x: f64) -> f64;
388 /// Returns 2 raised to the power of an `f32`.
389 pub fn exp2f32(x: f32) -> f32;
390 /// Returns 2 raised to the power of an `f64`.
391 pub fn exp2f64(x: f64) -> f64;
393 /// Returns the natural logarithm of an `f32`.
394 pub fn logf32(x: f32) -> f32;
395 /// Returns the natural logarithm of an `f64`.
396 pub fn logf64(x: f64) -> f64;
398 /// Returns the base 10 logarithm of an `f32`.
399 pub fn log10f32(x: f32) -> f32;
400 /// Returns the base 10 logarithm of an `f64`.
401 pub fn log10f64(x: f64) -> f64;
403 /// Returns the base 2 logarithm of an `f32`.
404 pub fn log2f32(x: f32) -> f32;
405 /// Returns the base 2 logarithm of an `f64`.
406 pub fn log2f64(x: f64) -> f64;
408 /// Returns `a * b + c` for `f32` values.
409 pub fn fmaf32(a: f32, b: f32, c: f32) -> f32;
410 /// Returns `a * b + c` for `f64` values.
411 pub fn fmaf64(a: f64, b: f64, c: f64) -> f64;
413 /// Returns the absolute value of an `f32`.
414 pub fn fabsf32(x: f32) -> f32;
415 /// Returns the absolute value of an `f64`.
416 pub fn fabsf64(x: f64) -> f64;
418 /// Copies the sign from `y` to `x` for `f32` values.
419 pub fn copysignf32(x: f32, y: f32) -> f32;
420 /// Copies the sign from `y` to `x` for `f64` values.
421 pub fn copysignf64(x: f64, y: f64) -> f64;
423 /// Returns the largest integer less than or equal to an `f32`.
424 pub fn floorf32(x: f32) -> f32;
425 /// Returns the largest integer less than or equal to an `f64`.
426 pub fn floorf64(x: f64) -> f64;
428 /// Returns the smallest integer greater than or equal to an `f32`.
429 pub fn ceilf32(x: f32) -> f32;
430 /// Returns the smallest integer greater than or equal to an `f64`.
431 pub fn ceilf64(x: f64) -> f64;
433 /// Returns the integer part of an `f32`.
434 pub fn truncf32(x: f32) -> f32;
435 /// Returns the integer part of an `f64`.
436 pub fn truncf64(x: f64) -> f64;
438 /// Returns the nearest integer to an `f32`. May raise an inexact floating-point exception
439 /// if the argument is not an integer.
440 pub fn rintf32(x: f32) -> f32;
441 /// Returns the nearest integer to an `f64`. May raise an inexact floating-point exception
442 /// if the argument is not an integer.
443 pub fn rintf64(x: f64) -> f64;
445 /// Returns the nearest integer to an `f32`.
446 pub fn nearbyintf32(x: f32) -> f32;
447 /// Returns the nearest integer to an `f64`.
448 pub fn nearbyintf64(x: f64) -> f64;
450 /// Returns the nearest integer to an `f32`. Rounds half-way cases away from zero.
451 pub fn roundf32(x: f32) -> f32;
452 /// Returns the nearest integer to an `f64`. Rounds half-way cases away from zero.
453 pub fn roundf64(x: f64) -> f64;
455 /// Returns the number of bits set in a `u8`.
456 pub fn ctpop8(x: u8) -> u8;
457 /// Returns the number of bits set in a `u16`.
458 pub fn ctpop16(x: u16) -> u16;
459 /// Returns the number of bits set in a `u32`.
460 pub fn ctpop32(x: u32) -> u32;
461 /// Returns the number of bits set in a `u64`.
462 pub fn ctpop64(x: u64) -> u64;
464 /// Returns the number of leading bits unset in a `u8`.
465 pub fn ctlz8(x: u8) -> u8;
466 /// Returns the number of leading bits unset in a `u16`.
467 pub fn ctlz16(x: u16) -> u16;
468 /// Returns the number of leading bits unset in a `u32`.
469 pub fn ctlz32(x: u32) -> u32;
470 /// Returns the number of leading bits unset in a `u64`.
471 pub fn ctlz64(x: u64) -> u64;
473 /// Returns the number of trailing bits unset in a `u8`.
474 pub fn cttz8(x: u8) -> u8;
475 /// Returns the number of trailing bits unset in a `u16`.
476 pub fn cttz16(x: u16) -> u16;
477 /// Returns the number of trailing bits unset in a `u32`.
478 pub fn cttz32(x: u32) -> u32;
479 /// Returns the number of trailing bits unset in a `u64`.
480 pub fn cttz64(x: u64) -> u64;
482 /// Reverses the bytes in a `u16`.
483 pub fn bswap16(x: u16) -> u16;
484 /// Reverses the bytes in a `u32`.
485 pub fn bswap32(x: u32) -> u32;
486 /// Reverses the bytes in a `u64`.
487 pub fn bswap64(x: u64) -> u64;
489 /// Performs checked `i8` addition.
490 pub fn i8_add_with_overflow(x: i8, y: i8) -> (i8, bool);
491 /// Performs checked `i16` addition.
492 pub fn i16_add_with_overflow(x: i16, y: i16) -> (i16, bool);
493 /// Performs checked `i32` addition.
494 pub fn i32_add_with_overflow(x: i32, y: i32) -> (i32, bool);
495 /// Performs checked `i64` addition.
496 pub fn i64_add_with_overflow(x: i64, y: i64) -> (i64, bool);
498 /// Performs checked `u8` addition.
499 pub fn u8_add_with_overflow(x: u8, y: u8) -> (u8, bool);
500 /// Performs checked `u16` addition.
501 pub fn u16_add_with_overflow(x: u16, y: u16) -> (u16, bool);
502 /// Performs checked `u32` addition.
503 pub fn u32_add_with_overflow(x: u32, y: u32) -> (u32, bool);
504 /// Performs checked `u64` addition.
505 pub fn u64_add_with_overflow(x: u64, y: u64) -> (u64, bool);
507 /// Performs checked `i8` subtraction.
508 pub fn i8_sub_with_overflow(x: i8, y: i8) -> (i8, bool);
509 /// Performs checked `i16` subtraction.
510 pub fn i16_sub_with_overflow(x: i16, y: i16) -> (i16, bool);
511 /// Performs checked `i32` subtraction.
512 pub fn i32_sub_with_overflow(x: i32, y: i32) -> (i32, bool);
513 /// Performs checked `i64` subtraction.
514 pub fn i64_sub_with_overflow(x: i64, y: i64) -> (i64, bool);
516 /// Performs checked `u8` subtraction.
517 pub fn u8_sub_with_overflow(x: u8, y: u8) -> (u8, bool);
518 /// Performs checked `u16` subtraction.
519 pub fn u16_sub_with_overflow(x: u16, y: u16) -> (u16, bool);
520 /// Performs checked `u32` subtraction.
521 pub fn u32_sub_with_overflow(x: u32, y: u32) -> (u32, bool);
522 /// Performs checked `u64` subtraction.
523 pub fn u64_sub_with_overflow(x: u64, y: u64) -> (u64, bool);
525 /// Performs checked `i8` multiplication.
526 pub fn i8_mul_with_overflow(x: i8, y: i8) -> (i8, bool);
527 /// Performs checked `i16` multiplication.
528 pub fn i16_mul_with_overflow(x: i16, y: i16) -> (i16, bool);
529 /// Performs checked `i32` multiplication.
530 pub fn i32_mul_with_overflow(x: i32, y: i32) -> (i32, bool);
531 /// Performs checked `i64` multiplication.
532 pub fn i64_mul_with_overflow(x: i64, y: i64) -> (i64, bool);
534 /// Performs checked `u8` multiplication.
535 pub fn u8_mul_with_overflow(x: u8, y: u8) -> (u8, bool);
536 /// Performs checked `u16` multiplication.
537 pub fn u16_mul_with_overflow(x: u16, y: u16) -> (u16, bool);
538 /// Performs checked `u32` multiplication.
539 pub fn u32_mul_with_overflow(x: u32, y: u32) -> (u32, bool);
540 /// Performs checked `u64` multiplication.
541 pub fn u64_mul_with_overflow(x: u64, y: u64) -> (u64, bool);
545 /// `TypeId` represents a globally unique identifier for a type
546 #[lang="type_id"] // This needs to be kept in lockstep with the code in trans/intrinsic.rs and
547 // middle/lang_items.rs
548 #[deriving(Clone, Copy, PartialEq, Eq, Show)]
554 /// Returns the `TypeId` of the type this generic function has been instantiated with
555 pub fn of<T: 'static>() -> TypeId {
556 unsafe { type_id::<T>() }
558 pub fn hash(&self) -> u64 { self.t }