13/02/2024 17:57, Cristian Dumitrescu: > So far, the pipeline supports the following operations on IPv6 addresses: > -using an IPv6 address as a table match field of exact/ternary/LPM match type > -assignment of IPv6 address to another IPv6 address > -conversion between an IPv4 address and an IPv6 address > > The reason for this limited support is the fact that CPUs have 64-bit > registers, > so supporting operations on 128-bit variables requires additional logic. > > We are now adding support for the following operations involving IPv6 > addresses: > -logic operations: AND, OR, XOR > -shift left/right > -equality/inequality tests > > The way we do this is by introducing a new instruction (called "movh") to read > and write the upper half of a 128-bit operand and optimizing the existing > instruction (called "mov"). This way, we can split an IPv6 address into its > upper half and lower half and use the existing 64-bit instructions to handle > the > required operations. > > We are still not supporting the following operations on IPv6 addresses, as > they > seem of very little practical use: addition, subtraction, multiplication and > division. > > Cristian Dumitrescu (3): > pipeline: add new instruction for upper half of IPv6 address > pipeline: optimize conversion between IPv4 and IPv6 addresses > examples/pipeline: add example for IPv6 address swap
Applied, thanks.