summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/voodoo.h
diff options
context:
space:
mode:
author Ted Green <tedgreen99@users.noreply.github.com>2020-07-02 13:44:32 -0600
committer Ted Green <tedgreen99@users.noreply.github.com>2020-07-02 13:55:02 -0600
commit677f4a9b3937754cfa64ed7120fdcaef71c2feed (patch)
treed586283b5c6b8a8069d056baba2ab80206f9969a /src/devices/video/voodoo.h
parentfb90cac2f2079972d75b3c4637de314a8498ed24 (diff)
voodoo: SSE use shift left by 8 instead of floating point multiply by 256 for perspective correction calculation.
Diffstat (limited to 'src/devices/video/voodoo.h')
-rw-r--r--src/devices/video/voodoo.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h
index b6ef2abc8cf..85794b55d90 100644
--- a/src/devices/video/voodoo.h
+++ b/src/devices/video/voodoo.h
@@ -1416,7 +1416,7 @@ public:
stw_t(const stw_t& other) = default;
stw_t &operator=(const stw_t& other) = default;
- void set(s64 s, s64 t, s64 w) { m_st = _mm_set_pd(s, t); m_w = _mm_set1_pd(w); }
+ void set(s64 s, s64 t, s64 w) { m_st = _mm_set_pd(s << 8, t << 8); m_w = _mm_set1_pd(w); }
int is_w_neg() const { return _mm_comilt_sd(m_w, _mm_set1_pd(0.0)); }
void get_st_shiftr(s32 &s, s32 &t, const s32 &shift) const
{
@@ -1434,7 +1434,7 @@ public:
{
__m128d tmp = _mm_div_pd(m_st, m_w);
// Allow for 8 bits of decimal in integer
- tmp = _mm_mul_pd(tmp, _mm_set1_pd(256.0));
+ //tmp = _mm_mul_pd(tmp, _mm_set1_pd(256.0));
__m128i tmp2 = _mm_cvttpd_epi32(tmp);
#ifdef __SSE4_1__
sow = _mm_extract_epi32(tmp2, 1);