Specification of undefined vs implementation defined behavior #277
Replies: 5 comments 3 replies
-
|
Shouldn't the specification of implementation-defined behaviour be deferred to the I am not sure how to best model this, but maybe a pair of annotations, one on the Some open points with this I can think of off the top of my head:
|
Beta Was this translation helpful? Give feedback.
-
|
I think we should introduce a new annotation |
Beta Was this translation helpful? Give feedback.
-
|
I think the approach of separating defined and undefined behavior between ISA and MiA is a good, A possible approach would be
Why is it necessary to explicitly mark undefined behavior? A straight forward way of the example above would be to attach a constraint to imm3, The implementation (MiA, ISS, ...) is free to ignore the constraint, |
Beta Was this translation helpful? Give feedback.
-
|
In the meeting today we agreed to use an |
Beta Was this translation helpful? Give feedback.
-
|
Implemented in #345 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
With VADL we have a formal specification of a processor architecture which is both used to generate simulator/hardware and compiler/assembler. In processor architecture manuals it is common that there is specified undefined behavior where the implementor of the simulator/hardware has any freedom how to implement this and change this undefined behavior into implementation defined behavior. But the compiler/assembler is not allowed to generate code for this undefined behavior which now has become implementation defined. Lets take a look at an example from the AArch64 specification:
It is undefined behavior if imm3 is bigger than 4. In the current specification it is allowed to use bigger values like 5,6 or 7 and the simulator and the hardware would correctly execute shifts by 5,6 or 7. But the compiler and assembler is not allowed to generate this kind of immediate values. How shall we cope with this problem?
Shall we define access functions and a predicate which checks for the correct value range. Shall we avoid implementation defined behavior and let also the simulator/hardware raise an exception by using an
requireannotation on the instruction or anensureannotation on the instruction? If we use an annotation, which one should we use? Shall we introduce anundefinedannotation?There are many different places in the AArch64 spec, e.g. immediate values, writing to the same register, encodings.
Beta Was this translation helpful? Give feedback.
All reactions