| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: exu_logical_n2.s |
| 5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved |
| 6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. |
| 7 | * |
| 8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation; version 2 of the License. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 22 | * |
| 23 | * For the avoidance of doubt, and except that if any non-GPL license |
| 24 | * choice is available it will apply instead, Sun elects to use only |
| 25 | * the General Public License version 2 (GPLv2) at this time for any |
| 26 | * software where a choice of GPL license versions is made |
| 27 | * available with the language indicating that GPLv2 or any later version |
| 28 | * may be used, or where a choice of which version of the GPL is applied is |
| 29 | * otherwise unspecified. |
| 30 | * |
| 31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 32 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 33 | * have any questions. |
| 34 | * |
| 35 | * |
| 36 | * ========== Copyright Header End ============================================ |
| 37 | */ |
| 38 | #define NUM_REG_CASES 9 |
| 39 | #define NUM_IMMED_CASES 5 |
| 40 | |
| 41 | |
| 42 | /*******************************************************/ |
| 43 | #include "hboot.s" |
| 44 | |
| 45 | .global main |
| 46 | main: |
| 47 | th_fork(th_main,%l0) ! start up to four threads. |
| 48 | ! All threads do the same thing. No need to run more than one core, |
| 49 | ! and no need to differentiate the threads because nobody stores |
| 50 | ! anything. |
| 51 | th_main_0: |
| 52 | th_main_1: |
| 53 | th_main_2: |
| 54 | th_main_3: |
| 55 | !************************** |
| 56 | ! Operand2 as a register |
| 57 | !************************** |
| 58 | set rs2_data,%g1 |
| 59 | add %g0,NUM_REG_CASES,%l3 |
| 60 | rs2_loop: |
| 61 | ldx [%g1],%l1 |
| 62 | ldx [%g1+8],%l2 |
| 63 | ! ccr set to ff, make sure all bits change |
| 64 | wr %g0,0xff,%ccr |
| 65 | and %l1,%l2,%l4 |
| 66 | |
| 67 | wr %g0,0xff,%ccr |
| 68 | andcc %l1,%l2,%l5 |
| 69 | |
| 70 | wr %g0,0xff,%ccr |
| 71 | andn %l1,%l2,%l6 |
| 72 | |
| 73 | wr %g0,0xff,%ccr |
| 74 | andncc %l1,%l2,%l7 |
| 75 | |
| 76 | wr %g0,0xff,%ccr |
| 77 | or %l1,%l2,%i0 |
| 78 | |
| 79 | wr %g0,0xff,%ccr |
| 80 | orcc %l1,%l2,%i1 |
| 81 | |
| 82 | wr %g0,0xff,%ccr |
| 83 | orn %l1,%l2,%i2 |
| 84 | |
| 85 | wr %g0,0xff,%ccr |
| 86 | orncc %l1,%l2,%i3 |
| 87 | |
| 88 | wr %g0,0xff,%ccr |
| 89 | xor %l1,%l2,%i4 |
| 90 | |
| 91 | wr %g0,0xff,%ccr |
| 92 | xorcc %l1,%l2,%i5 |
| 93 | |
| 94 | wr %g0,0xff,%ccr |
| 95 | xnor %l1,%l2,%i6 |
| 96 | |
| 97 | wr %g0,0xff,%ccr |
| 98 | xnorcc %l1,%l2,%i7 |
| 99 | |
| 100 | sub %l3,0x1,%l3 |
| 101 | brnz,pt %l3,rs2_loop |
| 102 | add %g1,0x10,%g1 ! move operand pointer |
| 103 | |
| 104 | !************************** |
| 105 | ! Operand2 as immediate |
| 106 | !************************** |
| 107 | |
| 108 | set immed_data,%g1 |
| 109 | add %g0,NUM_IMMED_CASES,%l3 |
| 110 | immed_loop: |
| 111 | ldx [%g1],%l1 |
| 112 | ! back to back logicals |
| 113 | and %l1,0,%l4 |
| 114 | or %l1,0,%l5 |
| 115 | xor %l1,0,%l6 |
| 116 | andcc %l1,0,%l7 |
| 117 | orcc %l1,0,%i0 |
| 118 | xorcc %l1,0,%i1 |
| 119 | andn %l1,0,%i2 |
| 120 | xnor %l1,0,%i3 |
| 121 | orn %l1,0,%i4 |
| 122 | xnorcc %l1,0,%i5 |
| 123 | andncc %l1,0,%i6 |
| 124 | orncc %l1,0,%i7 |
| 125 | |
| 126 | and %l1,0x1fff,%l4 |
| 127 | or %l1,0x1fff,%l5 |
| 128 | xor %l1,0x1fff,%l6 |
| 129 | andcc %l1,0x1fff,%l7 |
| 130 | orcc %l1,0x1fff,%i0 |
| 131 | xorcc %l1,0x1fff,%i1 |
| 132 | andn %l1,0x1fff,%i2 |
| 133 | xnor %l1,0x1fff,%i3 |
| 134 | orn %l1,0x1fff,%i4 |
| 135 | xnorcc %l1,0x1fff,%i5 |
| 136 | andncc %l1,0x1fff,%i6 |
| 137 | orncc %l1,0x1fff,%i7 |
| 138 | |
| 139 | and %l1,0x1555,%l4 ! random bit patterns |
| 140 | or %l1,0x0aaa,%l5 |
| 141 | xor %l1,0x1333,%l6 |
| 142 | andcc %l1,0x0ccc,%l7 |
| 143 | orcc %l1,0x1e1e,%i0 |
| 144 | xorcc %l1,0x0731,%i1 |
| 145 | andn %l1,0x1c80,%i2 |
| 146 | xnor %l1,0x00ff,%i3 |
| 147 | orn %l1,0x1f00,%i4 |
| 148 | xnorcc %l1,0x1f00,%i5 |
| 149 | andncc %l1,0x1f00,%i6 |
| 150 | orncc %l1,0x00ff,%i7 |
| 151 | |
| 152 | sub %l3,0x1,%l3 |
| 153 | brnz,pt %l3,immed_loop |
| 154 | add %g1,8,%g1 ! move operand pointer |
| 155 | |
| 156 | good_end: |
| 157 | ta T_GOOD_TRAP |
| 158 | nop |
| 159 | nop |
| 160 | |
| 161 | |
| 162 | !========================== |
| 163 | .data |
| 164 | .align 0x1fff+1 |
| 165 | |
| 166 | .global tsdata |
| 167 | rs2_data: |
| 168 | .word 0x00000000, 0x00000000 ! zeros and foxes |
| 169 | .word 0x00000000, 0x00000000 |
| 170 | |
| 171 | .word 0xffffffff, 0xffffffff |
| 172 | .word 0xffffffff, 0xffffffff |
| 173 | |
| 174 | .word 0xffffffff, 0xffffffff |
| 175 | .word 0x00000000, 0x00000000 |
| 176 | |
| 177 | .word 0x00000000, 0x00000000 |
| 178 | .word 0xffffffff, 0xffffffff |
| 179 | |
| 180 | .word 0x80000000, 0x80000000 ! independence of n and z bits |
| 181 | .word 0x00000000, 0x00000001 |
| 182 | |
| 183 | .word 0x00000000, 0x80000001 |
| 184 | .word 0x00000001, 0x80000000 |
| 185 | |
| 186 | .word 0x80000001, 0x00000001 |
| 187 | .word 0x80000000, 0x00000001 |
| 188 | |
| 189 | .word 0x00000001, 0x00000000 |
| 190 | .word 0x80000001, 0x80000000 |
| 191 | |
| 192 | .word 0x56789abc, 0x87654320 ! random number |
| 193 | .word 0x9abcdef1, 0x9631246a |
| 194 | |
| 195 | .global immed_data |
| 196 | immed_data: |
| 197 | .word 0x00000000, 0x00000000 |
| 198 | .word 0xffffffff, 0xffffffff |
| 199 | .word 0x00000000, 0x00001555 |
| 200 | .word 0xffffffff, 0xffffe000 |
| 201 | .word 0xaaaaaaaa, 0xaaaaaaaa |
| 202 | |
| 203 | .end |