Revision d26968ec target-mips/op_helper.c
b/target-mips/op_helper.c | ||
---|---|---|
1867 | 1867 |
} |
1868 | 1868 |
|
1869 | 1869 |
/* Bitfield operations. */ |
1870 |
target_ulong do_ext(target_ulong t0, target_ulong t1, uint32_t pos, uint32_t size)
|
|
1870 |
target_ulong do_ext(target_ulong t1, uint32_t pos, uint32_t size) |
|
1871 | 1871 |
{ |
1872 | 1872 |
return (int32_t)((t1 >> pos) & ((size < 32) ? ((1 << size) - 1) : ~0)); |
1873 | 1873 |
} |
... | ... | |
1879 | 1879 |
return (int32_t)((t0 & ~mask) | ((t1 << pos) & mask)); |
1880 | 1880 |
} |
1881 | 1881 |
|
1882 |
target_ulong do_wsbh(target_ulong t0, target_ulong t1)
|
|
1882 |
target_ulong do_wsbh(target_ulong t1) |
|
1883 | 1883 |
{ |
1884 | 1884 |
return (int32_t)(((t1 << 8) & ~0x00FF00FF) | ((t1 >> 8) & 0x00FF00FF)); |
1885 | 1885 |
} |
1886 | 1886 |
|
1887 | 1887 |
#if defined(TARGET_MIPS64) |
1888 |
target_ulong do_dext(target_ulong t0, target_ulong t1, uint32_t pos, uint32_t size)
|
|
1888 |
target_ulong do_dext(target_ulong t1, uint32_t pos, uint32_t size) |
|
1889 | 1889 |
{ |
1890 | 1890 |
return (t1 >> pos) & ((size < 64) ? ((1ULL << size) - 1) : ~0ULL); |
1891 | 1891 |
} |
... | ... | |
1897 | 1897 |
return (t0 & ~mask) | ((t1 << pos) & mask); |
1898 | 1898 |
} |
1899 | 1899 |
|
1900 |
target_ulong do_dsbh(target_ulong t0, target_ulong t1)
|
|
1900 |
target_ulong do_dsbh(target_ulong t1) |
|
1901 | 1901 |
{ |
1902 | 1902 |
return ((t1 << 8) & ~0x00FF00FF00FF00FFULL) | ((t1 >> 8) & 0x00FF00FF00FF00FFULL); |
1903 | 1903 |
} |
1904 | 1904 |
|
1905 |
target_ulong do_dshd(target_ulong t0, target_ulong t1)
|
|
1905 |
target_ulong do_dshd(target_ulong t1) |
|
1906 | 1906 |
{ |
1907 | 1907 |
t1 = ((t1 << 16) & ~0x0000FFFF0000FFFFULL) | ((t1 >> 16) & 0x0000FFFF0000FFFFULL); |
1908 | 1908 |
return (t1 << 32) | (t1 >> 32); |
Also available in: Unified diff