summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video
diff options
context:
space:
mode:
author Ted Green <tedgreen99@protonmail.com>2017-10-15 12:11:10 -0600
committer Ted Green <tedgreen99@protonmail.com>2017-10-15 12:19:39 -0600
commit1c424550a15242b46d46a6bbedfdc73b4a4c91fe (patch)
tree1c7eac9983c54ddf5687b18be4390ba2b981ea19 /src/emu/video
parent89157c45ec7f77ace85daae602dee388e4ceb879 (diff)
voodoo: Few more SSE optimizations. (nw)
Diffstat (limited to 'src/emu/video')
-rw-r--r--src/emu/video/rgbgen.h6
-rw-r--r--src/emu/video/rgbsse.h6
-rw-r--r--src/emu/video/rgbvmx.h11
3 files changed, 23 insertions, 0 deletions
diff --git a/src/emu/video/rgbgen.h b/src/emu/video/rgbgen.h
index b5986915f82..e460208d9fd 100644
--- a/src/emu/video/rgbgen.h
+++ b/src/emu/video/rgbgen.h
@@ -55,6 +55,7 @@ public:
return rgb_t(a, r, g, b);
}
+ void set_a16(const s32 value) { m_a = value; }
void set_a(const s32 value) { m_a = value; }
void set_r(const s32 value) { m_r = value; }
void set_g(const s32 value) { m_g = value; }
@@ -349,6 +350,11 @@ public:
m_b = (m_b < b) ? 0xffffffff : 0;
}
+ void merge_alpha16(const rgbaint_t& alpha)
+ {
+ m_a = alpha.m_a;
+ }
+
void merge_alpha(const rgbaint_t& alpha)
{
m_a = alpha.m_a;
diff --git a/src/emu/video/rgbsse.h b/src/emu/video/rgbsse.h
index d8f491e0117..71203a4431c 100644
--- a/src/emu/video/rgbsse.h
+++ b/src/emu/video/rgbsse.h
@@ -58,6 +58,7 @@ public:
return _mm_cvtsi128_si32(_mm_packus_epi16(_mm_packs_epi32(m_value, _mm_setzero_si128()), _mm_setzero_si128()));
}
+ void set_a16(const s32 value) { m_value = _mm_insert_epi16(m_value, value, 6); }
#ifdef __SSE4_1__
void set_a(const s32 value) { m_value = _mm_insert_epi32(m_value, value, 3); }
void set_r(const s32 value) { m_value = _mm_insert_epi32(m_value, value, 2); }
@@ -415,6 +416,11 @@ public:
return *this;
}
+ inline void merge_alpha16(const rgbaint_t& alpha)
+ {
+ m_value = _mm_insert_epi16(m_value, _mm_extract_epi16(alpha.m_value, 6), 6);
+ }
+
inline void merge_alpha(const rgbaint_t& alpha)
{
#ifdef __SSE4_1__
diff --git a/src/emu/video/rgbvmx.h b/src/emu/video/rgbvmx.h
index 6e239050118..05d26cd9e21 100644
--- a/src/emu/video/rgbvmx.h
+++ b/src/emu/video/rgbvmx.h
@@ -100,6 +100,12 @@ public:
return result;
}
+ void set_a16(const s32 value)
+ {
+ const VECS32 temp = { value, value, value, value };
+ m_value = vec_perm(m_value, temp, alpha_perm);
+ }
+
void set_a(const s32 value)
{
const VECS32 temp = { value, value, value, value };
@@ -606,6 +612,11 @@ public:
return *this;
}
+ inline void merge_alpha16(const rgbaint_t& alpha)
+ {
+ m_value = vec_perm(m_value, alpha.m_value, alpha_perm);
+ }
+
inline void merge_alpha(const rgbaint_t& alpha)
{
m_value = vec_perm(m_value, alpha.m_value, alpha_perm);