summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2012-02-02 11:48:13 -0800
committerRonald S. Bultje <rsbultje@gmail.com>2012-02-02 12:00:48 -0800
commit7e4d9d5d456916f51cb40ef646fad5b0a467f4b1 (patch)
treea03a9432b4a55cbc90f09ad900de72cb7f43124f /libswscale
parent89415b8e3fb83d67fdc518323cc364aa74ec2af2 (diff)
win64: add a XMM clobber test configure option.
This will be useful to test more aggressively for failures to mark XMM registers as clobbered in Win64 builds, and prevent regressions thereof. Based on a patch by Ramiro Polla <ramiro.polla@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/Makefile2
-rw-r--r--libswscale/x86/w64xmmtest.c31
2 files changed, 33 insertions, 0 deletions
diff --git a/libswscale/Makefile b/libswscale/Makefile
index bef4200c59..0aee7e497b 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -21,6 +21,8 @@ MMX-OBJS-$(HAVE_YASM) += x86/input.o \
x86/output.o \
x86/scale.o
+OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
+
TESTPROGS = colorspace swscale
DIRS = bfin mlib ppc sparc x86
diff --git a/libswscale/x86/w64xmmtest.c b/libswscale/x86/w64xmmtest.c
new file mode 100644
index 0000000000..dd9a2a4378
--- /dev/null
+++ b/libswscale/x86/w64xmmtest.c
@@ -0,0 +1,31 @@
+/*
+ * check XMM registers for clobbers on Win64
+ * Copyright (c) 2012 Ronald S. Bultje <rsbultje@gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/x86/w64xmmtest.h"
+#include "libswscale/swscale.h"
+
+wrap(sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
+ const int srcStride[], int srcSliceY, int srcSliceH,
+ uint8_t *const dst[], const int dstStride[]))
+{
+ testxmmclobbers(sws_scale, c, srcSlice, srcStride, srcSliceY,
+ srcSliceH, dst, dstStride);
+}