| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: memop_all_stores.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 MAIN_PAGE_NUCLEUS_ALSO |
| 39 | #define MAIN_PAGE_HV_ALSO |
| 40 | |
| 41 | #include "hboot.s" |
| 42 | #include "asi_s.h" |
| 43 | |
| 44 | /************************************************************************ |
| 45 | Test case code start |
| 46 | ************************************************************************/ |
| 47 | |
| 48 | .text |
| 49 | .global main |
| 50 | |
| 51 | main: |
| 52 | ta T_CHANGE_HPRIV |
| 53 | |
| 54 | ! Set up seperate temporary memory location for each thread, in %g3 |
| 55 | |
| 56 | setx temp, %g1, %g3 |
| 57 | ta T_RD_THID |
| 58 | sllx %o1, 6, %l1 |
| 59 | add %g3, %l1, %g3 |
| 60 | |
| 61 | |
| 62 | ! Integer stores |
| 63 | |
| 64 | stb: |
| 65 | set 0xff, %l0 |
| 66 | stb %l0, [%g3] |
| 67 | ldub [%g3], %l7 |
| 68 | cmp %l0, %l7 |
| 69 | bne test_failed |
| 70 | nop |
| 71 | sth: |
| 72 | setx 0xeeee, %g1, %l1 |
| 73 | sth %l1, [%g3] |
| 74 | lduh [%g3], %l7 |
| 75 | cmp %l1, %l7 |
| 76 | bne test_failed |
| 77 | nop |
| 78 | stw: |
| 79 | setx 0xdddddddd, %g1, %l2 |
| 80 | stw %l2, [%g3] |
| 81 | lduw [%g3], %l7 |
| 82 | cmp %l2, %l7 |
| 83 | bne test_failed |
| 84 | nop |
| 85 | stx: |
| 86 | setx 0xcccccccccccccccc, %g1, %l3 |
| 87 | stx %l3, [%g3] |
| 88 | ldx [%g3], %l7 |
| 89 | cmp %l3, %l7 |
| 90 | bne test_failed |
| 91 | nop |
| 92 | std: |
| 93 | setx 0xcccccccccccccccc, %g1, %l4 |
| 94 | setx 0xbbbbbbbbbbbbbbbb, %g1, %l4 |
| 95 | std %l4, [%g3] |
| 96 | ldd [%g3], %l6 |
| 97 | cmp %l4, %l6 |
| 98 | bne test_failed |
| 99 | cmp %l5, %l7 |
| 100 | bne test_failed |
| 101 | nop |
| 102 | |
| 103 | ! Floating point stores |
| 104 | |
| 105 | setx floating_point_data, %g1, %g2 |
| 106 | stf: |
| 107 | ld [%g2], %f0 |
| 108 | st %f0, [%g3] |
| 109 | setx 0x3f800000, %g1, %g7 |
| 110 | ld [%g3], %l5 |
| 111 | cmp %g7, %l5 |
| 112 | bne test_failed |
| 113 | nop |
| 114 | stdf: |
| 115 | ldd [%g2+0x8], %f2 |
| 116 | std %f2, [%g3] |
| 117 | setx 0x4000000000000000, %g1, %g7 |
| 118 | ldx [%g3], %l4 |
| 119 | cmp %g7, %l4 |
| 120 | bne test_failed |
| 121 | nop |
| 122 | stfsr: |
| 123 | setx floating_point_data, %g1, %g2 |
| 124 | ld [%g2+0x10], %fsr |
| 125 | st %fsr, [%g3] |
| 126 | ld [%g3], %l3 |
| 127 | cmp %l3, 0 |
| 128 | bne test_failed |
| 129 | nop |
| 130 | stxfsr: |
| 131 | ldx [%g2+0x10], %fsr |
| 132 | stx %fsr, [%g3] |
| 133 | ldx [%g3], %l2 |
| 134 | cmp %l2, 0 |
| 135 | bne test_failed |
| 136 | nop |
| 137 | |
| 138 | ! VIS stores |
| 139 | |
| 140 | setx vis_data, %g1, %g2 |
| 141 | vis_short_8: |
| 142 | ldda [%g2]ASI_FL8_PRIMARY, %f4 |
| 143 | stda %f4, [%g3]ASI_FL8_PRIMARY |
| 144 | ldub [%g3], %l1 |
| 145 | cmp %l1, 0xaa |
| 146 | bne test_failed |
| 147 | nop |
| 148 | vis_short_16: |
| 149 | wr %g0, ASI_FL16_PRIMARY, %asi |
| 150 | ldda [%g2+0x4]%asi, %f6 |
| 151 | stda %f6, [%g3]%asi |
| 152 | lduh [%g3], %l0 |
| 153 | setx 0x5555, %g1, %g7 |
| 154 | cmp %l0, %g7 |
| 155 | bne test_failed |
| 156 | nop |
| 157 | vis_partial_8: |
| 158 | ldd [%g2+0x8], %f8 |
| 159 | ldd [%g2+0x20], %g6 |
| 160 | stda %f8, [%g3+%g6]ASI_PST8_PRIMARY |
| 161 | setx 0x0123456789abcdef, %g1, %g7 |
| 162 | ldx [%g3], %l1 |
| 163 | cmp %l1, %g7 |
| 164 | bne test_failed |
| 165 | nop |
| 166 | vis_partial_16: |
| 167 | ldd [%g2+0x10], %f2 |
| 168 | stda %f2, [%g3+%g6]ASI_PST16_PRIMARY |
| 169 | setx 0xfedcba9876543210, %g1, %g7 |
| 170 | ldx [%g3], %l2 |
| 171 | cmp %l2, %g7 |
| 172 | bne test_failed |
| 173 | nop |
| 174 | vis_partial_32: |
| 175 | ldd [%g2+0x18], %f4 |
| 176 | stda %f4, [%g3+%g6]ASI_PST32_PRIMARY |
| 177 | setx 0x0f1e2d3c4b5a6978, %g1, %g7 |
| 178 | ldx [%g3], %l3 |
| 179 | cmp %l3, %g7 |
| 180 | bne test_failed |
| 181 | nop |
| 182 | |
| 183 | |
| 184 | test_passed: |
| 185 | EXIT_GOOD |
| 186 | |
| 187 | test_failed: |
| 188 | EXIT_BAD |
| 189 | |
| 190 | |
| 191 | /************************************************************************ |
| 192 | Test case data start |
| 193 | ************************************************************************/ |
| 194 | .data |
| 195 | user_data_start: |
| 196 | .xword 0x0000000000000000 |
| 197 | .xword 0x1111111111111111 |
| 198 | .xword 0x2222222222222222 |
| 199 | .xword 0x3333333333333333 |
| 200 | .xword 0x4444444444444444 |
| 201 | .xword 0x5555555555555555 |
| 202 | .xword 0x6666666666666666 |
| 203 | .xword 0x7777777777777777 |
| 204 | .xword 0x8888888888888888 |
| 205 | .xword 0x9999999999999999 |
| 206 | .xword 0xaaaaaaaaaaaaaaaa |
| 207 | .xword 0xbbbbbbbbbbbbbbbb |
| 208 | .xword 0xcccccccccccccccc |
| 209 | .xword 0xdddddddddddddddd |
| 210 | .xword 0xeeeeeeeeeeeeeeee |
| 211 | .xword 0xffffffffffffffff |
| 212 | floating_point_data: |
| 213 | .xword 0x3f8000003f800000 ! 1.0, 1.0 single precision |
| 214 | .xword 0x4000000000000000 ! 2.0 double precision |
| 215 | .xword 000000000000000000 |
| 216 | vis_data: |
| 217 | .xword 0xaa00000055550000 |
| 218 | .xword 0x0123456789abcdef |
| 219 | .xword 0xfedcba9876543210 |
| 220 | .xword 0x0f1e2d3c4b5a6978 |
| 221 | .xword 0xffffffffffffffff |
| 222 | |
| 223 | .skip 128 |
| 224 | temp: |
| 225 | .skip 8192 |
| 226 | .end |
| 227 | |
| 228 | |
| 229 | |