Comments (4)
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.
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.
Can we close this?
from p4-spec.
I hope so, but I was waiting for @blp to check that the spec fixes this issue.
from p4-spec.
Related Issues (20)
- Where should a `@hidden` annotation on an action be placed? HOT 3
- Clarification regarding Exit statement HOT 19
- L-Value Syntax HOT 3
- Clarification on the calling convention of directionless, extern parameter HOT 4
- Subtlety between length and size. HOT 3
- Missing code-block markup in section "Static assertions" HOT 1
- Allow compile-time resolvable expressions for switch labels? HOT 5
- Incomplete list of operators in compile-time known values section? HOT 1
- Modular match fields for tables. HOT 20
- The type nesting and typedef rules are not clear HOT 5
- Investigate whether PDF/HTML generated for all versions are in git repo history HOT 2
- Should identifiers declared with const be a local compile-time known value if their init expression is? HOT 8
- Should run-time variables that a sophisticated compiler can prove must be equal to a compile-time known value, be treated as a compile-time known value? HOT 2
- Document restriction that numeric priorities may not be specified within `const entries`
- Do we allow `string` type to be aliased by `typedef`? HOT 1
- Misleading code example for 8.24. Operations on types that are type variables
- Allow compile-time concatenation of strings HOT 1
- Consider AsciiDoc for future format of source for P4 language specification HOT 9
- CI: Create a CI job that builds the spec PDF and HTML for a PR
- Useful to create different bit slice variant that makes bit width easier to determine if it is compile time known? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p4-spec.