cpu_fp_operate.h File Reference


Detailed Description

Contains code macros for the processor floating-point operate instructions.

Based on ARM chapter 4.10.

Id
cpu_fp_operate.h,v 1.21 2008/03/14 15:30:52 iamcamiel Exp

X-1.20 Camiel Vanderhoeven 14-MAR-2008 1. More meaningful exceptions replace throwing (int) 1. 2. U64 macro replaces X64 macro.

X-1.19 Brian Wheeler 27-FEB-2008 Avoid compiler warnings.

X-1.18 Camiel Vanderhoeven 06-FEB-2008 Check for FPEN in old floating point code.

X-1.17 Camiel Vanderhoeven 05-FEB-2008 Only use new floating-point code when HAVE_NEW_FP has been defined.

X-1.16 Camiel Vanderhoeven 05-feb-2008 Put X64 around 64-bit constants in DO_CVTQL.

X-1.15 Camiel Vanderhoeven 28-JAN-2008 Better floating-point exception handling.

X-1.14 Camiel Vanderhoeven 27-JAN-2008 Minor floating-point improvements.

X-1.13 Camiel Vanderhoeven 22-JAN-2008 Completed new floating-point code.

X-1.12 Camiel Vanderhoeven 21-JAN-2008 Implement new floating-point code for most operations.

X-1.11 Camiel Vanderhoeven 18-JAN-2008 Replaced sext_64 inlines with sext_u64_<bits> inlines for performance reasons (thanks to David Hittner for spotting this!);

X-1.10 Camiel Vanderhoeven 2-DEC-2007 Use sext_64 inline.

X-1.9 Camiel Vanderhoeven 16-NOV-2007 Avoid more compiler warnings.

X-1.8 Camiel Vanderhoeven 08-NOV-2007 Added ITOFS, ITOFF.

X-1.7 Camiel Vanderhoeven 08-NOV-2007 Restructured conversion routines.

X-1.6 Camiel Vanderhoeven 02-NOV-2007 Added missing floating point instructions.

X-1.5 Marcelo Eduardo Serrat 31-OCT-2007 Added CVTDG, CVTGD, CVTGF, MULG instructions.

X-1.4 Camiel Vanderhoeven 11-APR-2007 Moved all data that should be saved to a state file to a structure "state".

X-1.3 Camiel Vanderhoeven 30-MAR-2007 Added old changelog comments.

X-1.2 Camiel Vanderhoeven 13-MAR-2007 Basic floating point support added.

X-1.1 Camiel Vanderhoeven 18-FEB-2007 File created. Contains code previously found in AlphaCPU.h

Author:
Camiel Vanderhoeven (camiel@camicom.com / http://www.camicom.com)

Definition in file cpu_fp_operate.h.

Go to the source code of this file.

Defines

#define DO_CPYS
#define DO_CPYSN
#define DO_CPYSE
#define DO_CVTQL
#define DO_CVTLQ
#define DO_FCMOVEQ
#define DO_FCMOVGE
#define DO_FCMOVGT
#define DO_FCMOVLE
#define DO_FCMOVLT
#define DO_FCMOVNE
#define DO_MF_FPCR
#define DO_MT_FPCR
#define DO_ADDG
#define DO_ADDF
#define DO_ADDT
#define DO_ADDS
#define DO_SUBG
#define DO_SUBF
#define DO_SUBT
#define DO_SUBS
#define DO_CMPGEQ
#define DO_CMPGLE
#define DO_CMPGLT
#define DO_CMPTEQ
#define DO_CMPTLE
#define DO_CMPTLT
#define DO_CMPTUN
#define DO_CVTGQ
#define DO_CVTQG
#define DO_CVTQF
#define DO_CVTTQ
#define DO_CVTQT
#define DO_CVTQS
#define DO_CVTGD
#define DO_CVTDG
#define DO_CVTGF
#define DO_FTOIS
#define DO_FTOIT
#define DO_ITOFT
#define DO_ITOFS
#define DO_ITOFF
#define DO_MULG
#define DO_MULF
#define DO_MULT
#define DO_MULS
#define DO_DIVG
#define DO_DIVF
#define DO_DIVT
#define DO_DIVS
#define DO_SQRTG
#define DO_SQRTF
#define DO_SQRTT
#define DO_SQRTS
#define DO_CVTST
#define DO_CVTTS


Define Documentation

#define DO_ADDF

Value:

FPSTART; \
  state.f[FREG_3] = host2f(f2host(state.f[FREG_1]) + f2host(state.f[FREG_2]));

Definition at line 349 of file cpu_fp_operate.h.

#define DO_ADDG

Value:

FPSTART; \
  state.f[FREG_3] = host2g(g2host(state.f[FREG_1]) + g2host(state.f[FREG_2]));

Definition at line 347 of file cpu_fp_operate.h.

#define DO_ADDS

Value:

FPSTART; \
  state.f[FREG_3] = host2s(s2host(state.f[FREG_1]) + s2host(state.f[FREG_2]));

Definition at line 353 of file cpu_fp_operate.h.

#define DO_ADDT

Value:

FPSTART; \
  state.f[FREG_3] = host2t(t2host(state.f[FREG_1]) + t2host(state.f[FREG_2]));

Definition at line 351 of file cpu_fp_operate.h.

#define DO_CMPGEQ

Value:

FPSTART; \
  state.f[FREG_3] = (g2host(state.f[FREG_1]) == g2host(state.f[FREG_2])) ? U64(0x4000000000000000) : 0;

Definition at line 365 of file cpu_fp_operate.h.

#define DO_CMPGLE

Value:

FPSTART; \
  state.f[FREG_3] = (g2host(state.f[FREG_1]) <= g2host(state.f[FREG_2])) ? U64(0x4000000000000000) : 0;

Definition at line 367 of file cpu_fp_operate.h.

#define DO_CMPGLT

Value:

FPSTART; \
  state.f[FREG_3] = (g2host(state.f[FREG_1]) < g2host(state.f[FREG_2])) ? U64(0x4000000000000000) : 0;

Definition at line 369 of file cpu_fp_operate.h.

#define DO_CMPTEQ

Value:

FPSTART; \
  state.f[FREG_3] = (t2host(state.f[FREG_1]) == t2host(state.f[FREG_2])) ? U64(0x4000000000000000) : 0;

Definition at line 372 of file cpu_fp_operate.h.

#define DO_CMPTLE

Value:

FPSTART; \
  state.f[FREG_3] = (t2host(state.f[FREG_1]) <= t2host(state.f[FREG_2])) ? U64(0x4000000000000000) : 0;

Definition at line 374 of file cpu_fp_operate.h.

#define DO_CMPTLT

Value:

FPSTART; \
  state.f[FREG_3] = (t2host(state.f[FREG_1]) < t2host(state.f[FREG_2])) ? U64(0x4000000000000000) : 0;

Definition at line 376 of file cpu_fp_operate.h.

#define DO_CMPTUN

Value:

FPSTART; \
  state.f[FREG_3] = (i_isnan(state.f[FREG_1]) || i_isnan(state.f[FREG_2])) ? U64(0x4000000000000000) : 0;

Definition at line 378 of file cpu_fp_operate.h.

#define DO_CPYS

Value:

FPSTART; \
  state.f[FREG_3] = (state.f[FREG_1] & U64(0x8000000000000000)) | (state.f[FREG_2] & U64(0x7fffffffffffffff));

Definition at line 302 of file cpu_fp_operate.h.

#define DO_CPYSE

Value:

FPSTART; \
  state.f[FREG_3] = (state.f[FREG_1] & U64(0xfff0000000000000)) | (state.f[FREG_2] & U64(0x000fffffffffffff));

Definition at line 313 of file cpu_fp_operate.h.

#define DO_CPYSN

Value:

FPSTART;                      \
  state.f[FREG_3] =                               \
    (                                             \
      state.f[FREG_1] & U64(0x8000000000000000) ^ \
      U64(0x8000000000000000)                     \
    ) |                                           \
    (state.f[FREG_2] & U64(0x7fffffffffffffff));

Definition at line 305 of file cpu_fp_operate.h.

#define DO_CVTDG

Value:

FPSTART; \
  state.f[FREG_3] = host2g(d2host(state.f[FREG_2]));

Definition at line 396 of file cpu_fp_operate.h.

#define DO_CVTGD

Value:

FPSTART; \
  state.f[FREG_3] = host2d(g2host(state.f[FREG_2]));

Definition at line 394 of file cpu_fp_operate.h.

#define DO_CVTGF

Value:

FPSTART; \
  state.f[FREG_3] = host2f(g2host(state.f[FREG_2]));

Definition at line 398 of file cpu_fp_operate.h.

#define DO_CVTGQ

Value:

FPSTART; \
  state.f[FREG_3] = (u64) ((s64) g2host(state.f[FREG_2]));

Definition at line 381 of file cpu_fp_operate.h.

#define DO_CVTLQ

Value:

FPSTART;                                                          \
  state.f[FREG_3] = sext_u64_32(((state.f[FREG_2] >> 32) & U64(0x00000000c0000000)) | \
                                        ((state.f[FREG_2] >> 29) & U64(0x000000003fffffff)));

Definition at line 319 of file cpu_fp_operate.h.

#define DO_CVTQF

Value:

FPSTART; \
  state.f[FREG_3] = host2f((double) ((s64) state.f[FREG_2]));

Definition at line 385 of file cpu_fp_operate.h.

#define DO_CVTQG

Value:

FPSTART; \
  state.f[FREG_3] = host2g((double) ((s64) state.f[FREG_2]));

Definition at line 383 of file cpu_fp_operate.h.

#define DO_CVTQL

Value:

FPSTART; \
  state.f[FREG_3] = ((state.f[FREG_2] & U64(0x00000000c0000000)) << 32) | ((state.f[FREG_2] & U64(0x000000003fffffff)) << 29);

Definition at line 316 of file cpu_fp_operate.h.

#define DO_CVTQS

Value:

FPSTART; \
  state.f[FREG_3] = host2s((double) ((s64) state.f[FREG_2]));

Definition at line 392 of file cpu_fp_operate.h.

#define DO_CVTQT

Value:

FPSTART; \
  state.f[FREG_3] = host2t((double) ((s64) state.f[FREG_2]));

Definition at line 390 of file cpu_fp_operate.h.

#define DO_CVTST

Value:

FPSTART; \
  state.f[FREG_3] = host2t(s2host(state.f[FREG_2]));

Definition at line 443 of file cpu_fp_operate.h.

#define DO_CVTTQ

Value:

FPSTART; \
  state.f[FREG_3] = (u64) ((s64) t2host(state.f[FREG_2]));

Definition at line 388 of file cpu_fp_operate.h.

#define DO_CVTTS

Value:

FPSTART; \
  state.f[FREG_3] = host2s(t2host(state.f[FREG_2]));

Definition at line 445 of file cpu_fp_operate.h.

#define DO_DIVF

Value:

FPSTART; \
  state.f[FREG_3] = host2f(f2host(state.f[FREG_1]) / f2host(state.f[FREG_2]));

Definition at line 427 of file cpu_fp_operate.h.

#define DO_DIVG

Value:

FPSTART; \
  state.f[FREG_3] = host2g(g2host(state.f[FREG_1]) / g2host(state.f[FREG_2]));

Definition at line 425 of file cpu_fp_operate.h.

#define DO_DIVS

Value:

FPSTART; \
  state.f[FREG_3] = host2s(s2host(state.f[FREG_1]) / s2host(state.f[FREG_2]));

Definition at line 431 of file cpu_fp_operate.h.

#define DO_DIVT

Value:

FPSTART; \
  state.f[FREG_3] = host2t(t2host(state.f[FREG_1]) / t2host(state.f[FREG_2]));

Definition at line 429 of file cpu_fp_operate.h.

#define DO_FCMOVEQ

Value:

FPSTART;                    \
  if(state.f[FREG_1] == U64(0x0000000000000000) \
   || state.f[FREG_1] == U64(0x8000000000000000)) state.f[FREG_3] = state.f[FREG_2];

Definition at line 323 of file cpu_fp_operate.h.

#define DO_FCMOVGE

Value:

FPSTART;                      \
  if(!(state.f[FREG_1] & U64(0x8000000000000000)) \
   || state.f[FREG_1] == U64(0x8000000000000000)) state.f[FREG_3] = state.f[FREG_2];

Definition at line 326 of file cpu_fp_operate.h.

#define DO_FCMOVGT

Value:

FPSTART;                      \
  if(!(state.f[FREG_1] & U64(0x8000000000000000)) \
   && state.f[FREG_1] != U64(0x0000000000000000)) state.f[FREG_3] = state.f[FREG_2];

Definition at line 329 of file cpu_fp_operate.h.

#define DO_FCMOVLE

Value:

FPSTART;                     \
  if((state.f[FREG_1] & U64(0x8000000000000000)) \
   || state.f[FREG_1] == U64(0x0000000000000000)) state.f[FREG_3] = state.f[FREG_2];

Definition at line 332 of file cpu_fp_operate.h.

#define DO_FCMOVLT

Value:

FPSTART;                     \
  if((state.f[FREG_1] & U64(0x8000000000000000)) \
   && state.f[FREG_1] != U64(0x8000000000000000)) state.f[FREG_3] = state.f[FREG_2];

Definition at line 335 of file cpu_fp_operate.h.

#define DO_FCMOVNE

Value:

FPSTART;                    \
  if(state.f[FREG_1] != U64(0x0000000000000000) \
   && state.f[FREG_1] != U64(0x8000000000000000)) state.f[FREG_3] = state.f[FREG_2];

Definition at line 338 of file cpu_fp_operate.h.

#define DO_FTOIS

Value:

FPSTART;                             \
  temp_64 = state.f[FREG_1];                             \
  state.r[REG_3] = (temp_64 & U64(0x000000003fffffff)) | \
    ((temp_64 & U64(0xc000000000000000)) >> 32) |        \
      (((temp_64 & U64(0x8000000000000000)) >> 31) * U64(0xffffffff));

Definition at line 401 of file cpu_fp_operate.h.

#define DO_FTOIT

Value:

FPSTART; \
  state.r[REG_3] = state.f[FREG_1];

Definition at line 407 of file cpu_fp_operate.h.

#define DO_ITOFF

Value:

FPSTART; \
  state.f[FREG_3] = itof_f(state.r[REG_1]);

Definition at line 413 of file cpu_fp_operate.h.

#define DO_ITOFS

Value:

FPSTART; \
  state.f[FREG_3] = load_s((u32) state.r[REG_1]);

Definition at line 411 of file cpu_fp_operate.h.

#define DO_ITOFT

Value:

FPSTART; \
  state.f[FREG_3] = state.r[REG_1];

Definition at line 409 of file cpu_fp_operate.h.

#define DO_MF_FPCR

Value:

FPSTART; \
  state.f[FREG_1] = state.fpcr;

Definition at line 342 of file cpu_fp_operate.h.

#define DO_MT_FPCR

Value:

FPSTART; \
  state.fpcr = state.f[FREG_1];

Definition at line 344 of file cpu_fp_operate.h.

#define DO_MULF

Value:

FPSTART; \
  state.f[FREG_3] = host2f(f2host(state.f[FREG_1]) * f2host(state.f[FREG_2]));

Definition at line 418 of file cpu_fp_operate.h.

#define DO_MULG

Value:

FPSTART; \
  state.f[FREG_3] = host2g(g2host(state.f[FREG_1]) * g2host(state.f[FREG_2]));

Definition at line 416 of file cpu_fp_operate.h.

#define DO_MULS

Value:

FPSTART; \
  state.f[FREG_3] = host2s(s2host(state.f[FREG_1]) * s2host(state.f[FREG_2]));

Definition at line 422 of file cpu_fp_operate.h.

#define DO_MULT

Value:

FPSTART; \
  state.f[FREG_3] = host2t(t2host(state.f[FREG_1]) * t2host(state.f[FREG_2]));

Definition at line 420 of file cpu_fp_operate.h.

#define DO_SQRTF

Value:

FPSTART; \
  state.f[FREG_3] = host2f(sqrt(f2host(state.f[FREG_2])));

Definition at line 436 of file cpu_fp_operate.h.

#define DO_SQRTG

Value:

FPSTART; \
  state.f[FREG_3] = host2g(sqrt(g2host(state.f[FREG_2])));

Definition at line 434 of file cpu_fp_operate.h.

#define DO_SQRTS

Value:

FPSTART; \
  state.f[FREG_3] = host2s(sqrt(s2host(state.f[FREG_2])));

Definition at line 440 of file cpu_fp_operate.h.

#define DO_SQRTT

Value:

FPSTART; \
  state.f[FREG_3] = host2t(sqrt(t2host(state.f[FREG_2])));

Definition at line 438 of file cpu_fp_operate.h.

#define DO_SUBF

Value:

FPSTART; \
  state.f[FREG_3] = host2f(f2host(state.f[FREG_1]) - f2host(state.f[FREG_2]));

Definition at line 358 of file cpu_fp_operate.h.

#define DO_SUBG

Value:

FPSTART; \
  state.f[FREG_3] = host2g(g2host(state.f[FREG_1]) - g2host(state.f[FREG_2]));

Definition at line 356 of file cpu_fp_operate.h.

#define DO_SUBS

Value:

FPSTART; \
  state.f[FREG_3] = host2s(s2host(state.f[FREG_1]) - s2host(state.f[FREG_2]));

Definition at line 362 of file cpu_fp_operate.h.

#define DO_SUBT

Value:

FPSTART; \
  state.f[FREG_3] = host2t(t2host(state.f[FREG_1]) - t2host(state.f[FREG_2]));

Definition at line 360 of file cpu_fp_operate.h.


SourceForge.net Logo
Project space on SourceForge.net