! Vectors for fdim(x,y)
! First some easy integer cases.
3D	 ALL   1   -1   OK	 2
3D	 ALL   1   -2   OK	 3
3D	 ALL   2   -1   OK	 3
3D	 ALL   2   -2   OK	 4
3D	 ALL   2   2   OK   0
3D	 ALL   5   5   OK   0
3D	 ALL   1   -7   OK	 8
3D	 ALL   5   1   OK   4
3D	 ALL   2   5   OK   0
3D	 ALL   5   0   OK   5
3D	 ALL   5   -0   OK	 5
! Infinity vs Infinity.
3D	 ALL   H   -H   OK	 H	 ok - affine sum
3D	 ALL   -H   H   OK	 0
3D	 ALL   -H   -H	 OK	 0	 different signs
3D	 ALL   H   H   OK   0
! Infinity vs huge.
3D	 ALL   H   -Hm1	  OK   H
3D	 ALL   H   Hm1	 OK	  H
3D	 ALL   -H   -Hm1   OK   0
3D	 ALL   -H   Hm1	  OK   0
3D	 ALL   Hm1	 -H	  OK   H
3D	 ALL   Hm1	 H	 OK	  0
3D	 ALL   -Hm1	  -H   OK   H
3D	 ALL   -Hm1	  H	  OK   0
! Infinity vs 0.
3D	 ALL   H   -0   OK	 H
3D	 ALL   H   0   OK   H
3D	 ALL   -H   -0	 OK	  0
3D	 ALL   -H   0   OK	 0
3D	 ALL   0   -H   OK	 H
3D	 ALL   -0   -H	 OK	  H
3D	 ALL   0   H   OK   0
3D	 ALL   -0   H   OK	 0
! Infinity vs denormalized.
3D	 ALL   H   -Ed1	  OK   H
3D	 ALL   -H   -Ed1   OK   0
3D	 ALL   H   Ed1	 OK	  H
3D	 ALL   -H   Ed1	  OK   0
3D	 ALL   0i3	 -H	  OK   H
3D	 ALL   0i3	 H	 OK	  0
3D	 ALL   -0i3	  -H   OK   H
3D	 ALL   -0i3	  H	  OK   0
! Zero vs finite -- watch that sign of 0 is meaningless.
3D	 ALL   0   -Hm1	  OK   Hm1
3D	 ALL   -0   -Hm1   OK   Hm1
3D	 ALL   -Hm1	  -0   OK   0
3D	 ALL   -Hm1	  0	  OK   0
3D	 ALL   1   0   OK   1
3D	 ALL   -1   0   OK	 0
3D	 ALL   0   -1   OK	 1
3D	 ALL   -0   1   OK	 0
! Zero vs denormalized -- underflows.
3D	 ALL   0   -Ed1	  OK   Ed1
3D	 ALL   -0   -Ed1   OK   Ed1
3D	 ALL   0   Ed1	 OK	  0
3D	 ALL   -0   Ed1	  OK   0
3D	 ALL   0i3	 -0	  OK   0i3
3D	 ALL   0i3	 0	 OK	  0i3
3D	 ALL   -0i3	  -0   OK   0
3D	 ALL   -0i3	  0	  OK   0
! Zero vs tiny -- just in case.
3D	 ALL   -0   E   OK	 0
3D	 ALL   E   -0   OK	 E
3D	 ALL   0   E   OK   0
3D	 ALL   -E   -0	 OK	  0
! Zero vs Zero -- watch signs and rounding modes.
3D	 ALL   0   0   OK   0
3D	 ALL  -0   -0	 OK	  0
3D	 ALL   0   -0   OK	 0
3D	 ALL   -0   0   OK	 0
! Double a number -- may overflow so watch rounding mode.
3D	 =>	  Hm1   -Hm1   xo   H
3D	 0<	  Hm1   -Hm1   xo   Hd1
3D	 ALL	  -Hm1	 Hm1   OK  0
3D	 ALL   Hm1d2   -Hm1d2   OK	 Hd2
3D	 ALL   -Hm1d2   Hm1d2   OK	 0
3D	 =>	  Hd2   -Hd2   xo   H
3D	 0<	  Hd2   -Hd2   xo   Hd1
3D	 ALL	  -Hd2	 Hd2   OK   0
! Double an innocent number.
3D	 ALL   1   -1   OK	 2
3D	 ALL   3   -3   OK	 6
3D	 ALL   E   -E   OK	 Ep1
3D	 ALL   Hm2	 -Hm2   OK	 Hm1
! Double a tiny number -- may underflow.
3D	 ALL   Ed1	 -Ed1   OK	 Ep1d2
3D	 ALL   -Ed1	  Ed1   OK	 0
3D	 ALL   0i4	 -0i4   OK	 0i8
3D	 ALL   -0i4	  0i4   OK	 0
3D	 ALL   0i1	 -0i1   OK	 0i2
3D	 ALL   -0i1	  0i1   OK	 0
! Cancellation to 0 -- to plus 0.
3D	 ALL   Hm1	 Hm1   OK   0
3D	 ALL   -Hm1d2   -Hm1d2	 OK	  0
3D	 ALL   1   1   OK   0
3D	 ALL   -3   -3	 OK	  0
3D	 ALL   E   E   OK   0
3D	 ALL   -E   -E	 OK	  0
3D	 ALL   Ed4	 Ed4   OK   0
3D	 ALL   -Ed1	  -Ed1	 OK	  0	  no underflow
3D	 ALL   0i1	 0i1   OK   0
3D	 ALL   -0i1	  -0i1	 OK	  0
3D	 ALL	Hd1	 Hd1 OK		 0
! Cancel forcing normalization of LSB (no rounding errors).
! Difference is in last place of larger number.
! Medium numbers...
3D	 ALL   1i1	 1	 OK	  1u1
3D	 ALL   -1i1	  -1   OK   0
3D	 ALL   1i1	 1i2   OK   0
3D	 ALL   -1i1	  -1i2	 OK	  1u1
3D	 ALL   2   2i1	 OK	  0
3D	 ALL   -2   -2i1   OK   2u1
3D	 ALL   2i4	 2i3   OK   2u1
3D	 ALL   -2i4	  -2i3	 OK	  0
3D	 ALL   4d1	 4d2   OK   3u1
3D	 ALL   -4d1	  -4d2	 OK	  0
3D	 ALL   2d4	 2d3   OK   0
3D	 ALL   -2d4	  -2d3	 OK	  1u1
! Huge numbers...
3D	 ALL   Hm1i1   Hm1	 OK	  Hm1u1
3D	 ALL   -Hm1i1   -Hm1   OK   0
3D	 ALL   Hm1i1   Hm1i2   OK   0
3D	 ALL   -Hm1i1   -Hm1i2	 OK	  Hm1u1
3D	 ALL   Hm2	 Hm2i1	 OK	  0
3D	 ALL   -Hm2	  -Hm2i1   OK   Hm2u1
3D	 ALL   Hm2i4   Hm2i3   OK   Hm2u1
3D	 ALL   -Hm2i4   -Hm2i3	 OK	  0
3D	 ALL   Hm2d1   Hm2d2   OK   Hm3u1
3D	 ALL   -Hm2d1   -Hm2d2	 OK	  0
3D	 ALL   -Hd2	  -Hd1	 OK	  Hd1u1
3D	 ALL   Hd2	 Hd1   OK   0
! Tiny numbers...
3D	 ALL   -Ei1	  -E   OK   0
3D	 ALL   Ei1	 E	 OK	  Eu1
3D	 ALL   -Ed1	  -E   OK   Eu1
3D	 ALL   Ed1	 E	 OK	  0
3D	 ALL   Ei1	 Ei2   OK   0
3D	 ALL   -Ei1	  -Ei2	 OK	  Eu1
3D	 ALL   Ed1	 Ed2   OK   Eu1
3D	 ALL   -Ed1	  -Ed2	 OK	  0
3D	 ALL   Ed3	 Ed2   OK   0
3D	 ALL   -Ed3	  -Ed2	 OK	  Eu1
3D	 ALL   0i2	 0i1   OK   Eu1
3D	 ALL   -0i2	  -0i1	 OK	  0
3D	 ALL   0i3	 0i2   OK   Eu1
3D	 ALL   -0i3	  -0i2	 OK	  0
! Normalize from round bit -- set up tests so that operands have
! exponents differing by 1 unit.
! Medium numbers...
3D	 ALL   2   2d1	 OK	  1u1
3D	 ALL   -2   -2d1   OK   0
3D	 ALL   -2d1	  -2   OK   1u1
3D	 ALL   2d1	 2	 OK	  0
3D	 ALL   4i1	 4d1   OK   3u3
3D	 ALL   -4i1	  -4d1	 OK	  0
3D	 ALL   4d1	 4i2   OK   0
3D	 ALL   -4d1	  -4i2	 OK	  3u5
3D	 ALL   2i1	 1i1   OK   1i1
3D	 ALL   -2i1	  -1i1	 OK	  0
3D	 ALL   2i2	 1i1   OK   1i3
3D	 ALL   -2i2	  -1i1	 OK	  0
3D	 ALL   2i2	 1i3   OK   1i1
3D	 ALL   -2i2	  -1i3	 OK	  0
! Huge numbers...
3D	 ALL   Hm2	 Hm2d1	 OK	  Hm3u1
3D	 ALL   -Hm2	  -Hm2d1   OK   0
3D	 ALL   -Hm1d1   -Hm1   OK   Hm2u1
3D	 ALL   Hm1d1   Hm1	 OK	  0
3D	 ALL   Hm4i1   Hm4d1   OK   Hm5u3
3D	 ALL   -Hm4i1   -Hm4d1	 OK	  0
3D	 ALL   Hm2d1   Hm2i2   OK   0
3D	 ALL   -Hm2d1   -Hm2i2	 OK	  Hm3u5
3D	 ALL   Hm2i1   Hm1i1   OK   0
3D	 ALL   -Hm2i1   -Hm1i1	 OK	  Hm2i1
3D	 ALL   Hm1i2   Hm2i1   OK   Hm2i3
3D	 ALL   -Hm1i2   -Hm2i1	 OK	  0
3D	 ALL   Hm2i2   Hm3i3   OK   Hm3i1
3D	 ALL   -Hm2i2   -Hm3i3	 OK	  0
! Tiny numbers...
3D	 ALL   Ep1	 Ep1d1	 OK	  Eu1
3D	 ALL   -Ep1	  -Ep1d1   OK   0
3D	 ALL   -Ep1d1   -Ep1   OK   Eu1
3D	 ALL   Ep1d1   Ep1	 OK	  0
3D	 ALL   Ep1i1   Ep1d1   OK   Eu3
3D	 ALL   -Ep1i1   -Ep1d1	 OK	  0
3D	 ALL   Ep2	 Ep2d1	 OK	  Eu2
3D	 ALL   -Ep2	  -Ep2d1   OK   0
3D	 ALL   -Ep2d1   -Ep2   OK   Eu2
3D	 ALL   Ep2d1   Ep2	 OK	  0
3D	 ALL   Ep2i1   Ep2d1   OK   Eu6
3D	 ALL   -Ep2i1   -Ep2d1	 OK	  0
3D	 ALL   Ep1d1   Ep1i2   OK   0
3D	 ALL   -Ep1d1   -Ep1i2	 OK	  Eu5
3D	 ALL   Ep1d1   Ep1i4   OK   0
3D	 ALL   -Ep1d1   -Ep1i4	 OK	  Eu9
3D	 ALL   Ep1i1   Ei1	 OK	  Ei1
3D	 ALL   -Ep1i1   -Ei1   OK   0
3D	 ALL   Ep1i2   Ei1	 OK	  Ei3
3D	 ALL   -Ep1i2   -Ei1   OK   0
3D	 ALL   Ep2i2   Ep1i3   OK   Ep1i1
3D	 ALL   -Ep2i2   -Ep1i3	 OK	  0
! Add magnitude:
! cases where one operand is off in sticky -- rounding
! perhaps to an overflow.
! Huge vs medium.
3D	 =0<   Hm1	 -1	  x	  Hm1
3D	 >	 Hm1   -1   x   Hm1i1
3D	 ALL   -Hm1	  1	 OK  0
3D	 =0<   Hm1d1   -1   x   Hm1d1
3D	 >	 Hm1d1	 -1	  x	  Hm1
3D	 ALL   -Hm1d1   1   OK   0
3D	 =0<   Hd1	 -1	  x	  Hd1
3D	 >	 Hd1   -1   xo	 H
3D	 ALL   -Hd1	  1	  OK	 0
3D	 =0<   Hd2	 -1	  x	  Hd2
3D	 >	 Hd2   -1   x   Hd1
3D	 ALL   -Hd2	  1	  OK	0
! Huge vs denormal.
3D	 =0<   0i1	 -Hm1   x   Hm1
3D	 >	 0i1   -Hm1	  x	  Hm1i1
3D	 ALL   -0i1	  Hm1   OK   0
3D	 =0<   0i1	 -Hm1d1	  x	  Hm1d1
3D	 >	 0i1   -Hm1d1   x   Hm1
3D	 ALL   -0i1	  Hm1d1	  OK	0
3D	 =0<   0i1	 -Hd1   x   Hd1
3D	 >	 0i1   -Hd1	  xo   H
3D	 ALL   -0i1	  Hd1   OK   0
3D	 =0<   0i1	 -Hd2   x   Hd2
3D	 >	 0i1   -Hd2	  x	  Hd1
3D	 ALL   -0i1	  Hd2   OK   0
! Medium vs denormal.
3D	 =0<   0i1	 -1	  x	  1
3D	 >	 0i1   -1   x   1i1
3D	 ALL   -0i1	  1	  OK	0
3D	 =0<   0i1	 -1d1   x   1d1
3D	 >	 0i1   -1d1	  x	  1
3D	 ALL   -0i1	  1d1   OK   0
3D	 =0<   0i1	 -2d1   x   2d1
3D	 >	 0i1   -2d1	  x	  2
3D	 ALL   -0i1	  2d1   OK  0
3D	 =0<   0i1	 -2d2   x   2d2
3D	 >	 0i1   -2d2	  x	  2d1
3D	 ALL   -0i1	  2d2   OK  0
!
! Magnitude subtract when an operand is in the sticky bit.
! The interesting cases will arise when directed rounding
! forces a nonzero cancellation.
! Huge and medium.
3D	 =>	  Hm1   1   x   Hm1
3D	 0<	  Hm1   1   x   Hm1d1
3D	 ALL  -Hm1	 -1	  OK	0
3D	 =>	  Hm1d1	  1	  x	  Hm1d1
3D	 0<	  Hm1d1	  1	  x	  Hm1d2
3D	 ALL  -Hm1d1   -1   OK  0
3D	 =>	  Hd1   1   x   Hd1
3D	 0<	  Hd1   1   x   Hd2
3D	 ALL  -Hd1	 -1	  OK	0
3D	 =>	  Hd2   1   x   Hd2
3D	 0<	  Hd2   1   x   Hd3
3D	 ALL  -Hd2	 -1	  OK	0
! Huge and tiny.
3D	 =>	  Hd1   0i1	  x	  Hd1
3D	 0<	  Hd1   0i1	  x	  Hd2
3D	 ALL  -Hd1	 -0i1   OK   0
3D	 =>	  -0i3	 -Hm1   x   Hm1
3D	 0<	  -0i3	 -Hm1   x   Hm1d1
3D	 ALL  0i3   Hm1	  OK	 0
! Medium and tiny.
3D	 =>	  1d1  0i1	 x	 1d1
3D	 0<	  1d1  0i1	 x	 1d2
3D	 ALL  -2d1	 -0i1   OK   0
3D	 =>	  -0i3	 -3	  x	  3
3D	 0<	  -0i3	 -3	  x	  3d1
3D	 ALL  0i3    5   OK  0
! Add magnitude with difference in LSB so, except for denorms,
! round bit is crucial.	 Half-way cases arise.
! Medium cases.
3D	 =0<   1i1	 -1	  x	  2
3D	 >	 1i1   -1   x   2i1
3D	 ALL   -1i1	  1	  OK	0
3D	 ALL   -2   2i1	  OK	0
3D	 =0<   2   -2i1	  x	  4
3D	 >	 2	 -2i1   x   4i1
3D	 =>	  1	  -1i3	 x	 2i2
3D	 0<	  1	  -1i3	 x	 2i1
3D	 ALL  -1   1i3	 OK  0
3D	 ALL  -2i1	 2i2  OK   0
3D	 =>	  2i1   -2i2   x   4i2
3D	 0<	  2i1   -2i2   x   4i1
! Huge cases.
3D	 =>	  Hd2   -Hd1   xo   H
3D	 0<	  Hd2   -Hd1   xo   Hd1
3D	 ALL  -Hd2	 Hd1   OK   0
3D	 =>	  Hm1d1	  -Hm1	 xo	  H
3D	 0<	  Hm1d1	  -Hm1	 x	 Hd1
3D	 ALL  -Hm1d1   Hm1	 OK	  0
3D	 =>	  Hm1i1	  -Hm1	 xo	  H
3D	 0<	  Hm1i1	  -Hm1	 xo	  Hd1
3D	 ALL  -Hm1i1   Hm1	 OK	  0
3D	 =0<   Hm2i1   -Hm2	  x	  Hm1
3D	 >	 Hm2i1	 -Hm2   x   Hm1i1
3D	 ALL   -Hm2i1   Hm2	 OK	  0
3D	 =0<   Hm1d2   -Hm1d1   x   Hd2
3D	 >	 Hm1d2	 -Hm1d1	  x	  Hd1
3D	 ALL   -Hm1d2   Hm1d1  OK  0
! Check rounding.
3D	    >	    2	    -1u1   x	   2i1
3D	    =0<	    2	    -1u1   x	   2
3D	    =>	    2i1	  -1u1	 x		 2i2
3D	    0<	    2i1	  -1u1	 x		 2i1
3D	    =>	    4d1	  -1u1	 x		 4
3D	    0<	    4d1	  -1u1	 x		 4d1
3D	    >	    4d1	  -1u1d1 x	   4
3D	    0=<	    4d1	  -1u1d1 x	   4d1
3D	    ALL	    -4d1  1u1   OK   	0
3D	    ALL     -4d1  1u1d1 OK		0
! NaN operands.  Signaling NaN cases commented out <JPO, 4/29/93>
3D	    ALL	    Q	    0	    OK	    Q
3D	    ALL	    Q	    -0	    OK	    Q
3D	    ALL	    0	    Q	    OK	    Q
3D	    ALL	    -0	    Q	    OK	    Q
3D	    ALL	    Q	    1	    OK	    Q
3D	    ALL	    Q	    -1	    OK	    Q
3D	    ALL	    1	    Q	    OK	    Q
3D	    ALL	    -1	    Q	    OK	    Q
3D	    ALL	    Ed1	 Q		 OK		 Q
3D	    ALL	    -Ed1 Q		 OK		 Q
3D	    ALL	    Q	    Ed1	 OK		 Q
3D	    ALL	    Q	    -Ed1 OK		 Q
3D	    ALL	    Q	    0i1	  OK	  Q
3D	    ALL	    Q	    -0i1  OK	  Q
3D	    ALL	    0i1	  Q		  OK	  Q
3D	    ALL	    -0i1  Q		  OK	  Q
3D	    ALL	    Q	    Hd1	 OK		 Q
3D	    ALL	    Q	    -Hd1 OK		 Q
3D	    ALL	    Hd1	 Q		 OK		 Q
3D	    ALL	    -Hd1 Q		 OK		 Q
3D	    ALL	    Q	    H	   OK	   Q
3D	    ALL	    Q	    -H	   OK	   Q
3D	    ALL	    H	   Q	   OK	   Q
3D	    ALL	    -H	   Q	   OK	   Q
3D	    ALL	    Q	    Q	    OK	    Q
!3D	    ALL	    S	    0	    i	    Q
!3D	    ALL	    S	    -0	    i	    Q
!3D	    ALL	    0	    S	    i	    Q
!3D	    ALL	    -0	    S	    i	    Q
!3D	    ALL	    S	    1	    i	    Q
!3D	    ALL	    S	    -1	    i	    Q
!3D	    ALL	    1	    S	    i	    Q
!3D	    ALL	    -1	    S	    i	    Q
!3D	    ALL	    Ed1	 S		 i		 Q
!3D	    ALL	    -Ed1 S		 i		 Q
!3D	    ALL	    S	    Ed1	 i		 Q
!3D	    ALL	    S	    -Ed1 i		 Q
!3D	    ALL	    S	    0i1	  i		  Q
!3D	    ALL	    S	    -0i1  i		  Q
!3D	    ALL	    0i1	  S		  i		  Q
!3D	    ALL	    -0i1  S		  i		  Q
!3D	    ALL	    S	    Hd1	 i		 Q
!3D	    ALL	    S	    -Hd1 i		 Q
!3D	    ALL	    Hd1	 S		 i		 Q
!3D	    ALL	    -Hd1 S		 i		 Q
!3D	    ALL	    S	    H	   i	   Q
!3D	    ALL	    S	    -H	   i	   Q
!3D	    ALL	    H	   S	   i	   Q
!3D	    ALL	    -H	   S	   i	   Q
!3D	    ALL	    Q	    S	    i	    Q
!3D	    ALL	    S	    Q	    i	    Q
!3D	    ALL	    S	    S	    i	    Q
