1 | # Define common subformulae. |
---|
2 | \define START (start=1 * FPM.state[1:0]=0) |
---|
3 | \define Validx (x[6:3]=0 -> x[2:0]=0) |
---|
4 | \define Validy (y[6:3]=0 -> y[2:0]=0) |
---|
5 | \define Validz (z[6:3]=0 -> z[2:0]=0) |
---|
6 | \define NaNx (x[6:3]=b1111 * !(x[2:0]=0)) |
---|
7 | \define NaNy (y[6:3]=b1111 * !(y[2:0]=0)) |
---|
8 | \define NaNz (z[6:3]=b1111 * !(z[2:0]=0)) |
---|
9 | \define Infx x[6:0]=b1111000 |
---|
10 | \define Infy y[6:0]=b1111000 |
---|
11 | \define Infz z[6:0]=b1111000 |
---|
12 | |
---|
13 | #PASS: Legal operands cannot produce illegal results. The only illegal |
---|
14 | # operands in our case are the denormals. |
---|
15 | |
---|
16 | AG((\START * \Validy * \Validx) -> AX:3(\Validz)); |
---|
17 | |
---|
18 | #FAIL: If the sign bits are different the result is negative. |
---|
19 | # This formula fails because one operand may be NaN. |
---|
20 | |
---|
21 | AG((\START * !(y[7]==x[7])) -> AX:3(z[7]=1)); |
---|
22 | |
---|
23 | #PASS: If the sign bits are the same the result is positive. |
---|
24 | |
---|
25 | AG((\START * y[7]==x[7]) -> AX:3(z[7]=0)); |
---|
26 | |
---|
27 | #PASS: If one of the operands is NaN the result is NaN. |
---|
28 | |
---|
29 | AG((\START * (\NaNy + \NaNx)) -> AX:3(\NaNz)); |
---|
30 | |
---|
31 | #FAIL: If one of the operands is zero and the other operand is |
---|
32 | # not NaN the result is zero. |
---|
33 | # These properties should fail, because infinity * zero = NaN. |
---|
34 | |
---|
35 | AG((\START * y[6:0]=0 * !\NaNx) -> AX:3(z[6:0]=0)); |
---|
36 | AG((\START * x[6:0]=0 * !\NaNy) -> AX:3(z[6:0]=0)); |
---|
37 | |
---|
38 | #PASS: If one of the operands is infinite and the other operand is |
---|
39 | # neither NaN nor zero the result is infinite. |
---|
40 | |
---|
41 | AG((\START * \Infy * !\NaNx * !(x[6:3]=0)) -> AX:3(\Infz)); |
---|
42 | AG((\START * \Infx * !\NaNy * !(y[6:3]=0)) -> AX:3(\Infz)); |
---|