Revision d9f4bb27 target-i386/ops_sse.h

b/target-i386/ops_sse.h
802 802
    d->XMM_S(0) = approx_rcp(s->XMM_S(0));
803 803
}
804 804

  
805
static inline uint64_t helper_extrq(uint64_t src, int shift, int len)
806
{
807
    uint64_t mask;
808

  
809
    if (len == 0) {
810
        mask = ~0LL;
811
    } else {
812
        mask = (1ULL << len) - 1;
813
    }
814
    return (src >> shift) & mask;
815
}
816

  
817
void helper_extrq_r(XMMReg *d, XMMReg *s)
818
{
819
    d->XMM_Q(0) = helper_extrq(d->XMM_Q(0), s->XMM_B(1), s->XMM_B(0));
820
}
821

  
822
void helper_extrq_i(XMMReg *d, int index, int length)
823
{
824
    d->XMM_Q(0) = helper_extrq(d->XMM_Q(0), index, length);
825
}
826

  
827
static inline uint64_t helper_insertq(uint64_t src, int shift, int len)
828
{
829
    uint64_t mask;
830

  
831
    if (len == 0) {
832
        mask = ~0ULL;
833
    } else {
834
        mask = (1ULL << len) - 1;
835
    }
836
    return (src & ~(mask << shift)) | ((src & mask) << shift);
837
}
838

  
839
void helper_insertq_r(XMMReg *d, XMMReg *s)
840
{
841
    d->XMM_Q(0) = helper_insertq(s->XMM_Q(0), s->XMM_B(9), s->XMM_B(8));
842
}
843

  
844
void helper_insertq_i(XMMReg *d, int index, int length)
845
{
846
    d->XMM_Q(0) = helper_insertq(d->XMM_Q(0), index, length);
847
}
848

  
805 849
void helper_haddps(XMMReg *d, XMMReg *s)
806 850
{
807 851
    XMMReg r;

Also available in: Unified diff