From 600dd162afa9ad53cc4da781a9f6d9e781bb15e8 Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 13 Jun 2012 22:25:38 +0000 Subject: [PATCH] Merge of rev21557 by Foxsen Make macro MIPS/CPUMIPS/MIPS32 common for big endian and little endian mips processors use MIPSEL* for little endian systems use MIPSEB* for big endian systems git-svn-id: trunk@21599 - --- compiler/aggas.pas | 2 +- compiler/fpcdefs.inc | 3 +++ compiler/mips/cpugas.pas | 4 ++-- compiler/options.pas | 32 +++++++++++++++----------------- compiler/ppu.pas | 4 ++-- compiler/pstatmnt.pas | 2 +- compiler/systems.inc | 4 ++-- compiler/systems.pas | 6 +++--- compiler/systems/i_linux.pas | 10 +++++----- compiler/systems/t_linux.pas | 15 +++++++++------ compiler/utils/Makefile | 12 ++++++------ compiler/utils/fpc.pp | 4 ++-- compiler/utils/ppudump.pp | 2 +- compiler/version.pas | 6 +++--- 14 files changed, 55 insertions(+), 51 deletions(-) diff --git a/compiler/aggas.pas b/compiler/aggas.pas index 8b0e277692..e64d96a1ba 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -1177,7 +1177,7 @@ implementation else AsmWriteln(tai_symbol(hp).sym.name); end; - if target_info.system in [system_mipsel_linux,system_mips_linux] then + if target_info.system in [system_mipsel_linux,system_mipseb_linux] then begin AsmWrite(#9'.ent'#9); if replaceforbidden then diff --git a/compiler/fpcdefs.inc b/compiler/fpcdefs.inc index 821c4e865c..5374c4949b 100644 --- a/compiler/fpcdefs.inc +++ b/compiler/fpcdefs.inc @@ -171,6 +171,9 @@ {$ifdef mipsel} {$define mips} {$endif mipsel} +{$ifdef mipseb} + {$define mips} +{$endif mipseb} {$ifdef mips} {$define cpu32bit} diff --git a/compiler/mips/cpugas.pas b/compiler/mips/cpugas.pas index 8bea6f4ac4..a3807882e4 100644 --- a/compiler/mips/cpugas.pas +++ b/compiler/mips/cpugas.pas @@ -296,7 +296,7 @@ unit cpugas; idtxt: 'AS'; asmbin: 'as'; asmcmd: '-mips2 -W -EB -o $OBJ $ASM'; - supported_targets: [system_mips_linux]; + supported_targets: [system_mipseb_linux]; flags: [af_allowdirect, af_needar, af_smartlink_sections]; labelprefix: '.L'; comment: '# '; @@ -307,6 +307,6 @@ begin {$ifdef MIPSEL} RegisterAssembler(as_MIPSEL_as_info, TMIPSGNUAssembler); {$else MIPSEL} - RegisterAssembler(as_MIPS_as_info, TMIPSGNUAssembler); + RegisterAssembler(as_MIPSEB_as_info, TMIPSGNUAssembler); {$endif MIPSEL} end. diff --git a/compiler/options.pas b/compiler/options.pas index 7bf4220d6f..3ef9d6b573 100644 --- a/compiler/options.pas +++ b/compiler/options.pas @@ -2765,7 +2765,7 @@ begin { these cpus have an inline sar implementaion } { currently, all supported CPUs have an internal sar implementation } -{ $if defined(x86) or defined(arm) or defined(powerpc) or defined(powerpc64) or defined(sparc) or defined(mips) or defined(mipsel)} +{ $if defined(x86) or defined(arm) or defined(powerpc) or defined(powerpc64) or defined(sparc) or defined(mips)} def_system_macro('FPC_HAS_INTERNAL_SAR'); { $endif} @@ -2882,33 +2882,31 @@ begin {$endif jvm} {$ifdef mipsel} - -// HIGHLY TENTATIVE, from David Zhang's options.pas. MarkMLl. - //def_system_macro('CPUMIPS'); - //def_system_macro('CPUMIPS32'); + def_system_macro('CPUMIPS'); + def_system_macro('CPUMIPS32'); def_system_macro('CPUMIPSEL'); def_system_macro('CPUMIPSEL32'); def_system_macro('CPU32'); -// def_system_macro('FPC_HAS_TYPE_DOUBLE'); -// def_system_macro('FPC_HAS_TYPE_SINGLE'); -// def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_SINGLE'); + def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); def_system_macro('FPC_CURRENCY_IS_INT64'); def_system_macro('FPC_COMP_IS_INT64'); -// def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT'); -{$else not mipsel} -{$ifdef mips} + def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT'); +{$endif mipsel} -// HIGHLY TENTATIVE, from David Zhang's options.pas. MarkMLl. +{$ifdef mipseb} def_system_macro('CPUMIPS'); def_system_macro('CPUMIPS32'); + def_system_macro('CPUMIPSEB'); + def_system_macro('CPUMIPSEB32'); def_system_macro('CPU32'); -// def_system_macro('FPC_HAS_TYPE_DOUBLE'); -// def_system_macro('FPC_HAS_TYPE_SINGLE'); -// def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_DOUBLE'); + def_system_macro('FPC_HAS_TYPE_SINGLE'); + def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE'); def_system_macro('FPC_CURRENCY_IS_INT64'); def_system_macro('FPC_COMP_IS_INT64'); -// def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT'); -{$endif} + def_system_macro('FPC_REQUIRES_PROPER_ALIGNMENT'); {$endif} { read configuration file } diff --git a/compiler/ppu.pas b/compiler/ppu.pas index 61ed0d775c..7c21e52f44 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -178,7 +178,7 @@ const { 6 } 32 {'vis'}, { 7 } 64 {'ia64'}, { 8 } 64 {'x86_64'}, - { 9 } 32 {'mips'}, + { 9 } 32 {'mipseb'}, { 10 } 32 {'arm'}, { 11 } 64 {'powerpc64'}, { 12 } 16 {'avr'}, @@ -196,7 +196,7 @@ const { 6 } 32 {'vis'}, { 7 } 64 {'ia64'}, { 8 } 64 {'x86_64'}, - { 9 } 32 {'mips'}, + { 9 } 32 {'mipseb'}, { 10 } 32 {'arm'}, { 11 } 64 {'powerpc64'}, { 12 } 8 {'avr'}, diff --git a/compiler/pstatmnt.pas b/compiler/pstatmnt.pas index 2e6a78fd34..69bd5ae084 100644 --- a/compiler/pstatmnt.pas +++ b/compiler/pstatmnt.pas @@ -1364,7 +1364,7 @@ implementation include(current_procinfo.flags,pi_is_assembler); p:=_asm_statement; -{$if not(defined(sparc)) and not(defined(arm)) and not(defined(avr)) and not(defined(mips)) and not(defined(mipsel))} +{$if not(defined(sparc)) and not(defined(arm)) and not(defined(avr)) and not(defined(mips))} if (po_assembler in current_procinfo.procdef.procoptions) then begin { set the framepointer to esp for assembler functions when the diff --git a/compiler/systems.inc b/compiler/systems.inc index 2e4017e064..84873cb6fa 100644 --- a/compiler/systems.inc +++ b/compiler/systems.inc @@ -43,7 +43,7 @@ cpu_vm, { 6 } cpu_iA64, { 7 } cpu_x86_64, { 8 } - cpu_mips, { 9 } + cpu_mipseb, { 9 } cpu_arm, { 10 } cpu_powerpc64, { 11 } cpu_avr, { 12 } @@ -143,7 +143,7 @@ system_i386_haiku, { 63 } system_arm_darwin, { 64 } system_x86_64_solaris, { 65 } - system_mips_linux, { 66 } + system_mipseb_linux, { 66 } system_mipsel_linux, { 67 } system_i386_nativent, { 68 } system_i386_iphonesim, { 69 } diff --git a/compiler/systems.pas b/compiler/systems.pas index 12023af3d1..f6b49d5491 100644 --- a/compiler/systems.pas +++ b/compiler/systems.pas @@ -217,7 +217,7 @@ interface systems_wince = [system_arm_wince,system_i386_wince]; systems_linux = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,system_powerpc64_linux, system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux, - system_x86_6432_linux,system_mips_linux,system_mipsel_linux]; + system_x86_6432_linux,system_mipseb_linux,system_mipsel_linux]; systems_freebsd = [system_i386_freebsd, system_x86_64_freebsd]; systems_netbsd = [system_i386_netbsd, @@ -357,7 +357,7 @@ interface cpu2str : array[TSystemCpu] of string[10] = ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64', - 'mips','arm', 'powerpc64', 'avr', 'mipsel','jvm'); + 'mipseb','arm', 'powerpc64', 'avr', 'mipsel','jvm'); abi2str : array[tabi] of string[10] = ('DEFAULT','SYSV','AIX','EABI','ARMEB','EABIHF'); @@ -921,7 +921,7 @@ begin {$ifdef mipsel} default_target(system_mipsel_linux); {$else mipsel} - default_target(system_mips_linux); + default_target(system_mipseb_linux); {$endif mipsel} {$endif mips} diff --git a/compiler/systems/i_linux.pas b/compiler/systems/i_linux.pas index 090e5c4678..1cb79be195 100644 --- a/compiler/systems/i_linux.pas +++ b/compiler/systems/i_linux.pas @@ -792,15 +792,15 @@ unit i_linux; {$endif FPC_ARMEL} {$endif FPC_ARMHF} - system_mips_linux_info : tsysteminfo = + system_mipseb_linux_info : tsysteminfo = ( - system : system_mips_LINUX; - name : 'Linux for MIPS'; + system : system_mipseb_LINUX; + name : 'Linux for MIPSEB'; shortname : 'Linux'; flags : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive, tf_requires_proper_alignment, tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources]; - cpu : cpu_mips; + cpu : cpu_mipseb; unit_env : 'LINUXUNITS'; extradefines : 'UNIX;HASUNIX;CPUMIPS32'; exeext : ''; @@ -968,7 +968,7 @@ initialization {$endif CPUARM} {$ifdef CPUMIPS} {$ifdef linux} - set_source_info(system_mips_linux_info); + set_source_info(system_mipseb_linux_info); {$endif linux} {$endif CPUMIPS} {$ifdef CPUMIPSEL} diff --git a/compiler/systems/t_linux.pas b/compiler/systems/t_linux.pas index 60f0a91365..75ec90b091 100644 --- a/compiler/systems/t_linux.pas +++ b/compiler/systems/t_linux.pas @@ -138,8 +138,11 @@ const {$ifdef arm} platform_select='';{$endif} {unknown :( } {$ifdef m68k} platform_select='';{$endif} {unknown :( } {$ifdef mips} - {$ifdef mipsel} platform_select='-EL';{$else} - platform_select='-EB';{$endif} + {$ifdef mipsel} + platform_select='-EL'; + {$else} + platform_select='-EB'; + {$endif} {$endif} @@ -1182,10 +1185,10 @@ initialization RegisterExport(system_mipsel_linux,texportliblinux); RegisterTarget(system_mipsel_linux_info); {$else MIPS} - RegisterExternalLinker(system_mips_linux_info,TLinkerLinux); - RegisterImport(system_mips_linux,timportliblinux); - RegisterExport(system_mips_linux,texportliblinux); - RegisterTarget(system_mips_linux_info); + RegisterExternalLinker(system_mipseb_linux_info,TLinkerLinux); + RegisterImport(system_mipseb_linux,timportliblinux); + RegisterExport(system_mipseb_linux,texportliblinux); + RegisterTarget(system_mipseb_linux_info); {$endif MIPSEL} {$endif MIPS} RegisterRes(res_elf_info,TWinLikeResourceFile); diff --git a/compiler/utils/Makefile b/compiler/utils/Makefile index 66983ae4e8..e0d3110da2 100644 --- a/compiler/utils/Makefile +++ b/compiler/utils/Makefile @@ -2,7 +2,7 @@ # Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25] # default: all -MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux jvm-java jvm-android +MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mipseb-linux mipsel-linux jvm-java jvm-android BSDs = freebsd netbsd openbsd darwin UNIXs = linux $(BSDs) solaris qnx haiku aix LIMIT83fs = go32v2 os2 emx watcom @@ -492,7 +492,7 @@ endif ifeq ($(FULL_TARGET),armeb-embedded) override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins endif -ifeq ($(FULL_TARGET),mips-linux) +ifeq ($(FULL_TARGET),mipseb-linux) override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins endif ifeq ($(FULL_TARGET),mipsel-linux) @@ -702,7 +702,7 @@ endif ifeq ($(FULL_TARGET),armeb-embedded) override CLEAN_UNITS+=ppu crc usubst endif -ifeq ($(FULL_TARGET),mips-linux) +ifeq ($(FULL_TARGET),mipseb-linux) override CLEAN_UNITS+=ppu crc usubst endif ifeq ($(FULL_TARGET),mipsel-linux) @@ -913,7 +913,7 @@ endif ifeq ($(FULL_TARGET),armeb-embedded) override COMPILER_UNITDIR+=.. endif -ifeq ($(FULL_TARGET),mips-linux) +ifeq ($(FULL_TARGET),mipseb-linux) override COMPILER_UNITDIR+=.. endif ifeq ($(FULL_TARGET),mipsel-linux) @@ -1123,7 +1123,7 @@ endif ifeq ($(FULL_TARGET),armeb-embedded) override COMPILER_SOURCEDIR+=.. endif -ifeq ($(FULL_TARGET),mips-linux) +ifeq ($(FULL_TARGET),mipseb-linux) override COMPILER_SOURCEDIR+=.. endif ifeq ($(FULL_TARGET),mipsel-linux) @@ -1946,7 +1946,7 @@ endif ifeq ($(FULL_TARGET),armeb-embedded) REQUIRE_PACKAGES_RTL=1 endif -ifeq ($(FULL_TARGET),mips-linux) +ifeq ($(FULL_TARGET),mipseb-linux) REQUIRE_PACKAGES_RTL=1 endif ifeq ($(FULL_TARGET),mipsel-linux) diff --git a/compiler/utils/fpc.pp b/compiler/utils/fpc.pp index 9c202f3c6f..4108b8e479 100644 --- a/compiler/utils/fpc.pp +++ b/compiler/utils/fpc.pp @@ -201,8 +201,8 @@ program fpc; cpusuffix:='386' else if processorstr='m68k' then cpusuffix:='68k' - else if processorstr='mips' then - cpusuffix:='mips' + else if processorstr='mipseb' then + cpusuffix:='mipseb' else if processorstr='mipsel' then cpusuffix:='mipsel' else if processorstr='powerpc' then diff --git a/compiler/utils/ppudump.pp b/compiler/utils/ppudump.pp index b6f63c6aa7..64261d271f 100644 --- a/compiler/utils/ppudump.pp +++ b/compiler/utils/ppudump.pp @@ -67,7 +67,7 @@ const { 6 } 'vis', { 7 } 'ia64', { 8 } 'x86_64', - { 9 } 'mips', + { 9 } 'mipseb', { 10 } 'arm', { 11 } 'powerpc64', { 12 } 'avr', diff --git a/compiler/version.pas b/compiler/version.pas index ca5e27655b..0faa32d813 100644 --- a/compiler/version.pas +++ b/compiler/version.pas @@ -71,9 +71,9 @@ interface {$ifdef cpuarm} source_cpu_string = 'arm'; {$endif cpuarm} -{$ifdef cpumips} - source_cpu_string = 'mips'; -{$endif cpumips} +{$ifdef cpumipseb} + source_cpu_string = 'mipseb'; +{$endif cpumipseb} {$ifdef cpumipsel} source_cpu_string = 'mipsel'; {$endif cpumipsel}