vis_simulator.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_VIS_SIMULATOR_H
#define _SYS_VIS_SIMULATOR_H
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* VIS opf codes, instruction type
*/
#ifdef __cplusplus
extern "C" {
#endif
/* kstat structure for reporting kstats */
extern struct visinfo_kstat visinfo;
typedef /* typical VIS instruction. */
struct {
enum vis_opf { /* VIS opf codes. */
edge8 = 0x0,
edge8n = 0x1,
edge8l = 0x2,
edge8ln = 0x3,
edge16 = 0x4,
edge16n = 0x5,
edge16l = 0x6,
edge16ln = 0x7,
edge32 = 0x8,
edge32n = 0x9,
edge32l = 0xa,
edge32ln = 0xb,
array8 = 0x10,
array16 = 0x12,
array32 = 0x14,
alignaddr = 0x18,
bmask = 0x19,
alignaddrl = 0x1a,
fcmple16 = 0x20,
fcmpne16 = 0x22,
fcmple32 = 0x24,
fcmpne32 = 0x26,
fcmpgt16 = 0x28,
fcmpeq16 = 0x2a,
fcmpgt32 = 0x2c,
fcmpeq32 = 0x2e,
fmul8x16 = 0x31,
fmul8x16au = 0x33,
fmul8x16al = 0x35,
fmul8sux16 = 0x36,
fmul8ulx16 = 0x37,
fmuld8sux16 = 0x38,
fmuld8ulx16 = 0x39,
fpack32 = 0x3a,
fpack16 = 0x3b,
fpackfix = 0x3d,
pdist = 0x3e,
faligndata = 0x48,
fpmerge = 0x4b,
bshuffle = 0x4c,
fexpand = 0x4d,
fpadd16 = 0x50,
fpadd16s = 0x51,
fpadd32 = 0x52,
fpadd32s = 0x53,
fpsub16 = 0x54,
fpsub16s = 0x55,
fpsub32 = 0x56,
fpsub32s = 0x57,
fzero = 0x60,
fzeros = 0x61,
fnor = 0x62,
fnors = 0x63,
fandnot2 = 0x64,
fandnot2s = 0x65,
fnot2 = 0x66,
fnot2s = 0x67,
fandnot1 = 0x68,
fandnot1s = 0x69,
fnot1 = 0x6a,
fnot1s = 0x6b,
fxor = 0x6c,
fxors = 0x6d,
fnand = 0x6e,
fnands = 0x6f,
fand = 0x70,
fands = 0x71,
fxnor = 0x72,
fxnors = 0x73,
fsrc1 = 0x74,
fsrc1s = 0x75,
fornot2 = 0x76,
fornot2s = 0x77,
fsrc2 = 0x78,
fsrc2s = 0x79,
fornot1 = 0x7a,
fornot1s = 0x7b,
fone = 0x7e,
fones = 0x7f,
siam = 0x81
};
#define GSR_ALIGN_SHIFT 0
#define GSR_SCALE_SHIFT 3
#define GSR_IRND_SHIFT 25
#define GSR_IM_SHIFT 27
#define GSR_MASK_SHIFT 32
/* PUBLIC FUNCTIONS */
/*
* vis_fpu_simulator simulates VIS FPU instructions only; reads and writes
* FPU data registers directly.
*/
/*
* Simulator for VIS loads and stores between floating-point unit and memory.
*/
void *, unsigned);
/*
* Simulator for rd %gsr instruction.
*/
void *, kfpu_t *);
/*
* Simulator for wr %gsr instruction.
*/
void *, kfpu_t *);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_VIS_SIMULATOR_H */