Commit 5f47b75d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mmxext: use standard syntax for mmx_t alignment

parent 62481d9b
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#ifdef CAN_COMPILE_MMXEXT #ifdef CAN_COMPILE_MMXEXT
# include "mmx.h" # include "mmx.h"
# include <stdalign.h>
#endif #endif
#include <stdint.h> #include <stdint.h>
...@@ -228,7 +229,10 @@ static void DarkenFieldMMX( picture_t *p_dst, ...@@ -228,7 +229,10 @@ static void DarkenFieldMMX( picture_t *p_dst,
int x = 0; int x = 0;
/* See also easy-to-read C version below. */ /* See also easy-to-read C version below. */
static const mmx_t b128 = { .uq = 0x8080808080808080ULL }; static alignas (8) const mmx_t b128 = {
.uq = 0x8080808080808080ULL
};
movq_m2r( b128, mm5 ); movq_m2r( b128, mm5 );
movq_m2r( i_strength_u64, mm6 ); movq_m2r( i_strength_u64, mm6 );
movq_m2r( remove_high_u64, mm7 ); movq_m2r( remove_high_u64, mm7 );
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#ifdef CAN_COMPILE_MMXEXT #ifdef CAN_COMPILE_MMXEXT
# include "mmx.h" # include "mmx.h"
# include <stdalign.h>
#endif #endif
#include <stdint.h> #include <stdint.h>
...@@ -183,7 +184,7 @@ static int TestForMotionInBlockMMX( uint8_t *p_pix_p, uint8_t *p_pix_c, ...@@ -183,7 +184,7 @@ static int TestForMotionInBlockMMX( uint8_t *p_pix_p, uint8_t *p_pix_c,
int32_t i_top_motion = 0; int32_t i_top_motion = 0;
int32_t i_bot_motion = 0; int32_t i_bot_motion = 0;
static const mmx_t bT = { .ub = { T, T, T, T, T, T, T, T } }; static alignas (8) const mmx_t bT = { .ub = { T, T, T, T, T, T, T, T } };
pxor_r2r( mm6, mm6 ); /* zero, used in psadbw */ pxor_r2r( mm6, mm6 ); /* zero, used in psadbw */
movq_m2r( bT, mm5 ); movq_m2r( bT, mm5 );
...@@ -500,9 +501,12 @@ static int CalculateInterlaceScoreMMX( const picture_t* p_pic_top, ...@@ -500,9 +501,12 @@ static int CalculateInterlaceScoreMMX( const picture_t* p_pic_top,
# of pixels < (2^32)/255 # of pixels < (2^32)/255
Note: calculates score * 255 Note: calculates score * 255
*/ */
static const mmx_t b0 = { .uq = 0x0000000000000000ULL }; static alignas (8) const mmx_t b0 = {
static const mmx_t b128 = { .uq = 0x8080808080808080ULL }; .uq = 0x0000000000000000ULL };
static const mmx_t bT = { .ub = { T, T, T, T, T, T, T, T } }; static alignas (8) const mmx_t b128 = {
.uq = 0x8080808080808080ULL };
static alignas (8) const mmx_t bT = {
.ub = { T, T, T, T, T, T, T, T } };
for( ; x < w8; x += 8 ) for( ; x < w8; x += 8 )
{ {
......
...@@ -37,7 +37,7 @@ typedef union { ...@@ -37,7 +37,7 @@ typedef union {
int8_t b[8]; /* 8 Byte (8-bit) values */ int8_t b[8]; /* 8 Byte (8-bit) values */
uint8_t ub[8]; /* 8 Unsigned Byte */ uint8_t ub[8]; /* 8 Unsigned Byte */
float s[2]; /* Single-precision (32-bit) value */ float s[2]; /* Single-precision (32-bit) value */
} ATTR_ALIGN(8) mmx_t; /* On an 8-byte (64-bit) boundary */ } mmx_t; /* NOTE: must be on an 8-byte (64-bit) boundary */
#define mmx_i2r(op,imm,reg) \ #define mmx_i2r(op,imm,reg) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment