< prev index next >

src/cpu/ppc/vm/assembler_ppc.hpp

Print this page
rev 8389 : 8080684: PPC64: Fix little-endian build after "8077838: Recent developments for ppc"


1117   static inline unsigned int align_addr(unsigned int addr, unsigned int a) {
1118     return ((addr + (a - 1)) & ~(a - 1));
1119   }
1120 
1121   static inline bool is_aligned(unsigned int addr, unsigned int a) {
1122     return (0 == addr % a);
1123   }
1124 
1125   void flush() {
1126     AbstractAssembler::flush();
1127   }
1128 
1129   inline void emit_int32(int);  // shadows AbstractAssembler::emit_int32
1130   inline void emit_data(int);
1131   inline void emit_data(int, RelocationHolder const&);
1132   inline void emit_data(int, relocInfo::relocType rtype);
1133 
1134   // Emit an address.
1135   inline address emit_addr(const address addr = NULL);
1136 
1137 #if !defined(ABI_ELFv2)
1138   // Emit a function descriptor with the specified entry point, TOC,
1139   // and ENV. If the entry point is NULL, the descriptor will point
1140   // just past the descriptor.
1141   // Use values from friend functions as defaults.


1142   inline address emit_fd(address entry = NULL,
1143                          address toc = (address) FunctionDescriptor::friend_toc,
1144                          address env = (address) FunctionDescriptor::friend_env);
1145 #endif
1146 
1147   /////////////////////////////////////////////////////////////////////////////////////
1148   // PPC instructions
1149   /////////////////////////////////////////////////////////////////////////////////////
1150 
1151   // Memory instructions use r0 as hard coded 0, e.g. to simulate loading
1152   // immediates. The normal instruction encoders enforce that r0 is not
1153   // passed to them. Use either extended mnemonics encoders or the special ra0
1154   // versions.
1155 
1156   // Issue an illegal instruction.
1157   inline void illtrap();
1158   static inline bool is_illtrap(int x);
1159 
1160   // PPC 1, section 3.3.8, Fixed-Point Arithmetic Instructions
1161   inline void addi( Register d, Register a, int si16);
1162   inline void addis(Register d, Register a, int si16);
1163  private:
1164   inline void addi_r0ok( Register d, Register a, int si16);
1165   inline void addis_r0ok(Register d, Register a, int si16);




1117   static inline unsigned int align_addr(unsigned int addr, unsigned int a) {
1118     return ((addr + (a - 1)) & ~(a - 1));
1119   }
1120 
1121   static inline bool is_aligned(unsigned int addr, unsigned int a) {
1122     return (0 == addr % a);
1123   }
1124 
1125   void flush() {
1126     AbstractAssembler::flush();
1127   }
1128 
1129   inline void emit_int32(int);  // shadows AbstractAssembler::emit_int32
1130   inline void emit_data(int);
1131   inline void emit_data(int, RelocationHolder const&);
1132   inline void emit_data(int, relocInfo::relocType rtype);
1133 
1134   // Emit an address.
1135   inline address emit_addr(const address addr = NULL);
1136 

1137   // Emit a function descriptor with the specified entry point, TOC,
1138   // and ENV. If the entry point is NULL, the descriptor will point
1139   // just past the descriptor.
1140   // Use values from friend functions as defaults.
1141   // If we are running in a little-endian environment (i.e. if ABI_ELFv2 is
1142   // defined) this function will emit no code and simply return the current PC)
1143   inline address emit_fd(address entry = NULL,
1144                          address toc = (address) FunctionDescriptor::friend_toc,
1145                          address env = (address) FunctionDescriptor::friend_env);

1146 
1147   /////////////////////////////////////////////////////////////////////////////////////
1148   // PPC instructions
1149   /////////////////////////////////////////////////////////////////////////////////////
1150 
1151   // Memory instructions use r0 as hard coded 0, e.g. to simulate loading
1152   // immediates. The normal instruction encoders enforce that r0 is not
1153   // passed to them. Use either extended mnemonics encoders or the special ra0
1154   // versions.
1155 
1156   // Issue an illegal instruction.
1157   inline void illtrap();
1158   static inline bool is_illtrap(int x);
1159 
1160   // PPC 1, section 3.3.8, Fixed-Point Arithmetic Instructions
1161   inline void addi( Register d, Register a, int si16);
1162   inline void addis(Register d, Register a, int si16);
1163  private:
1164   inline void addi_r0ok( Register d, Register a, int si16);
1165   inline void addis_r0ok(Register d, Register a, int si16);


< prev index next >