Commit f18cd223 authored by aurel32's avatar aurel32

target-alpha: convert FP ops to TCG

- Convert FP ops to TCG
- Fix S format
- Implement F and G formats (untested)
- Fix MF_FPCR an MT_FPCR
- Fix FTOIS, FTOIT, ITOFF, ITOFS, ITOFT
- Fix CPYSN, CPYSE
Signed-off-by: default avatarAurelien Jarno <aurelien@aurel32.net>

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5354 c046a42c-6fe2-441c-8c8c-71466251a162
parent 023d8ca2
......@@ -277,8 +277,6 @@ struct CPUAlphaState {
*/
target_ulong t0, t1;
#endif
/* */
double ft0, ft1, ft2;
/* Those resources are used only in Qemu core */
CPU_COMMON
......
......@@ -44,9 +44,6 @@ register uint64_t T1 asm(AREG2);
#define PARAM(n) ((uint64_t)PARAM##n)
#define SPARAM(n) ((int32_t)PARAM##n)
#define FT0 (env->ft0)
#define FT1 (env->ft1)
#define FT2 (env->ft2)
#define FP_STATUS (env->fp_status)
#if defined (DEBUG_OP)
......
......@@ -434,12 +434,6 @@ void cpu_dump_state (CPUState *env, FILE *f,
if ((i % 3) == 2)
cpu_fprintf(f, "\n");
}
cpu_fprintf(f, "FT " TARGET_FMT_lx " " TARGET_FMT_lx " " TARGET_FMT_lx,
*((uint64_t *)(&env->ft0)), *((uint64_t *)(&env->ft1)),
*((uint64_t *)(&env->ft2)));
cpu_fprintf(f, "\nMEM " TARGET_FMT_lx " %d %d\n",
ldq_raw(0x000000004007df60ULL),
(uint8_t *)(&env->ft0), (uint8_t *)(&env->fir[0]));
}
void cpu_dump_EA (target_ulong EA)
......
......@@ -41,3 +41,70 @@ DEF_HELPER(uint64_t, helper_mskqh, (int64_t, uint64_t))
DEF_HELPER(uint64_t, helper_insqh, (int64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cmpbge, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_load_fpcr, (void))
DEF_HELPER(void, helper_store_fpcr, (uint64_t val))
DEF_HELPER(uint32_t, helper_f_to_memory, (uint64_t s))
DEF_HELPER(uint64_t, helper_memory_to_f, (uint32_t s))
DEF_HELPER(uint64_t, helper_addf, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_subf, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_mulf, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_divf, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_sqrtf, (uint64_t))
DEF_HELPER(uint64_t, helper_g_to_memory, (uint64_t s))
DEF_HELPER(uint64_t, helper_memory_to_g, (uint64_t s))
DEF_HELPER(uint64_t, helper_addg, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_subg, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_mulg, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_divg, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_sqrtg, (uint64_t))
DEF_HELPER(uint32_t, helper_s_to_memory, (uint64_t s))
DEF_HELPER(uint64_t, helper_memory_to_s, (uint32_t s))
DEF_HELPER(uint64_t, helper_adds, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_subs, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_muls, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_divs, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_sqrts, (uint64_t))
DEF_HELPER(uint64_t, helper_addt, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_subt, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_mult, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_divt, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_sqrtt, (uint64_t))
DEF_HELPER(uint64_t, helper_cmptun, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cmpteq, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cmptle, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cmptlt, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cmpgeq, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cmpgle, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cmpglt, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cmpfeq, (uint64_t))
DEF_HELPER(uint64_t, helper_cmpfne, (uint64_t))
DEF_HELPER(uint64_t, helper_cmpflt, (uint64_t))
DEF_HELPER(uint64_t, helper_cmpfle, (uint64_t))
DEF_HELPER(uint64_t, helper_cmpfgt, (uint64_t))
DEF_HELPER(uint64_t, helper_cmpfge, (uint64_t))
DEF_HELPER(uint64_t, helper_cpys, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cpysn, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cpyse, (uint64_t, uint64_t))
DEF_HELPER(uint64_t, helper_cvtts, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtst, (uint64_t))
DEF_HELPER(uint64_t, helper_cvttq, (uint64_t))
DEF_HELPER(uint32_t, helper_cvtqs, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtqt, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtqf, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtgf, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtgq, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtqg, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtlq, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtql, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtqlv, (uint64_t))
DEF_HELPER(uint64_t, helper_cvtqlsv, (uint64_t))
......@@ -23,105 +23,8 @@
#include "config.h"
#include "exec.h"
#include "host-utils.h"
#include "op_helper.h"
#define REG 0
#include "op_template.h"
#define REG 1
#include "op_template.h"
#define REG 2
#include "op_template.h"
#define REG 3
#include "op_template.h"
#define REG 4
#include "op_template.h"
#define REG 5
#include "op_template.h"
#define REG 6
#include "op_template.h"
#define REG 7
#include "op_template.h"
#define REG 8
#include "op_template.h"
#define REG 9
#include "op_template.h"
#define REG 10
#include "op_template.h"
#define REG 11
#include "op_template.h"
#define REG 12
#include "op_template.h"
#define REG 13
#include "op_template.h"
#define REG 14
#include "op_template.h"
#define REG 15
#include "op_template.h"
#define REG 16
#include "op_template.h"
#define REG 17
#include "op_template.h"
#define REG 18
#include "op_template.h"
#define REG 19
#include "op_template.h"
#define REG 20
#include "op_template.h"
#define REG 21
#include "op_template.h"
#define REG 22
#include "op_template.h"
#define REG 23
#include "op_template.h"
#define REG 24
#include "op_template.h"
#define REG 25
#include "op_template.h"
#define REG 26
#include "op_template.h"
#define REG 27
#include "op_template.h"
#define REG 28
#include "op_template.h"
#define REG 29
#include "op_template.h"
#define REG 30
#include "op_template.h"
#define REG 31
#include "op_template.h"
/* Debug stuff */
void OPPROTO op_no_op (void)
{
......@@ -148,383 +51,6 @@ void OPPROTO op_no_op (void)
#include "op_mem.h"
#endif
/* Misc */
void OPPROTO op_load_fpcr (void)
{
helper_load_fpcr();
RETURN();
}
void OPPROTO op_store_fpcr (void)
{
helper_store_fpcr();
RETURN();
}
/* Tests */
#if 0 // Qemu does not know how to do this...
void OPPROTO op_bcond (void)
{
if (T0)
env->pc = T1 & ~3;
else
env->pc = PARAM(1);
RETURN();
}
#else
void OPPROTO op_bcond (void)
{
if (T0)
env->pc = T1 & ~3;
else
env->pc = ((uint64_t)PARAM(1) << 32) | (uint64_t)PARAM(2);
RETURN();
}
#endif
/* IEEE floating point arithmetic */
/* S floating (single) */
void OPPROTO op_adds (void)
{
FT0 = float32_add(FT0, FT1, &FP_STATUS);
RETURN();
}
void OPPROTO op_subs (void)
{
FT0 = float32_sub(FT0, FT1, &FP_STATUS);
RETURN();
}
void OPPROTO op_muls (void)
{
FT0 = float32_mul(FT0, FT1, &FP_STATUS);
RETURN();
}
void OPPROTO op_divs (void)
{
FT0 = float32_div(FT0, FT1, &FP_STATUS);
RETURN();
}
void OPPROTO op_sqrts (void)
{
helper_sqrts();
RETURN();
}
void OPPROTO op_cpys (void)
{
helper_cpys();
RETURN();
}
void OPPROTO op_cpysn (void)
{
helper_cpysn();
RETURN();
}
void OPPROTO op_cpyse (void)
{
helper_cpyse();
RETURN();
}
void OPPROTO op_itofs (void)
{
helper_itofs();
RETURN();
}
void OPPROTO op_ftois (void)
{
helper_ftois();
RETURN();
}
/* T floating (double) */
void OPPROTO op_addt (void)
{
FT0 = float64_add(FT0, FT1, &FP_STATUS);
RETURN();
}
void OPPROTO op_subt (void)
{
FT0 = float64_sub(FT0, FT1, &FP_STATUS);
RETURN();
}
void OPPROTO op_mult (void)
{
FT0 = float64_mul(FT0, FT1, &FP_STATUS);
RETURN();
}
void OPPROTO op_divt (void)
{
FT0 = float64_div(FT0, FT1, &FP_STATUS);
RETURN();
}
void OPPROTO op_sqrtt (void)
{
helper_sqrtt();
RETURN();
}
void OPPROTO op_cmptun (void)
{
helper_cmptun();
RETURN();
}
void OPPROTO op_cmpteq (void)
{
helper_cmpteq();
RETURN();
}
void OPPROTO op_cmptle (void)
{
helper_cmptle();
RETURN();
}
void OPPROTO op_cmptlt (void)
{
helper_cmptlt();
RETURN();
}
void OPPROTO op_itoft (void)
{
helper_itoft();
RETURN();
}
void OPPROTO op_ftoit (void)
{
helper_ftoit();
RETURN();
}
/* VAX floating point arithmetic */
/* F floating */
void OPPROTO op_addf (void)
{
helper_addf();
RETURN();
}
void OPPROTO op_subf (void)
{
helper_subf();
RETURN();
}
void OPPROTO op_mulf (void)
{
helper_mulf();
RETURN();
}
void OPPROTO op_divf (void)
{
helper_divf();
RETURN();
}
void OPPROTO op_sqrtf (void)
{
helper_sqrtf();
RETURN();
}
void OPPROTO op_cmpfeq (void)
{
helper_cmpfeq();
RETURN();
}
void OPPROTO op_cmpfne (void)
{
helper_cmpfne();
RETURN();
}
void OPPROTO op_cmpflt (void)
{
helper_cmpflt();
RETURN();
}
void OPPROTO op_cmpfle (void)
{
helper_cmpfle();
RETURN();
}
void OPPROTO op_cmpfgt (void)
{
helper_cmpfgt();
RETURN();
}
void OPPROTO op_cmpfge (void)
{
helper_cmpfge();
RETURN();
}
void OPPROTO op_itoff (void)
{
helper_itoff();
RETURN();
}
/* G floating */
void OPPROTO op_addg (void)
{
helper_addg();
RETURN();
}
void OPPROTO op_subg (void)
{
helper_subg();
RETURN();
}
void OPPROTO op_mulg (void)
{
helper_mulg();
RETURN();
}
void OPPROTO op_divg (void)
{
helper_divg();
RETURN();
}
void OPPROTO op_sqrtg (void)
{
helper_sqrtg();
RETURN();
}
void OPPROTO op_cmpgeq (void)
{
helper_cmpgeq();
RETURN();
}
void OPPROTO op_cmpglt (void)
{
helper_cmpglt();
RETURN();
}
void OPPROTO op_cmpgle (void)
{
helper_cmpgle();
RETURN();
}
/* Floating point format conversion */
void OPPROTO op_cvtst (void)
{
FT0 = (float)FT0;
RETURN();
}
void OPPROTO op_cvtqs (void)
{
helper_cvtqs();
RETURN();
}
void OPPROTO op_cvtts (void)
{
FT0 = (float)FT0;
RETURN();
}
void OPPROTO op_cvttq (void)
{
helper_cvttq();
RETURN();
}
void OPPROTO op_cvtqt (void)
{
helper_cvtqt();
RETURN();
}
void OPPROTO op_cvtqf (void)
{
helper_cvtqf();
RETURN();
}
void OPPROTO op_cvtgf (void)
{
helper_cvtgf();
RETURN();
}
void OPPROTO op_cvtgd (void)
{
helper_cvtgd();
RETURN();
}
void OPPROTO op_cvtgq (void)
{
helper_cvtgq();
RETURN();
}
void OPPROTO op_cvtqg (void)
{
helper_cvtqg();
RETURN();
}
void OPPROTO op_cvtdg (void)
{
helper_cvtdg();
RETURN();
}
void OPPROTO op_cvtlq (void)
{
helper_cvtlq();
RETURN();
}
void OPPROTO op_cvtql (void)
{
helper_cvtql();
RETURN();
}
void OPPROTO op_cvtqlv (void)
{
helper_cvtqlv();
RETURN();
}
void OPPROTO op_cvtqlsv (void)
{
helper_cvtqlsv();
RETURN();
}
/* PALcode support special instructions */
#if !defined (CONFIG_USER_ONLY)
void OPPROTO op_hw_rei (void)
......
This diff is collapsed.
......@@ -19,9 +19,6 @@
*/
void helper_call_pal (uint32_t palcode);
void helper_load_fpcr (void);
void helper_store_fpcr (void);
void helper_cmov_fir (int freg);
double helper_ldff_raw (target_ulong ea);
void helper_stff_raw (target_ulong ea, double op);
......@@ -42,65 +39,9 @@ double helper_ldfg_data (target_ulong ea);
void helper_stfg_data (target_ulong ea, double op);
#endif
void helper_sqrts (void);
void helper_cpys (void);
void helper_cpysn (void);
void helper_cpyse (void);
void helper_itofs (void);
void helper_ftois (void);
void helper_sqrtt (void);
void helper_cmptun (void);
void helper_cmpteq (void);
void helper_cmptle (void);
void helper_cmptlt (void);
void helper_itoft (void);
void helper_ftoit (void);
void helper_addf (void);
void helper_subf (void);
void helper_mulf (void);
void helper_divf (void);
void helper_sqrtf (void);
void helper_cmpfeq (void);
void helper_cmpfne (void);
void helper_cmpflt (void);
void helper_cmpfle (void);
void helper_cmpfgt (void);
void helper_cmpfge (void);
void helper_itoff (void);
void helper_addg (void);
void helper_subg (void);
void helper_mulg (void);
void helper_divg (void);
void helper_sqrtg (void);
void helper_cmpgeq (void);
void helper_cmpglt (void);
void helper_cmpgle (void);
void helper_cvtqs (void);
void helper_cvttq (void);
void helper_cvtqt (void);
void helper_cvtqf (void);
void helper_cvtgf (void);
void helper_cvtgd (void);
void helper_cvtgq (void);
void helper_cvtqg (void);
void helper_cvtdg (void);
void helper_cvtlq (void);
void helper_cvtql (void);
void helper_cvtqlv (void);
void helper_cvtqlsv (void);
void helper_mfpr (int iprn);
void helper_mtpr (int iprn);