From 08e92ba1e009d8b55e4ea44b4169ae80252b24f1 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 20 Jul 2012 21:03:56 +0800 Subject: mips: Autodetect MIPS DSP rev1 and rev2 instructionset Not every MIPS SoC has the DSP extensions, auto-detect them by using builtin GCC functions. Check for the DSP macros and add the result for rev1 and rev2 to the cpufeatures. Change-Id: I3d6c950f170f102514c43b349f9a23ee796d801a Reviewed-by: Girish Ramakrishnan Reviewed-by: Thiago Macieira --- config.tests/unix/mips_dsp/mips_dsp.cpp | 47 +++++++++++++++++++++++++++ config.tests/unix/mips_dsp/mips_dsp.pro | 2 ++ config.tests/unix/mips_dspr2/mips_dspr2.cpp | 49 +++++++++++++++++++++++++++++ config.tests/unix/mips_dspr2/mips_dspr2.pro | 2 ++ 4 files changed, 100 insertions(+) create mode 100644 config.tests/unix/mips_dsp/mips_dsp.cpp create mode 100644 config.tests/unix/mips_dsp/mips_dsp.pro create mode 100644 config.tests/unix/mips_dspr2/mips_dspr2.cpp create mode 100644 config.tests/unix/mips_dspr2/mips_dspr2.pro (limited to 'config.tests/unix') diff --git a/config.tests/unix/mips_dsp/mips_dsp.cpp b/config.tests/unix/mips_dsp/mips_dsp.cpp new file mode 100644 index 0000000000..78f318c9be --- /dev/null +++ b/config.tests/unix/mips_dsp/mips_dsp.cpp @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +int main(int, char**) +{ + int result; + __builtin_mips_lhx(&result, 10); + return result; +} diff --git a/config.tests/unix/mips_dsp/mips_dsp.pro b/config.tests/unix/mips_dsp/mips_dsp.pro new file mode 100644 index 0000000000..428b106c46 --- /dev/null +++ b/config.tests/unix/mips_dsp/mips_dsp.pro @@ -0,0 +1,2 @@ +SOURCES = mips_dsp.cpp +CONFIG -= x11 qt diff --git a/config.tests/unix/mips_dspr2/mips_dspr2.cpp b/config.tests/unix/mips_dspr2/mips_dspr2.cpp new file mode 100644 index 0000000000..55d7d56b19 --- /dev/null +++ b/config.tests/unix/mips_dspr2/mips_dspr2.cpp @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the config.tests of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +int main(int, char**) +{ + int result, tmp1, tmp2; + tmp1 = 10; + tmp2 = 20; + result = __builtin_mips_append (tmp1, tmp2, 10); + return result; +} diff --git a/config.tests/unix/mips_dspr2/mips_dspr2.pro b/config.tests/unix/mips_dspr2/mips_dspr2.pro new file mode 100644 index 0000000000..a938742229 --- /dev/null +++ b/config.tests/unix/mips_dspr2/mips_dspr2.pro @@ -0,0 +1,2 @@ +SOURCES = mips_dspr2.cpp +CONFIG -= x11 qt -- cgit v1.2.3