mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +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
1 changed files with 4 additions and 4 deletions
|
@ -6255,19 +6255,19 @@ public:
|
|||
}
|
||||
|
||||
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>
|
||||
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);
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue