~ubuntu-branches/ubuntu/trusty/qemu/trusty

« back to all changes in this revision

Viewing changes to target-mips/dsp_helper.c

  • Committer: Package Import Robot
  • Author(s): Serge Hallyn
  • Date: 2013-10-22 22:47:07 UTC
  • mfrom: (1.8.3) (10.1.42 sid)
  • Revision ID: package-import@ubuntu.com-20131022224707-1lya34fw3k3f24tv
Tags: 1.6.0+dfsg-2ubuntu1
* Merge 1.6.0~rc0+dfsg-2exp from debian experimental.  Remaining changes:
  - debian/control
    * update maintainer
    * remove libiscsi, usb-redir, vde, vnc-jpeg, and libssh2-1-dev
      from build-deps
    * enable rbd
    * add qemu-system and qemu-common B/R to qemu-keymaps
    * add D:udev, R:qemu, R:qemu-common and B:qemu-common to
      qemu-system-common
    * qemu-system-arm, qemu-system-ppc, qemu-system-sparc:
      - add qemu-kvm to Provides
      - add qemu-common, qemu-kvm, kvm to B/R
      - remove openbios-sparc from qemu-system-sparc D
      - drop openbios-ppc and openhackware Depends to Suggests (for now)
    * qemu-system-x86:
      - add qemu-common to Breaks/Replaces.
      - add cpu-checker to Recommends.
    * qemu-user: add B/R:qemu-kvm
    * qemu-kvm:
      - add armhf armel powerpc sparc to Architecture
      - C/R/P: qemu-kvm-spice
    * add qemu-common package
    * drop qemu-slof which is not packaged in ubuntu
  - add qemu-system-common.links for tap ifup/down scripts and OVMF link.
  - qemu-system-x86.links:
    * remove pxe rom links which are in kvm-ipxe
    * add symlink for kvm.1 manpage
  - debian/rules
    * add kvm-spice symlink to qemu-kvm
    * call dh_installmodules for qemu-system-x86
    * update dh_installinit to install upstart script
    * run dh_installman (Closes: #709241) (cherrypicked from 1.5.0+dfsg-2)
  - Add qemu-utils.links for kvm-* symlinks.
  - Add qemu-system-x86.qemu-kvm.upstart and .default
  - Add qemu-system-x86.modprobe to set nesting=1
  - Add qemu-system-common.preinst to add kvm group
  - qemu-system-common.postinst: remove bad group acl if there, then have
    udev relabel /dev/kvm.
  - New linaro patches from qemu-linaro rebasing branch
  - Dropped patches:
    * xen-simplify-xen_enabled.patch
    * sparc-linux-user-fix-missing-symbols-in-.rel-.rela.plt-sections.patch
    * main_loop-do-not-set-nonblocking-if-xen_enabled.patch
    * xen_machine_pv-do-not-create-a-dummy-CPU-in-machine-.patch
    * virtio-rng-fix-crash
  - Kept patches:
    * expose_vms_qemu64cpu.patch - updated
    * linaro arm patches from qemu-linaro rebasing branch
  - New patches:
    * fix-pci-add: change CONFIG variable in ifdef to make sure that
      pci_add is defined.
* Add linaro patches
* Add experimental mach-virt patches for arm virtualization.
* qemu-system-common.install: add debian/tmp/usr/lib to install the
  qemu-bridge-helper

Show diffs side-by-side

added added

removed removed

Lines of Context:
390
390
        temp = 0x7FFFFFFF;
391
391
        set_DSPControl_overflow_flag(1, 21, env);
392
392
    } else {
393
 
        temp = ((int32_t)(int16_t)a * (int32_t)(int16_t)b) << 1;
 
393
        temp = ((int16_t)a * (int16_t)b) << 1;
394
394
    }
395
395
 
396
396
    return temp;
583
583
        temp = (0x01ull << 63) - 1;
584
584
        set_DSPControl_overflow_flag(1, 16 + ac, env);
585
585
    } else {
586
 
        temp = ((uint64_t)a * (uint64_t)b) << 1;
 
586
        temp = ((int64_t)(int32_t)a * (int32_t)b) << 1;
587
587
    }
588
588
 
589
589
    return temp;
622
622
        temp = 0x7FFF0000;
623
623
        set_DSPControl_overflow_flag(1, 21, env);
624
624
    } else {
625
 
        temp = (a * b) << 1;
 
625
        temp = ((int16_t)a * (int16_t)b) << 1;
626
626
        temp = temp + 0x00008000;
627
627
    }
628
628
 
648
648
static inline uint16_t mipsdsp_trunc16_sat16_round(int32_t a,
649
649
                                                   CPUMIPSState *env)
650
650
{
651
 
    int64_t temp;
652
 
 
653
 
    temp = (int32_t)a + 0x00008000;
654
 
 
655
 
    if (a > (int)0x7fff8000) {
656
 
        temp = 0x7FFFFFFF;
 
651
    uint16_t temp;
 
652
 
 
653
 
 
654
    /*
 
655
     * The value 0x00008000 will be added to the input Q31 value, and the code
 
656
     * needs to check if the addition causes an overflow. Since a positive value
 
657
     * is added, overflow can happen in one direction only.
 
658
     */
 
659
    if (a > 0x7FFF7FFF) {
 
660
        temp = 0x7FFF;
657
661
        set_DSPControl_overflow_flag(1, 22, env);
 
662
    } else {
 
663
        temp = ((a + 0x8000) >> 16) & 0xFFFF;
658
664
    }
659
665
 
660
 
    return (temp >> 16) & 0xFFFF;
 
666
    return temp;
661
667
}
662
668
 
663
669
static inline uint8_t mipsdsp_sat8_reduce_precision(uint16_t a,
2902
2908
    return (target_ulong)rd;
2903
2909
}
2904
2910
 
2905
 
#define BIT_INSV(name, posfilter, sizefilter, ret_type)         \
 
2911
#define BIT_INSV(name, posfilter, ret_type)                     \
2906
2912
target_ulong helper_##name(CPUMIPSState *env, target_ulong rs,  \
2907
2913
                           target_ulong rt)                     \
2908
2914
{                                                               \
2909
2915
    uint32_t pos, size, msb, lsb;                               \
2910
 
    target_ulong filter;                                        \
2911
 
    target_ulong temp, temprs, temprt;                          \
 
2916
    uint32_t const sizefilter = 0x3F;                           \
 
2917
    target_ulong temp;                                          \
2912
2918
    target_ulong dspc;                                          \
2913
2919
                                                                \
2914
2920
    dspc = env->active_tc.DSPControl;                           \
2923
2929
        return rt;                                              \
2924
2930
    }                                                           \
2925
2931
                                                                \
2926
 
    filter = ((int64_t)0x01 << size) - 1;                       \
2927
 
    filter = filter << pos;                                     \
2928
 
    temprs = (rs << pos) & filter;                              \
2929
 
    temprt = rt & ~filter;                                      \
2930
 
    temp = temprs | temprt;                                     \
 
2932
    temp = deposit64(rt, pos, size, rs);                        \
2931
2933
                                                                \
2932
2934
    return (target_long)(ret_type)temp;                         \
2933
2935
}
2934
2936
 
2935
 
BIT_INSV(insv, 0x1F, 0x3F, int32_t);
 
2937
BIT_INSV(insv, 0x1F, int32_t);
2936
2938
#ifdef TARGET_MIPS64
2937
 
BIT_INSV(dinsv, 0x7F, 0x3F, target_long);
 
2939
BIT_INSV(dinsv, 0x7F, target_long);
2938
2940
#endif
2939
2941
 
2940
2942
#undef BIT_INSV