1 /* Altivec registers, for PSIM, the PowerPC simulator.
3 Copyright 2003 Free Software Foundation, Inc.
5 Contributed by Red Hat Inc; developed under contract from Motorola.
6 Written by matthew green <mrg@redhat.com>.
8 This file is part of GDB.
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; either version 2 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 /* Manage this as 4 32-bit entities, 8 16-bit entities or 16 8-bit
34 typedef unsigned32 vscreg
;
37 /* AltiVec Registers */
42 /* AltiVec registers */
43 #define VR(N) cpu_registers(processor)->altivec.vr[N]
45 /* AltiVec vector status and control register */
46 #define VSCR cpu_registers(processor)->altivec.vscr
48 /* AltiVec endian helpers, wrong endian hosts vs targets need to be
49 sure to get the right bytes/halfs/words when the order matters.
50 Note that many AltiVec instructions do not depend on byte order and
51 work on N independant bits of data. This is only for the
52 instructions that actually move data around. */
54 #if (WITH_HOST_BYTE_ORDER == BIG_ENDIAN)
55 #define AV_BINDEX(x) ((x) & 15)
56 #define AV_HINDEX(x) ((x) & 7)
58 static char endian_b2l_bindex
[16] = { 3, 2, 1, 0, 7, 6, 5, 4,
59 11, 10, 9, 8, 15, 14, 13, 12 };
60 static char endian_b2l_hindex
[16] = { 1, 0, 3, 2, 5, 4, 7, 6 };
61 #define AV_BINDEX(x) endian_b2l_bindex[(x) & 15]
62 #define AV_HINDEX(x) endian_b2l_hindex[(x) & 7]
This page took 0.03023 seconds and 4 git commands to generate.