From 865c1d3231fd57c648121d961be91793d0bfe690 Mon Sep 17 00:00:00 2001 From: johannst Date: Sun, 5 Mar 2023 20:47:28 +0000 Subject: deploy: 1ea7de2ba46b58b4afe3e65b95d8a45160218a5c --- src/juicebox_asm/imm.rs.html | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) (limited to 'src/juicebox_asm/imm.rs.html') diff --git a/src/juicebox_asm/imm.rs.html b/src/juicebox_asm/imm.rs.html index 0990c92..0a9933e 100644 --- a/src/juicebox_asm/imm.rs.html +++ b/src/juicebox_asm/imm.rs.html @@ -33,15 +33,33 @@ 33 34 35 -
/// Trait to interact with immediate operands.
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+
//! Definition of different immediate types which are used as input operands for various
+//! instructions.
+
+/// Trait to interact with immediate operands.
 pub(crate) trait Imm {
     /// Get immediate operand as slice of bytes.
     fn bytes(&self) -> &[u8];
 }
 
 macro_rules! impl_imm {
-    ($name:ident, $size:expr, from: $( $from:ty ),* $(,)?) => {
-        /// Immediate operand.
+    (#[$doc:meta] $name:ident, $size:expr, from: { $( $from:ty ),* $(,)? }) => {
+        #[$doc]
         pub struct $name([u8; $size]);
 
         impl Imm for $name {
@@ -64,9 +82,21 @@
     }
 }
 
-impl_imm!(Imm8, 1, from: u8, i8);
-impl_imm!(Imm16, 2, from: u16, i16, u8, i8);
-impl_imm!(Imm32, 4, from: u32, i32, u16, i16, u8, i8);
-impl_imm!(Imm64, 8, from: u64, i64, u32, i32, u16, i16, u8, i8);
+impl_imm!(
+    /// Type representing an 8 bit immediate.
+    Imm8, 1, from: { u8, i8 }
+);
+impl_imm!(
+    /// Type representing a 16 bit immediate.
+    Imm16, 2, from: { u16, i16, u8, i8 }
+);
+impl_imm!(
+    /// Type representing a 32 bit immediate.
+    Imm32, 4, from: { u32, i32, u16, i16, u8, i8 }
+);
+impl_imm!(
+    /// Type representing a 64 bit immediate.
+    Imm64, 8, from: { u64, i64, u32, i32, u16, i16, u8, i8 }
+);
 
\ No newline at end of file -- cgit v1.2.3