diff --git a/common.gypi b/common.gypi index cde40e911..36fff0ddb 100644 --- a/common.gypi +++ b/common.gypi @@ -217,6 +217,9 @@ # 2: revision 2 'mips_dsp_rev%': 0, + # MIPS SIMD Arch compilation flag. + 'mips_msa%': 1, + 'conditions': [ ['branding == "Chrome"', { 'branding_path_component%': 'google_chrome', @@ -340,6 +343,7 @@ 'target_subarch%': '<(target_subarch)', 'mips_arch_variant%': '<(mips_arch_variant)', 'mips_dsp_rev%': '<(mips_dsp_rev)', + 'mips_msa%': '<(mips_msa)', 'toolkit_views%': '<(toolkit_views)', 'desktop_linux%': '<(desktop_linux)', 'use_aura%': '<(use_aura)', @@ -1120,6 +1124,7 @@ 'target_subarch%': '<(target_subarch)', 'mips_arch_variant%': '<(mips_arch_variant)', 'mips_dsp_rev%': '<(mips_dsp_rev)', + 'mips_msa%': '<(mips_msa)', 'host_arch%': '<(host_arch)', 'toolkit_views%': '<(toolkit_views)', 'ui_compositor_image_transport%': '<(ui_compositor_image_transport)', @@ -4119,6 +4124,9 @@ ['clang==0 and OS=="android"', { 'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',], }], + ['mips_msa==1', { + 'cflags': ['-mmsa', '-mfp64', '-msched-weight', '-mload-store-pairs'], + }], ], 'cflags': [ '-mfp64', '-mno-odd-spreg' ], 'ldflags': [ '-mfp64', '-mno-odd-spreg' ], @@ -4225,6 +4233,9 @@ 'cflags': ['-mips64r6', '-Wa,-mips64r6'], 'ldflags': ['-mips64r6'], }], + ['mips_msa==1', { + 'cflags': ['-mmsa', '-mfp64', '-msched-weight', '-mload-store-pairs'], + }], ], }], ['mips_arch_variant=="r2"', { diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn index a319d6028..957c8365f 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -561,6 +561,14 @@ config("compiler_cpu_abi") { ] } } + if (mips_use_msa == true) { + cflags += [ + "-mmsa", + "-mfp64", + "-msched-weight", + "-mload-store-pairs", + ] + } } else if (mips_arch_variant == "r2") { if (is_clang) { if (is_android) { @@ -637,6 +645,14 @@ config("compiler_cpu_abi") { ] ldflags += [ "-mips64r6" ] } + if (mips_use_msa == true) { + cflags += [ + "-mmsa", + "-mfp64", + "-msched-weight", + "-mload-store-pairs", + ] + } } else if (mips_arch_variant == "r2") { cflags += [ "-mips64r2", diff --git a/config/mips.gni b/config/mips.gni index c25b2679d..646a55ba7 100644 --- a/config/mips.gni +++ b/config/mips.gni @@ -22,6 +22,9 @@ if (current_cpu == "mipsel" || v8_current_cpu == "mipsel") { # 2: revision 2 mips_dsp_rev = 0 + # MIPS SIMD Arch compilation flag. + mips_use_msa = true + # MIPS floating-point ABI. Possible values are: # "hard": sets the GCC -mhard-float option. # "soft": sets the GCC -msoft-float option. @@ -40,6 +43,9 @@ if (current_cpu == "mipsel" || v8_current_cpu == "mipsel") { if (current_os == "android" || target_os == "android") { declare_args() { mips_arch_variant = "r6" + + # MIPS SIMD Arch compilation flag. + mips_use_msa = true } } else { declare_args() {