Coder Social home page Coder Social logo

Comments (4)

vgurevich avatar vgurevich commented on September 27, 2024

Hi Ben,

Formally speaking, these expressions are OK from the mathematical point of
view. What is true is that in this proposed syntax there might be several
ways how a particular set can be written. So, in the first case (a set of
all 8-bit numbers with the 3 least significant bits cleared) there are 32
ways to write it out in the proposed syntax, but only one way (8w0 &&& 8w7)
would be considered "canonical" and, frankly, it is in the eye of the
beholder. For example, some people might argue that 8w0xF8 &&& 8w7 (all
"don't care bits are set to 1") is better, depending on which TCAM design
technology they've grown up with.

Rather than making them illegal or undefined, I'd simply recommend the
compiler to issue a warning instead.

Thanks,
Vladimir

On Tue, Aug 16, 2016 at 3:33 PM, Ben Pfaff [email protected] wrote:

Section 10.11.3 doesn't say anything about nonsense cube expressions, that
is, ones where bits are set in the value but not in the mask, such as 8w8
&&& 8w7. According to the definition provided, such an expression is
equivalent to 8w0 &&& 8w7, but it might be worth making the meaning
implementation-defined or undefined since it doesn't make much sense to
have a 1-bit in the value but a 0-bit in the mask.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#41, or mute the thread
https://github.com/notifications/unsubscribe-auth/AMPb88KdXuxL4TOS4H6GzVUNguOcjKZcks5qgjqxgaJpZM4Jl6wu
.

from p4-spec.

blp avatar blp commented on September 27, 2024

I did not realize that some might consider "all-1 don't-cares" canonical. One learns something new every day.

The core of my point was to recommend that the specification note that there's more than one way to specify equivalent matching contraints, so I'm happy with anything that moves in that direction.

from p4-spec.

chkim4142 avatar chkim4142 commented on September 27, 2024

Can we close this?

from p4-spec.

mihaibudiu avatar mihaibudiu commented on September 27, 2024

I hope so, but I was waiting for @blp to check that the spec fixes this issue.

from p4-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.