16429Svs195195 /* 26429Svs195195 * CDDL HEADER START 36429Svs195195 * 46429Svs195195 * The contents of this file are subject to the terms of the 56429Svs195195 * Common Development and Distribution License (the "License"). 66429Svs195195 * You may not use this file except in compliance with the License. 76429Svs195195 * 86429Svs195195 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 96429Svs195195 * or http://www.opensolaris.org/os/licensing. 106429Svs195195 * See the License for the specific language governing permissions 116429Svs195195 * and limitations under the License. 126429Svs195195 * 136429Svs195195 * When distributing Covered Code, include this CDDL HEADER in each 146429Svs195195 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 156429Svs195195 * If applicable, add the following below this CDDL HEADER, with the 166429Svs195195 * fields enclosed by brackets "[]" replaced with your own identifying 176429Svs195195 * information: Portions Copyright [yyyy] [name of copyright owner] 186429Svs195195 * 196429Svs195195 * CDDL HEADER END 206429Svs195195 */ 216429Svs195195 226429Svs195195 /* 236491Sia112686 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 246429Svs195195 * Use is subject to license terms. 256429Svs195195 */ 266429Svs195195 276429Svs195195 #ifndef _EXTERNS_H 286429Svs195195 #define _EXTERNS_H 296429Svs195195 306429Svs195195 #pragma ident "%Z%%M% %I% %E% SMI" 316429Svs195195 326429Svs195195 #ifdef __cplusplus 336429Svs195195 extern "C" { 346429Svs195195 #endif 356429Svs195195 366429Svs195195 #include <sys/types.h> 376429Svs195195 #include <fps_ereport.h> 386429Svs195195 396429Svs195195 /* Register handling routines */ 406429Svs195195 extern uint32_t register_test(int, uint32_t); 416429Svs195195 extern uint64_t get_gsr(void); 426429Svs195195 extern uint64_t move_regs_dp(uint64_t); 436429Svs195195 extern uint64_t register_test_dp(int, uint64_t); 446429Svs195195 extern unsigned long get_fsr(void); 456429Svs195195 extern unsigned long move_regs(unsigned long); 466429Svs195195 extern void init_regs(uint32_t); 476429Svs195195 extern void init_regs_dp(uint64_t); 486429Svs195195 extern void set_fsr(unsigned long); 496429Svs195195 extern void set_gsr(uint64_t); 506429Svs195195 516429Svs195195 /* FP arithmetic routines */ 526429Svs195195 extern uint64_t absolute_value_dp(uint64_t); 536429Svs195195 extern uint64_t add_dp(uint64_t, uint64_t); 546429Svs195195 extern uint64_t div_dp(uint64_t, uint64_t); 556429Svs195195 extern uint64_t fcmps_fcc(unsigned int, unsigned int, 566429Svs195195 unsigned int); 576429Svs195195 extern uint64_t fcmpd_fcc(uint64_t, uint64_t, unsigned int); 586429Svs195195 extern uint64_t mult_dp(uint64_t, uint64_t); 596429Svs195195 extern uint64_t negate_value_dp(uint64_t); 606429Svs195195 extern uint64_t sqrt_sp(unsigned long); 616429Svs195195 extern uint64_t sqrt_dp(uint64_t); 626429Svs195195 extern uint64_t sub_dp(uint64_t, uint64_t); 636429Svs195195 extern uint64_t wadd_sp(unsigned long, unsigned long); 646429Svs195195 extern uint64_t wadd_dp(unsigned long, unsigned long, 656429Svs195195 unsigned long, unsigned long); 666429Svs195195 extern uint64_t wdiv_sp(unsigned long, unsigned long); 676429Svs195195 extern uint64_t wdiv_dp(unsigned long, unsigned long, 686429Svs195195 unsigned long, unsigned long); 696429Svs195195 extern uint64_t wmult_sp(unsigned long, unsigned long); 706429Svs195195 extern uint64_t wmult_dp(unsigned long, unsigned long, 716429Svs195195 unsigned long, unsigned long); 726429Svs195195 extern uint64_t wsqrt_sp(unsigned long); 736429Svs195195 extern uint64_t wsqrt_dp(uint64_t); 746429Svs195195 extern unsigned long absolute_value_sp(unsigned long); 756429Svs195195 extern unsigned long add_sp(unsigned long, unsigned long); 766429Svs195195 extern unsigned long div_sp(unsigned long, unsigned long); 776429Svs195195 extern unsigned long mult_sp(unsigned long, unsigned long); 786429Svs195195 extern unsigned long negate_value_sp(unsigned long); 796429Svs195195 extern unsigned long sub_sp(unsigned long, unsigned long); 806429Svs195195 816429Svs195195 /* Compare routines */ 826429Svs195195 extern unsigned long cmp_d_ex(unsigned long, unsigned long); 836429Svs195195 extern unsigned long cmp_s_ex(unsigned long, unsigned long); 846429Svs195195 856429Svs195195 /* Conversion routines */ 866429Svs195195 extern int fsr_test(struct fps_test_ereport *report); 876429Svs195195 extern int restore_signals(); 886429Svs195195 extern int winitfp(void); 896429Svs195195 extern uint64_t convert_sp_dp(unsigned long); 906429Svs195195 extern uint64_t float_long_d(uint64_t); 916429Svs195195 extern uint64_t float_long_s(unsigned long); 926429Svs195195 extern uint64_t long_float_d(uint64_t); 936429Svs195195 extern uint64_t timing_add_dp(void); 946429Svs195195 extern uint64_t timing_mult_dp(void); 956429Svs195195 extern unsigned long branches(unsigned long, unsigned long, unsigned long); 966429Svs195195 extern unsigned long chain_dp(int); 976429Svs195195 extern unsigned long chain_sp(int); 986429Svs195195 extern unsigned long convert_dp_sp(uint64_t); 996429Svs195195 extern unsigned long datap_add(unsigned long); 1006429Svs195195 extern unsigned long datap_add_dp(unsigned long, unsigned long); 1016429Svs195195 extern unsigned long datap_mult(unsigned long); 1026429Svs195195 extern unsigned long datap_mult_dp(unsigned long, unsigned long); 1036429Svs195195 extern unsigned long float_int_d(uint64_t); 1046429Svs195195 extern unsigned long float_int_s(unsigned long); 1056429Svs195195 extern unsigned long int_float_d(int); 1066429Svs195195 extern unsigned long int_float_s(int); 1076429Svs195195 extern unsigned long long_float_s(uint64_t); 1086429Svs195195 extern unsigned long timing_add_sp(void); 1096429Svs195195 extern unsigned long timing_mult_sp(void); 1106429Svs195195 extern void read_fpreg(unsigned int *, int); 1116429Svs195195 extern void read_fpreg_dp(unsigned long *, int); 1126429Svs195195 extern void write_fpreg(unsigned int *, int); 1136429Svs195195 1146429Svs195195 /* verbose messaging */ 1156429Svs195195 extern void fps_msg(int msg_enable, const char *fmt, ...); 1166429Svs195195 1176429Svs195195 /* benchmarks */ 118*7186Skk158166 extern int align_data(int loop, 1196429Svs195195 struct fps_test_ereport *report); 1206429Svs195195 extern int fpu_fdivd(int rloop, 1216429Svs195195 struct fps_test_ereport *report); 1226429Svs195195 extern int fpu_fmuld(int rloop, 1236429Svs195195 struct fps_test_ereport *report); 1246429Svs195195 extern int fpu_fmulx(int rloop, 1256429Svs195195 struct fps_test_ereport *report); 126*7186Skk158166 extern int vis_test(struct fps_test_ereport *report); 1276429Svs195195 1286429Svs195195 /* cbbcopy */ 1296429Svs195195 extern int cbbcopy(struct fps_test_ereport *report); 1306429Svs195195 1316429Svs195195 /* cheetah sdc */ 1326429Svs195195 extern int cheetah_sdc_test(int limit, 1336429Svs195195 struct fps_test_ereport *report); 1346429Svs195195 1356429Svs195195 /* fpu sys diag */ 1366429Svs195195 extern int fpu_sysdiag(struct fps_test_ereport *report); 1376429Svs195195 1386429Svs195195 /* linpack */ 1396429Svs195195 extern int dlinpack_test(int, int, struct fps_test_ereport *report, 1406429Svs195195 int fps_verbose_msg); 1416429Svs195195 extern int slinpack_test(int, int, struct fps_test_ereport *report, 1426429Svs195195 int fps_verbose_msg); 1436429Svs195195 1446429Svs195195 1456429Svs195195 /* Global traps */ 1466429Svs195195 extern uint_t trap_flag; 1476429Svs195195 extern uint64_t fsr_at_trap; 1486429Svs195195 1496429Svs195195 #ifdef __cplusplus 1506429Svs195195 } 1516429Svs195195 #endif 1526429Svs195195 1536429Svs195195 #endif /* _EXTERNS_H */ 154