Deleted Added
full compact
tc-ppc.c (104834) tc-ppc.c (107492)
1/* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000)
2 Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4 Written by Ian Lance Taylor, Cygnus Support.
5
6 This file is part of GAS, the GNU Assembler.
7
8 GAS is free software; you can redistribute it and/or modify

--- 54 unchanged lines hidden (view full) ---

63#define PPC_HI(v) (((v) >> 16) & 0xffff)
64
65/* #ha(value) denotes the high adjusted value: bits 16 through 31 of
66 the indicated value, compensating for #lo() being treated as a
67 signed number. */
68#define PPC_HA(v) PPC_HI ((v) + 0x8000)
69
70/* #higher(value) denotes bits 32 through 47 of the indicated value. */
1/* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000)
2 Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
3 Free Software Foundation, Inc.
4 Written by Ian Lance Taylor, Cygnus Support.
5
6 This file is part of GAS, the GNU Assembler.
7
8 GAS is free software; you can redistribute it and/or modify

--- 54 unchanged lines hidden (view full) ---

63#define PPC_HI(v) (((v) >> 16) & 0xffff)
64
65/* #ha(value) denotes the high adjusted value: bits 16 through 31 of
66 the indicated value, compensating for #lo() being treated as a
67 signed number. */
68#define PPC_HA(v) PPC_HI ((v) + 0x8000)
69
70/* #higher(value) denotes bits 32 through 47 of the indicated value. */
71#define PPC_HIGHER(v) (((v) >> 32) & 0xffff)
71#define PPC_HIGHER(v) (((v) >> 16 >> 16) & 0xffff)
72
73/* #highera(value) denotes bits 32 through 47 of the indicated value,
74 compensating for #lo() being treated as a signed number. */
75#define PPC_HIGHERA(v) PPC_HIGHER ((v) + 0x8000)
76
77/* #highest(value) denotes bits 48 through 63 of the indicated value. */
72
73/* #highera(value) denotes bits 32 through 47 of the indicated value,
74 compensating for #lo() being treated as a signed number. */
75#define PPC_HIGHERA(v) PPC_HIGHER ((v) + 0x8000)
76
77/* #highest(value) denotes bits 48 through 63 of the indicated value. */
78#define PPC_HIGHEST(v) (((v) >> 48) & 0xffff)
78#define PPC_HIGHEST(v) (((v) >> 24 >> 24) & 0xffff)
79
80/* #highesta(value) denotes bits 48 through 63 of the indicated value,
81 compensating for #lo being treated as a signed number. */
82#define PPC_HIGHESTA(v) PPC_HIGHEST ((v) + 0x8000)
83
84#define SEX16(val) ((((val) & 0xffff) ^ 0x8000) - 0x8000)
85
86static boolean reg_names_p = TARGET_REG_NAMES_P;

--- 760 unchanged lines hidden (view full) ---

847 return 0;
848
849 break;
850#endif
851
852 /* a64 and a32 determine whether to use XCOFF64 or XCOFF32. */
853 case 'a':
854 if (strcmp (arg, "64") == 0)
79
80/* #highesta(value) denotes bits 48 through 63 of the indicated value,
81 compensating for #lo being treated as a signed number. */
82#define PPC_HIGHESTA(v) PPC_HIGHEST ((v) + 0x8000)
83
84#define SEX16(val) ((((val) & 0xffff) ^ 0x8000) - 0x8000)
85
86static boolean reg_names_p = TARGET_REG_NAMES_P;

--- 760 unchanged lines hidden (view full) ---

847 return 0;
848
849 break;
850#endif
851
852 /* a64 and a32 determine whether to use XCOFF64 or XCOFF32. */
853 case 'a':
854 if (strcmp (arg, "64") == 0)
855 ppc_obj64 = 1;
855 {
856#ifdef BFD64
857 ppc_obj64 = 1;
858#else
859 as_fatal (_("%s unsupported"), "-a64");
860#endif
861 }
856 else if (strcmp (arg, "32") == 0)
857 ppc_obj64 = 0;
858 else
859 return 0;
860 break;
861
862 case 'm':
863 /* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2

--- 193 unchanged lines hidden (view full) ---

1057static void
1058ppc_set_cpu ()
1059{
1060 const char *default_os = TARGET_OS;
1061 const char *default_cpu = TARGET_CPU;
1062
1063 if (ppc_cpu == 0)
1064 {
862 else if (strcmp (arg, "32") == 0)
863 ppc_obj64 = 0;
864 else
865 return 0;
866 break;
867
868 case 'm':
869 /* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2

--- 193 unchanged lines hidden (view full) ---

1063static void
1064ppc_set_cpu ()
1065{
1066 const char *default_os = TARGET_OS;
1067 const char *default_cpu = TARGET_CPU;
1068
1069 if (ppc_cpu == 0)
1070 {
1065 if (strncmp (default_os, "aix", 3) == 0
1066 && default_os[3] >= '4' && default_os[3] <= '9')
1071 if (ppc_obj64)
1072 ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64;
1073 else if (strncmp (default_os, "aix", 3) == 0
1074 && default_os[3] >= '4' && default_os[3] <= '9')
1067 ppc_cpu = PPC_OPCODE_COMMON | PPC_OPCODE_32;
1068 else if (strncmp (default_os, "aix3", 4) == 0)
1069 ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32;
1070 else if (strcmp (default_cpu, "rs6000") == 0)
1071 ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32;
1072 else if (strncmp (default_cpu, "powerpc", 7) == 0)
1073 {
1074 if (default_cpu[7] == '6' && default_cpu[8] == '4')

--- 29 unchanged lines hidden (view full) ---

1104
1105 as_fatal (_("Neither Power nor PowerPC opcodes were selected."));
1106 return bfd_arch_unknown;
1107}
1108
1109unsigned long
1110ppc_mach ()
1111{
1075 ppc_cpu = PPC_OPCODE_COMMON | PPC_OPCODE_32;
1076 else if (strncmp (default_os, "aix3", 4) == 0)
1077 ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32;
1078 else if (strcmp (default_cpu, "rs6000") == 0)
1079 ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32;
1080 else if (strncmp (default_cpu, "powerpc", 7) == 0)
1081 {
1082 if (default_cpu[7] == '6' && default_cpu[8] == '4')

--- 29 unchanged lines hidden (view full) ---

1112
1113 as_fatal (_("Neither Power nor PowerPC opcodes were selected."));
1114 return bfd_arch_unknown;
1115}
1116
1117unsigned long
1118ppc_mach ()
1119{
1112 return ppc_obj64 ? bfd_mach_ppc64 : bfd_mach_ppc;
1120 if (ppc_obj64)
1121 return bfd_mach_ppc64;
1122 else if (ppc_arch () == bfd_arch_rs6000)
1123 return bfd_mach_rs6k;
1124 else
1125 return bfd_mach_ppc;
1113}
1114
1115extern char*
1116ppc_target_format ()
1117{
1118#ifdef OBJ_COFF
1119#ifdef TE_PE
1120 return target_big_endian ? "pe-powerpc" : "pe-powerpcle";

--- 4460 unchanged lines hidden ---
1126}
1127
1128extern char*
1129ppc_target_format ()
1130{
1131#ifdef OBJ_COFF
1132#ifdef TE_PE
1133 return target_big_endian ? "pe-powerpc" : "pe-powerpcle";

--- 4460 unchanged lines hidden ---