Add the mips_dsp_rev, mips_float_abi, and mips_fpu_mode build variables.

mips_dsp_rev specifies the MIPS DSP ASE (Application-Specific
Extension) revision number. Possible values are 0 (unavailable), 1,
and 2. Default to 0.

mips_float_abi specifies whether or not MIPS floating-point coprocessor
instructions should be used. Possible values are "hard" and "soft".
Default to "hard".

mips_fpu_mode specifies the width of MIPS32 floating-point registers.
Possible values are "fp32", "fp64", and "fpxx". Default to "fp32".

The companion webrtc CL is
https://webrtc-codereview.appspot.com/39779004.

R=brettw@chromium.org,kjellander@@chromium.org,petarj@mips.com
BUG=446234

Review URL: https://codereview.chromium.org/883253003

Cr-Original-Commit-Position: refs/heads/master@{#318524}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ff66006e62449071ab87ad01b025dac4a9029d06
This commit is contained in:
wtc 2015-02-27 13:58:07 -08:00 коммит произвёл Commit bot
Родитель 5d5824834f
Коммит 111cc10055
3 изменённых файлов: 86 добавлений и 18 удалений

Просмотреть файл

@ -184,6 +184,12 @@
# below for MIPS targets.
'mips_arch_variant%': '',
# MIPS DSP ASE revision. Possible values are:
# 0: unavailable
# 1: revision 1
# 2: revision 2
'mips_dsp_rev%': 0,
'conditions': [
# Ash needs Aura.
['use_aura==0', {
@ -276,6 +282,7 @@
'target_arch%': '<(target_arch)',
'target_subarch%': '<(target_subarch)',
'mips_arch_variant%': '<(mips_arch_variant)',
'mips_dsp_rev%': '<(mips_dsp_rev)',
'toolkit_views%': '<(toolkit_views)',
'desktop_linux%': '<(desktop_linux)',
'use_aura%': '<(use_aura)',
@ -1067,6 +1074,7 @@
'target_arch%': '<(target_arch)',
'target_subarch%': '<(target_subarch)',
'mips_arch_variant%': '<(mips_arch_variant)',
'mips_dsp_rev%': '<(mips_dsp_rev)',
'host_arch%': '<(host_arch)',
'toolkit_views%': '<(toolkit_views)',
'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
@ -2294,6 +2302,9 @@
['target_arch=="mipsel" and mips_arch_variant=="r2" and android_webview_build==0', {
'mips_fpu_mode%': 'fp32',
}],
['target_arch=="mipsel" and android_webview_build==0', {
'mips_float_abi%': 'hard',
}],
['android_webview_build==1', {
# The WebView build gets its cpu-specific flags from the Android build system.
@ -2303,6 +2314,7 @@
'arm_float_abi%': '',
'arm_thumb%': 0,
'mips_fpu_mode%': '',
'mips_float_abi%': '',
}],
# Enable brlapi by default for chromeos.
@ -4052,19 +4064,37 @@
'target_conditions': [
['_toolset=="target"', {
'conditions': [
['android_webview_build==0 and mips_arch_variant=="r6"', {
'cflags': ['-mips32r6', '-Wa,-mips32r6'],
['android_webview_build==0', {
'conditions': [
['OS=="android"', {
'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
['mips_arch_variant=="r6"', {
'cflags': ['-mips32r6', '-Wa,-mips32r6'],
'conditions': [
['OS=="android"', {
'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
}],
],
}],
['mips_arch_variant=="r2"', {
'cflags': ['-mips32r2', '-Wa,-mips32r2'],
'conditions': [
['mips_fpu_mode!=""', {
'cflags': ['-m<(mips_fpu_mode)'],
}],
],
}],
['mips_arch_variant=="r1"', {
'cflags': ['-mips32', '-Wa,-mips32'],
}],
['mips_dsp_rev==1', {
'cflags': ['-mdsp'],
}],
['mips_dsp_rev==2', {
'cflags': ['-mdspr2'],
}],
],
}],
['android_webview_build==0 and mips_arch_variant=="r2"', {
'cflags': ['-mips32r2', '-Wa,-mips32r2'],
}],
['android_webview_build==0 and mips_arch_variant=="r1"', {
'cflags': ['-mips32', '-Wa,-mips32'],
'cflags': [
'-m<(mips_float_abi)-float'
],
}],
],
'ldflags': [
@ -4080,13 +4110,17 @@
'target_conditions': [
['_toolset=="target"', {
'conditions': [
['android_webview_build==0 and mips_arch_variant=="r6"', {
'cflags': ['-mips64r6', '-Wa,-mips64r6'],
'ldflags': [ '-mips64r6' ],
}],
['android_webview_build==0 and mips_arch_variant=="r2"', {
'cflags': ['-mips64r2', '-Wa,-mips64r2'],
'ldflags': [ '-mips64r2' ],
['android_webview_build==0', {
'conditions': [
['mips_arch_variant=="r6"', {
'cflags': ['-mips64r6', '-Wa,-mips64r6'],
'ldflags': ['-mips64r6'],
}],
['mips_arch_variant=="r2"', {
'cflags': ['-mips64r2', '-Wa,-mips64r2'],
'ldflags': ['-mips64r2'],
}],
],
}],
],
'cflags_cc': [

Просмотреть файл

@ -295,12 +295,23 @@ config("compiler") {
"-mips32r2",
"-Wa,-mips32r2",
]
if (mips_fpu_mode != "") {
cflags += [ "-m$mips_fpu_mode" ]
}
} else if (mips_arch_variant == "r1") {
cflags += [
"-mips32",
"-Wa,-mips32",
]
}
if (mips_dsp_rev == 1) {
cflags += [ "-mdsp" ]
} else if (mips_dsp_rev == 2) {
cflags += [ "-mdspr2" ]
}
cflags += [ "-m${mips_float_abi}-float" ]
}
} else if (current_cpu == "mips64el") {
# Don't set the compiler flags for the WebView build. These will come

Просмотреть файл

@ -2,12 +2,35 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# MIPS arch variant.
if (current_cpu == "mipsel") {
declare_args() {
# MIPS arch variant. Possible values are:
# "r1"
# "r2"
# "r6"
mips_arch_variant = "r1"
# MIPS DSP ASE revision. Possible values are:
# 0: unavailable
# 1: revision 1
# 2: revision 2
mips_dsp_rev = 0
# MIPS floating-point ABI. Possible values are:
# "hard": sets the GCC -mhard-float option.
# "soft": sets the GCC -msoft-float option.
mips_float_abi = "hard"
# MIPS32 floating-point register width. Possible values are:
# "fp32": sets the GCC -mfp32 option.
# "fp64": sets the GCC -mfp64 option.
# "fpxx": sets the GCC -mfpxx option.
mips_fpu_mode = "fp32"
}
} else if (current_cpu == "mips64el") {
# MIPS arch variant. Possible values are:
# "r2"
# "r6"
if (is_android) {
declare_args() {
mips_arch_variant = "r6"