xref: /titanic_44/usr/src/lib/efcode/fcode_test/test64.fth (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate\ #ident	"%Z%%M%	%I%	%E% SMI"
2*7c478bd9Sstevel@tonic-gate\ purpose:
3*7c478bd9Sstevel@tonic-gate\ copyright: Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
4*7c478bd9Sstevel@tonic-gate\ copyright: Use is subject to license terms.
5*7c478bd9Sstevel@tonic-gate\ copyright:
6*7c478bd9Sstevel@tonic-gate\ copyright: CDDL HEADER START
7*7c478bd9Sstevel@tonic-gate\ copyright:
8*7c478bd9Sstevel@tonic-gate\ copyright: The contents of this file are subject to the terms of the
9*7c478bd9Sstevel@tonic-gate\ copyright: Common Development and Distribution License, Version 1.0 only
10*7c478bd9Sstevel@tonic-gate\ copyright: (the "License").  You may not use this file except in compliance
11*7c478bd9Sstevel@tonic-gate\ copyright: with the License.
12*7c478bd9Sstevel@tonic-gate\ copyright:
13*7c478bd9Sstevel@tonic-gate\ copyright: You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14*7c478bd9Sstevel@tonic-gate\ copyright: or http://www.opensolaris.org/os/licensing.
15*7c478bd9Sstevel@tonic-gate\ copyright: See the License for the specific language governing permissions
16*7c478bd9Sstevel@tonic-gate\ copyright: and limitations under the License.
17*7c478bd9Sstevel@tonic-gate\ copyright:
18*7c478bd9Sstevel@tonic-gate\ copyright: When distributing Covered Code, include this CDDL HEADER in each
19*7c478bd9Sstevel@tonic-gate\ copyright: file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20*7c478bd9Sstevel@tonic-gate\ copyright: If applicable, add the following below this CDDL HEADER, with the
21*7c478bd9Sstevel@tonic-gate\ copyright: fields enclosed by brackets "[]" replaced with your own identifying
22*7c478bd9Sstevel@tonic-gate\ copyright: information: Portions Copyright [yyyy] [name of copyright owner]
23*7c478bd9Sstevel@tonic-gate\ copyright:
24*7c478bd9Sstevel@tonic-gate\ copyright: CDDL HEADER END
25*7c478bd9Sstevel@tonic-gate\ copyright:
26*7c478bd9Sstevel@tonic-gate
27*7c478bd9Sstevel@tonic-gatefcode-version1
28*7c478bd9Sstevel@tonic-gate." 64-bit Fcode operation tests" cr
29*7c478bd9Sstevel@tonic-gate
30*7c478bd9Sstevel@tonic-gate : .failed ." failed!" ;
31*7c478bd9Sstevel@tonic-gate
32*7c478bd9Sstevel@tonic-gate : .passed ." OK"  ;
33*7c478bd9Sstevel@tonic-gate
34*7c478bd9Sstevel@tonic-gate : .chkstk  depth if ." Stack Changed: " .s cr then ;
35*7c478bd9Sstevel@tonic-gate
36*7c478bd9Sstevel@tonic-gate : .passed?  ( str,len flag )
37*7c478bd9Sstevel@tonic-gate    if if then if then .passed  space else  cr type space .failed cr then
38*7c478bd9Sstevel@tonic-gate ;
39*7c478bd9Sstevel@tonic-gate
40*7c478bd9Sstevel@tonic-gate\ comparisons only 32-bit...
41*7c478bd9Sstevel@tonic-gate: xl=  ( xv lh ll -- flag )
42*7c478bd9Sstevel@tonic-gate   swap rot xlsplit rot = -rot = and
43*7c478bd9Sstevel@tonic-gate;
44*7c478bd9Sstevel@tonic-gate
45*7c478bd9Sstevel@tonic-gate: x=  ( xv1 xv2 -- flag )
46*7c478bd9Sstevel@tonic-gate   xlsplit rot xlsplit rot = -rot = and
47*7c478bd9Sstevel@tonic-gate;
48*7c478bd9Sstevel@tonic-gatecreate test-64
49*7c478bd9Sstevel@tonic-gate	h# 01020304 l,
50*7c478bd9Sstevel@tonic-gate	h# 05060708 l,
51*7c478bd9Sstevel@tonic-gate	h# 81121314 l,
52*7c478bd9Sstevel@tonic-gate	h# 85161718 l,
53*7c478bd9Sstevel@tonic-gate        h# ffffffff l,
54*7c478bd9Sstevel@tonic-gate        h# 80000000 l,
55*7c478bd9Sstevel@tonic-gate
56*7c478bd9Sstevel@tonic-gate." 64-bit access tests: "
57*7c478bd9Sstevel@tonic-gate   " /x.1"     /x 8                                               = .passed?
58*7c478bd9Sstevel@tonic-gate   " xa1+.1"   test-64 xa1+  test-64 /x +                         = .passed?
59*7c478bd9Sstevel@tonic-gate   " xa+.1"    test-64 2 xa+ test-64 /x 2 * +                     = .passed?
60*7c478bd9Sstevel@tonic-gate   " x@.1"     test-64 x@ h# 01020304 h# 05060708               xl= .passed?
61*7c478bd9Sstevel@tonic-gate   " x@.2"     test-64 xa1+ x@ h# 81121314 h# 85161718          xl= .passed?
62*7c478bd9Sstevel@tonic-gate   " <l@.1"    test-64 2 xa+ dup la1+ <l@ swap x@                x= .passed?
63*7c478bd9Sstevel@tonic-gate   " bxjoin.1" 8 7 6 5 4 3 2 1 bxjoin test-64 x@                 x= .passed?
64*7c478bd9Sstevel@tonic-gate   " wxjoin.1" h# 0708 h# 0506 h# 0304 h# 0102 wxjoin test-64 x@ x= .passed?
65*7c478bd9Sstevel@tonic-gate   " lxjoin.1" h# 05060708 h# 01020304 lxjoin test-64 x@         x= .passed?
66*7c478bd9Sstevel@tonic-gate   " x!.1"     h# 85161718 h# 81121314 lxjoin test-64 x!
67*7c478bd9Sstevel@tonic-gate               test-64 x@ h# 81121314 h# 85161718               xl= .passed?
68*7c478bd9Sstevel@tonic-gate   " x!.2"     h# 05060708 h# 01020304 lxjoin test-64 x!
69*7c478bd9Sstevel@tonic-gate               test-64 x@ h# 01020304 h# 05060708               xl= .passed?
70*7c478bd9Sstevel@tonic-gatecr
71*7c478bd9Sstevel@tonic-gate." 64-bit flips: "
72*7c478bd9Sstevel@tonic-gate   " xbflip.1" test-64 x@ xbflip h# 08070605 h# 04030201        xl= .passed?
73*7c478bd9Sstevel@tonic-gate   " xwflip.1" test-64 x@ xwflip h# 07080506 h# 03040102        xl= .passed?
74*7c478bd9Sstevel@tonic-gate   " xlflip.1" test-64 x@ xlflip h# 05060708 h# 01020304        xl= .passed?
75*7c478bd9Sstevel@tonic-gate   " xbsplit.1" test-64 x@ xbsplit bxjoin test-64 x@             x= .passed?
76*7c478bd9Sstevel@tonic-gate   " xwsplit.1" test-64 x@ xwsplit wxjoin test-64 x@             x= .passed?
77*7c478bd9Sstevel@tonic-gate   " xlsplit.1" test-64 x@ xlsplit lxjoin test-64 x@             x= .passed?
78*7c478bd9Sstevel@tonic-gate   " xbflips.1" test-64 /x xbflips test-64 x@
79*7c478bd9Sstevel@tonic-gate                                        h# 08070605 h# 04030201 xl= .passed?
80*7c478bd9Sstevel@tonic-gate   " xbflips.2" test-64 /x xbflips test-64 x@
81*7c478bd9Sstevel@tonic-gate                                        h# 01020304 h# 05060708 xl= .passed?
82*7c478bd9Sstevel@tonic-gate   " xwflips.1" test-64 /x xwflips test-64 x@
83*7c478bd9Sstevel@tonic-gate                                        h# 07080506 h# 03040102 xl= .passed?
84*7c478bd9Sstevel@tonic-gate   " xwflips.2" test-64 /x xwflips test-64 x@
85*7c478bd9Sstevel@tonic-gate                                        h# 01020304 h# 05060708 xl= .passed?
86*7c478bd9Sstevel@tonic-gate   " xlflips.1" test-64 /x xlflips test-64 x@
87*7c478bd9Sstevel@tonic-gate					h# 05060708 h# 01020304 xl= .passed?
88*7c478bd9Sstevel@tonic-gate   " xlflips.2" test-64 /x xlflips test-64 x@
89*7c478bd9Sstevel@tonic-gate                                        h# 01020304 h# 05060708 xl= .passed?
90*7c478bd9Sstevel@tonic-gatecr
91*7c478bd9Sstevel@tonic-gate
92*7c478bd9Sstevel@tonic-gate
93*7c478bd9Sstevel@tonic-gate0 value commatest-64-end
94*7c478bd9Sstevel@tonic-gatecreate commatest-64
95*7c478bd9Sstevel@tonic-gate	h# 01020304 h# 05060708 swap lxjoin x,
96*7c478bd9Sstevel@tonic-gate	h# 81121314 h# 85161718 swap lxjoin x,
97*7c478bd9Sstevel@tonic-gate	h# ffffffff h# 80000000 swap lxjoin x,
98*7c478bd9Sstevel@tonic-gate	here to commatest-64-end
99*7c478bd9Sstevel@tonic-gate
100*7c478bd9Sstevel@tonic-gate." 64-bit xcomma: "
101*7c478bd9Sstevel@tonic-gate    " x,.1"    commatest-64 3 xa+ commatest-64-end               = .passed?
102*7c478bd9Sstevel@tonic-gate    " x,.2"    test-64 x@ commatest-64 x@                       x= .passed?
103*7c478bd9Sstevel@tonic-gate    " x,.3"    test-64 xa1+ x@ commatest-64 xa1+ x@             x= .passed?
104*7c478bd9Sstevel@tonic-gate    " x,.4"    test-64 2 xa+ x@ commatest-64 2 xa+ x@           x= .passed?
105*7c478bd9Sstevel@tonic-gatecr
106*7c478bd9Sstevel@tonic-gate
107*7c478bd9Sstevel@tonic-gate." 64-bit constant/value/variable: "
108*7c478bd9Sstevel@tonic-gate1 2 lxjoin constant const-64
109*7c478bd9Sstevel@tonic-gate1 2 lxjoin value value-64
110*7c478bd9Sstevel@tonic-gatevariable var-64
111*7c478bd9Sstevel@tonic-gate   " const.1"  const-64                                    2 1 xl= .passed?
112*7c478bd9Sstevel@tonic-gate   " value.1"  value-64                                    2 1 xl= .passed?
113*7c478bd9Sstevel@tonic-gate   " value.2"  3 4 lxjoin to value-64 value-64             4 3 xl= .passed?
114*7c478bd9Sstevel@tonic-gate   " var.1"    const-64 var-64 ! var-64 @                  2 1 xl= .passed?
115*7c478bd9Sstevel@tonic-gatecr
116*7c478bd9Sstevel@tonic-gate
117*7c478bd9Sstevel@tonic-gate." 64-bit comparisions: "
118*7c478bd9Sstevel@tonic-gate   \ FCode comparators are 32-bit only, upper 32-bits are ignored.
119*7c478bd9Sstevel@tonic-gate   " 64comp.1" 1 2 lxjoin  1 = .passed?
120*7c478bd9Sstevel@tonic-gate   " 64comp.2" 1 2 lxjoin  2 < .passed?
121*7c478bd9Sstevel@tonic-gate   " 64comp.3" 2 1 2 lxjoin  > .passed?
122*7c478bd9Sstevel@tonic-gate   " 64comp.4" 0 2 lxjoin   0= .passed?
123*7c478bd9Sstevel@tonic-gate   " 64comp.5" 1 2 lxjoin   0> .passed?
124*7c478bd9Sstevel@tonic-gatecr
125*7c478bd9Sstevel@tonic-gate
126*7c478bd9Sstevel@tonic-gateend0
127