Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4243)

Unified Diff: cc/raster/texture_compressor_etc1_sse.cc

Issue 1515753003: Fix static initializers in cc/raster/texture_compressor_etc1_sse.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/texture_compressor_etc1_sse.cc
diff --git a/cc/raster/texture_compressor_etc1_sse.cc b/cc/raster/texture_compressor_etc1_sse.cc
index 229782238bef4f100dd29b2bf36b7f610a638315..6f1005bf827a4d99e2b3edef1fc4fe0723894fc9 100644
--- a/cc/raster/texture_compressor_etc1_sse.cc
+++ b/cc/raster/texture_compressor_etc1_sse.cc
@@ -38,13 +38,9 @@ struct __sse_data {
__m128i* red;
};
-// Commonly used registers throughout the code.
-static const __m128i __sse_zero = _mm_set1_epi32(0);
-static const __m128i __sse_max_int = _mm_set1_epi32(0x7FFFFFFF);
-
inline __m128i AddAndClamp(const __m128i x, const __m128i y) {
static const __m128i color_max = _mm_set1_epi32(0xFF);
- return _mm_max_epi16(__sse_zero,
+ return _mm_max_epi16(_mm_setzero_si128(),
_mm_min_epi16(_mm_add_epi16(x, y), color_max));
}
@@ -72,7 +68,7 @@ inline uint32_t GetVerticalError(const __sse_data* data,
const __m128i* green_avg,
const __m128i* red_avg,
uint32_t* verror) {
- __m128i error = __sse_zero;
+ __m128i error = _mm_setzero_si128();
for (int i = 0; i < 4; i++) {
error = _mm_add_epi32(error, GetColorErrorSSE(data->blue[i], blue_avg[0]));
@@ -94,7 +90,7 @@ inline uint32_t GetHorizontalError(const __sse_data* data,
const __m128i* green_avg,
const __m128i* red_avg,
uint32_t* verror) {
- __m128i error = __sse_zero;
+ __m128i error = _mm_setzero_si128();
int first_index, second_index;
for (int i = 0; i < 2; i++) {
@@ -301,11 +297,11 @@ void ComputeLuminance(uint8_t* block,
test_green = AddAndClamp(tmp, base_green);
test_red = AddAndClamp(tmp, base_red);
- first_half_min = __sse_max_int;
- second_half_min = __sse_max_int;
+ first_half_min = _mm_set1_epi32(0x7FFFFFFF);
+ second_half_min = _mm_set1_epi32(0x7FFFFFFF);
- first_half_pattern = __sse_zero;
- second_half_pattern = __sse_zero;
+ first_half_pattern = _mm_setzero_si128();
+ second_half_pattern = _mm_setzero_si128();
for (uint8_t imm8 : shuffle_mask) {
switch (imm8) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698