Home | History | Annotate | Line # | Download | only in gdb.arch
sparc64-regs.S revision 1.1.1.3.2.1
      1 /* Copyright 2017-2023 Free Software Foundation, Inc.
      2 
      3    This program is free software; you can redistribute it and/or modify
      4    it under the terms of the GNU General Public License as published by
      5    the Free Software Foundation; either version 3 of the License, or
      6    (at your option) any later version.
      7 
      8    This program is distributed in the hope that it will be useful,
      9    but WITHOUT ANY WARRANTY; without even the implied warranty of
     10    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11    GNU General Public License for more details.
     12 
     13    You should have received a copy of the GNU General Public License
     14    along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15 
     16    This file is part of the gdb testsuite.
     17    KAT for decoding various sparc64 registers. */
     18 
     19 .section ".text"
     20 .align 4
     21 
     22 .global main
     23 .type   main, #function
     24 main:
     25 	call test_ccr
     26 	nop
     27 	call test_fsr
     28 	nop
     29 	retl
     30 	nop
     31 .size main, .-main
     32 
     33 .type test_ccr, #function
     34 test_ccr:
     35 	.cfi_startproc
     36 	wr   %g0, 0x01, %ccr
     37 	wr   %g0, 0x02, %ccr
     38 	wr   %g0, 0x03, %ccr
     39 	wr   %g0, 0x04, %ccr
     40 	wr   %g0, 0x05, %ccr
     41 	wr   %g0, 0x06, %ccr
     42 	wr   %g0, 0x07, %ccr
     43 	wr   %g0, 0x08, %ccr
     44 	wr   %g0, 0x09, %ccr
     45 	wr   %g0, 0x0a, %ccr
     46 	wr   %g0, 0x0b, %ccr
     47 	wr   %g0, 0x0c, %ccr
     48 	wr   %g0, 0x0d, %ccr
     49 	wr   %g0, 0x0e, %ccr
     50 	wr   %g0, 0x0f, %ccr
     51 
     52 	wr   %g0, 0x10, %ccr
     53 	wr   %g0, 0x20, %ccr
     54 	wr   %g0, 0x30, %ccr
     55 	wr   %g0, 0x40, %ccr
     56 	wr   %g0, 0x50, %ccr
     57 	wr   %g0, 0x60, %ccr
     58 	wr   %g0, 0x70, %ccr
     59 	wr   %g0, 0x80, %ccr
     60 	wr   %g0, 0x90, %ccr
     61 	wr   %g0, 0xa0, %ccr
     62 	wr   %g0, 0xb0, %ccr
     63 	wr   %g0, 0xc0, %ccr
     64 	wr   %g0, 0xd0, %ccr
     65 	wr   %g0, 0xe0, %ccr
     66 	wr   %g0, 0xf0, %ccr
     67 
     68 	retl
     69 	nop
     70 	.cfi_endproc
     71 .size test_ccr, .-test_ccr
     72 
     73 .type test_fsr, #function
     74 test_fsr:
     75 	.cfi_startproc
     76 	wr   %g0, 4, %fprs
     77 	setx flags, %l1, %l0
     78 	mov  1, %l1
     79 	stx  %l1, [%l0]
     80 	ldx  [%l0], %fsr
     81 	sllx %l1, 1, %l1	! sparc64-regs.exp: after first %fsr
     82 	stx  %l1, [%l0]
     83 	ldx  [%l0], %fsr
     84 	sllx %l1, 1, %l1
     85 	stx  %l1, [%l0]
     86 	ldx  [%l0], %fsr
     87 	sllx %l1, 1, %l1
     88 	stx  %l1, [%l0]
     89 	ldx  [%l0], %fsr
     90 	sllx %l1, 1, %l1
     91 	stx  %l1, [%l0]
     92 	ldx  [%l0], %fsr
     93 	sllx %l1, 1, %l1
     94 	stx  %l1, [%l0]
     95 	ldx  [%l0], %fsr
     96 	sllx %l1, 1, %l1
     97 	stx  %l1, [%l0]
     98 	ldx  [%l0], %fsr
     99 	sllx %l1, 1, %l1
    100 	stx  %l1, [%l0]
    101 	ldx  [%l0], %fsr
    102 	sllx %l1, 1, %l1
    103 	stx  %l1, [%l0]
    104 	ldx  [%l0], %fsr
    105 	sllx %l1, 1, %l1
    106 	stx  %l1, [%l0]
    107 	ldx  [%l0], %fsr
    108 	sllx %l1, 14, %l1	! move to fsr.tem fields
    109 	stx  %l1, [%l0]
    110 	ldx  [%l0], %fsr
    111 	sllx %l1, 1, %l1
    112 	stx  %l1, [%l0]
    113 	ldx  [%l0], %fsr
    114 	sllx %l1, 1, %l1
    115 	stx  %l1, [%l0]
    116 	ldx  [%l0], %fsr
    117 	sllx %l1, 1, %l1
    118 	stx  %l1, [%l0]
    119 	ldx  [%l0], %fsr
    120 	sllx %l1, 1, %l1
    121 	stx  %l1, [%l0]
    122 	ldx  [%l0], %fsr
    123 	sllx %l1, 1, %l1
    124 	stx  %l1, [%l0]
    125 	ldx  [%l0], %fsr
    126 	sllx %l1, 1, %l1
    127 
    128 	retl
    129 	nop
    130 	.cfi_endproc
    131 .size test_fsr, .-test_fsr
    132 
    133 .section ".data"
    134 .align 8
    135 flags: .xword 0x0000000000000000
    136 .size flags, .-flags
    137 	.section	.note.GNU-stack,"",@progbits
    138