Skip to main content

encode_logical_imm

Function encode_logical_imm 

Source
pub const fn encode_logical_imm(imm: u64, width: u32) -> Option<LogicalImm>
Expand description

Encodes the given imm value of the given width to a logical immediate value represented as N, S, and R fields and writes these fields to out.

Encoding Table:

+---+--------+--------+------+
| N |  ImmS  |  ImmR  | Size |
+---+--------+--------+------+
| 1 | ssssss | rrrrrr |  64  |
| 0 | 0sssss | .rrrrr |  32  |
| 0 | 10ssss | ..rrrr |  16  |
| 0 | 110sss | ...rrr |  8   |
| 0 | 1110ss | ....rr |  4   |
| 0 | 11110s | .....r |  2   |
+---+--------+--------+------+