mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-29 22:20:48 +00:00
SPU LLVM: improve MPYH instruction
Rewritten to use 16-bit multiplication, as in SPU ASMJIT.
This commit is contained in:
parent
cdf25d902a
commit
6dca588370
@ -6255,19 +6255,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename TA, typename TB>
|
template <typename TA, typename TB>
|
||||||
static auto mpyh(TA&& a, TB&& b)
|
auto mpyh(TA&& a, TB&& b)
|
||||||
{
|
{
|
||||||
return (std::forward<TA>(a) >> 16) * (std::forward<TB>(b) << 16);
|
return bitcast<u32[4]>(bitcast<u16[8]>((std::forward<TA>(a) >> 16)) * bitcast<u16[8]>(std::forward<TB>(b))) << 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename TA, typename TB>
|
template <typename TA, typename TB>
|
||||||
static auto mpyu(TA&& a, TB&& b)
|
auto mpyu(TA&& a, TB&& b)
|
||||||
{
|
{
|
||||||
return (std::forward<TA>(a) << 16 >> 16) * (std::forward<TB>(b) << 16 >> 16);
|
return (std::forward<TA>(a) << 16 >> 16) * (std::forward<TB>(b) << 16 >> 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename TA, typename TB>
|
template <typename TA, typename TB>
|
||||||
static auto fm(TA&& a, TB&& b)
|
auto fm(TA&& a, TB&& b)
|
||||||
{
|
{
|
||||||
return (std::forward<TA>(a)) * (std::forward<TB>(b));
|
return (std::forward<TA>(a)) * (std::forward<TB>(b));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user