diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2010-07-15 08:19:53 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-07-15 08:19:53 -0500 |
commit | c84995c50b850ab4febc9f21c58a18ee712e7bed (patch) | |
tree | eeef1d2c3501fac184723fc5ac0f08f8fc5cf142 | |
parent | c7ba56c4f0f50845068b037430f947e27e92011a (diff) | |
parent | fed61bbe3235f0a3507bfb688354bc0431743133 (diff) |
Merge remote branch 'origin/master' into staging
-rw-r--r-- | fpu/softfloat.c | 79 | ||||
-rw-r--r-- | fpu/softfloat.h | 3 | ||||
-rw-r--r-- | hw/bonito.c | 1 | ||||
-rw-r--r-- | pc-bios/README | 2 | ||||
-rw-r--r-- | pc-bios/openbios-ppc | bin | 316128 -> 320324 bytes | |||
-rw-r--r-- | pc-bios/openbios-sparc32 | bin | 217664 -> 217692 bytes | |||
-rw-r--r-- | pc-bios/openbios-sparc64 | bin | 1065872 -> 1065864 bytes | |||
-rw-r--r-- | qemu-options.hx | 12 | ||||
-rw-r--r-- | target-ppc/helper.h | 1 | ||||
-rw-r--r-- | target-ppc/op_helper.c | 10 | ||||
-rw-r--r-- | target-ppc/translate.c | 2 |
11 files changed, 104 insertions, 6 deletions
diff --git a/fpu/softfloat.c b/fpu/softfloat.c index e6065b4bc7..0b8279798c 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -2056,6 +2056,85 @@ float32 float32_sqrt( float32 a STATUS_PARAM ) } /*---------------------------------------------------------------------------- +| Returns the binary exponential of the single-precision floating-point value +| `a'. The operation is performed according to the IEC/IEEE Standard for +| Binary Floating-Point Arithmetic. +| +| Uses the following identities: +| +| 1. ------------------------------------------------------------------------- +| x x*ln(2) +| 2 = e +| +| 2. ------------------------------------------------------------------------- +| 2 3 4 5 n +| x x x x x x x +| e = 1 + --- + --- + --- + --- + --- + ... + --- + ... +| 1! 2! 3! 4! 5! n! +*----------------------------------------------------------------------------*/ + +static const float64 float32_exp2_coefficients[15] = +{ + make_float64( 0x3ff0000000000000ll ), /* 1 */ + make_float64( 0x3fe0000000000000ll ), /* 2 */ + make_float64( 0x3fc5555555555555ll ), /* 3 */ + make_float64( 0x3fa5555555555555ll ), /* 4 */ + make_float64( 0x3f81111111111111ll ), /* 5 */ + make_float64( 0x3f56c16c16c16c17ll ), /* 6 */ + make_float64( 0x3f2a01a01a01a01all ), /* 7 */ + make_float64( 0x3efa01a01a01a01all ), /* 8 */ + make_float64( 0x3ec71de3a556c734ll ), /* 9 */ + make_float64( 0x3e927e4fb7789f5cll ), /* 10 */ + make_float64( 0x3e5ae64567f544e4ll ), /* 11 */ + make_float64( 0x3e21eed8eff8d898ll ), /* 12 */ + make_float64( 0x3de6124613a86d09ll ), /* 13 */ + make_float64( 0x3da93974a8c07c9dll ), /* 14 */ + make_float64( 0x3d6ae7f3e733b81fll ), /* 15 */ +}; + +float32 float32_exp2( float32 a STATUS_PARAM ) +{ + flag aSign; + int16 aExp; + bits32 aSig; + float64 r, x, xn; + int i; + + aSig = extractFloat32Frac( a ); + aExp = extractFloat32Exp( a ); + aSign = extractFloat32Sign( a ); + + if ( aExp == 0xFF) { + if ( aSig ) return propagateFloat32NaN( a, float32_zero STATUS_VAR ); + return (aSign) ? float32_zero : a; + } + if (aExp == 0) { + if (aSig == 0) return float32_one; + } + + float_raise( float_flag_inexact STATUS_VAR); + + /* ******************************* */ + /* using float64 for approximation */ + /* ******************************* */ + x = float32_to_float64(a STATUS_VAR); + x = float64_mul(x, float64_ln2 STATUS_VAR); + + xn = x; + r = float64_one; + for (i = 0 ; i < 15 ; i++) { + float64 f; + + f = float64_mul(xn, float32_exp2_coefficients[i] STATUS_VAR); + r = float64_add(r, f STATUS_VAR); + + xn = float64_mul(xn, x STATUS_VAR); + } + + return float64_to_float32(r, status); +} + +/*---------------------------------------------------------------------------- | Returns the binary log of the single-precision floating-point value `a'. | The operation is performed according to the IEC/IEEE Standard for Binary | Floating-Point Arithmetic. diff --git a/fpu/softfloat.h b/fpu/softfloat.h index 636591b04c..9528825522 100644 --- a/fpu/softfloat.h +++ b/fpu/softfloat.h @@ -275,6 +275,7 @@ float32 float32_mul( float32, float32 STATUS_PARAM ); float32 float32_div( float32, float32 STATUS_PARAM ); float32 float32_rem( float32, float32 STATUS_PARAM ); float32 float32_sqrt( float32 STATUS_PARAM ); +float32 float32_exp2( float32 STATUS_PARAM ); float32 float32_log2( float32 STATUS_PARAM ); int float32_eq( float32, float32 STATUS_PARAM ); int float32_le( float32, float32 STATUS_PARAM ); @@ -315,6 +316,7 @@ INLINE int float32_is_zero(float32 a) #define float32_zero make_float32(0) #define float32_one make_float32(0x3f800000) +#define float32_ln2 make_float32(0x3f317218) /*---------------------------------------------------------------------------- | Software IEC/IEEE double-precision conversion routines. @@ -386,6 +388,7 @@ INLINE int float64_is_zero(float64 a) #define float64_zero make_float64(0) #define float64_one make_float64(0x3ff0000000000000LL) +#define float64_ln2 make_float64(0x3fe62e42fefa39efLL) #ifdef FLOATX80 diff --git a/hw/bonito.c b/hw/bonito.c index 8b810321ad..dcf031134e 100644 --- a/hw/bonito.c +++ b/hw/bonito.c @@ -775,7 +775,6 @@ PCIBus *bonito_init(qemu_irq *pic) pci_bonito_map_irq, pic, 0x28, 32); pcihost->bus = b; qdev_init_nofail(dev); - pci_bus_set_mem_base(pcihost->bus, 0x10000000); d = pci_create_simple(b, PCI_DEVFN(0, 0), "Bonito"); s = DO_UPCAST(PCIBonitoState, dev, d); diff --git a/pc-bios/README b/pc-bios/README index 40f35c5bd1..7c872bcb4d 100644 --- a/pc-bios/README +++ b/pc-bios/README @@ -15,7 +15,7 @@ firmware implementation. The goal is to implement a 100% IEEE 1275-1994 (referred to as Open Firmware) compliant firmware. The included image for PowerPC (for 32 and 64 bit PPC CPUs), Sparc32 - and Sparc64 are built from OpenBIOS SVN revision 795. + and Sparc64 are built from OpenBIOS SVN revision 821. - The PXE roms come from Rom-o-Matic gPXE 0.9.9 with BANNER_TIMEOUT=0 diff --git a/pc-bios/openbios-ppc b/pc-bios/openbios-ppc Binary files differindex 9e660ed538..9a749c8ff9 100644 --- a/pc-bios/openbios-ppc +++ b/pc-bios/openbios-ppc diff --git a/pc-bios/openbios-sparc32 b/pc-bios/openbios-sparc32 Binary files differindex 1acaa31acf..2eee1a6608 100644 --- a/pc-bios/openbios-sparc32 +++ b/pc-bios/openbios-sparc32 diff --git a/pc-bios/openbios-sparc64 b/pc-bios/openbios-sparc64 Binary files differindex 93c7269c15..1270ef614c 100644 --- a/pc-bios/openbios-sparc64 +++ b/pc-bios/openbios-sparc64 diff --git a/qemu-options.hx b/qemu-options.hx index d1d22726b8..0d7dd90710 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1271,7 +1271,7 @@ DEF("chardev", HAS_ARG, QEMU_OPTION_chardev, "-chardev serial,id=id,path=path[,mux=on|off]\n" #else "-chardev pty,id=id[,mux=on|off]\n" - "-chardev stdio,id=id[,mux=on|off]\n" + "-chardev stdio,id=id[,mux=on|off][,signal=on|off]\n" #endif #ifdef CONFIG_BRLAPI "-chardev braille,id=id[,mux=on|off]\n" @@ -1452,10 +1452,14 @@ not take any options. @option{pty} is not available on Windows hosts. -@item -chardev stdio ,id=@var{id} +@item -chardev stdio ,id=@var{id} [,signal=on|off] Connect to standard input and standard output of the qemu process. -@option{stdio} does not take any options. @option{stdio} is not available on -Windows hosts. + +@option{signal} controls if signals are enabled on the terminal, that includes +exiting QEMU with the key sequence @key{Control-c}. This option is enabled by +default, use @option{signal=off} to disable it. + +@option{stdio} is not available on Windows hosts. @item -chardev braille ,id=@var{id} diff --git a/target-ppc/helper.h b/target-ppc/helper.h index c025a2f08a..2bf9283486 100644 --- a/target-ppc/helper.h +++ b/target-ppc/helper.h @@ -246,6 +246,7 @@ DEF_HELPER_2(vrefp, void, avr, avr) DEF_HELPER_2(vrsqrtefp, void, avr, avr) DEF_HELPER_4(vmaddfp, void, avr, avr, avr, avr) DEF_HELPER_4(vnmsubfp, void, avr, avr, avr, avr) +DEF_HELPER_2(vexptefp, void, avr, avr) DEF_HELPER_2(vlogefp, void, avr, avr) DEF_HELPER_2(vrfim, void, avr, avr) DEF_HELPER_2(vrfin, void, avr, avr) diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index 3c3aa60bc3..8cf34d45a9 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -2713,6 +2713,16 @@ void helper_vsel (ppc_avr_t *r, ppc_avr_t *a, ppc_avr_t *b, ppc_avr_t *c) r->u64[1] = (a->u64[1] & ~c->u64[1]) | (b->u64[1] & c->u64[1]); } +void helper_vexptefp (ppc_avr_t *r, ppc_avr_t *b) +{ + int i; + for (i = 0; i < ARRAY_SIZE(r->f); i++) { + HANDLE_NAN1(r->f[i], b->f[i]) { + r->f[i] = float32_exp2(b->f[i], &env->vec_status); + } + } +} + void helper_vlogefp (ppc_avr_t *r, ppc_avr_t *b) { int i; diff --git a/target-ppc/translate.c b/target-ppc/translate.c index 66e1c0d3bf..95ab0a1d80 100644 --- a/target-ppc/translate.c +++ b/target-ppc/translate.c @@ -6382,6 +6382,7 @@ GEN_VXFORM_NOA(vupkhpx, 7, 13); GEN_VXFORM_NOA(vupklpx, 7, 15); GEN_VXFORM_NOA(vrefp, 5, 4); GEN_VXFORM_NOA(vrsqrtefp, 5, 5); +GEN_VXFORM_NOA(vexptefp, 5, 6); GEN_VXFORM_NOA(vlogefp, 5, 7); GEN_VXFORM_NOA(vrfim, 5, 8); GEN_VXFORM_NOA(vrfin, 5, 9); @@ -8696,6 +8697,7 @@ GEN_VXFORM_NOA(vupkhpx, 7, 13), GEN_VXFORM_NOA(vupklpx, 7, 15), GEN_VXFORM_NOA(vrefp, 5, 4), GEN_VXFORM_NOA(vrsqrtefp, 5, 5), +GEN_VXFORM_NOA(vexptefp, 5, 6), GEN_VXFORM_NOA(vlogefp, 5, 7), GEN_VXFORM_NOA(vrfim, 5, 8), GEN_VXFORM_NOA(vrfin, 5, 9), |