< prev index next >

src/hotspot/cpu/x86/x86_64.ad

Print this page
rev 53791 : [mq]: JDK-8217909.patch


 152                    RAX,         RAX_H,
 153                    RBP,         RBP_H,
 154                    R13,         R13_H,
 155                    R14,         R14_H,
 156                    R15,         R15_H,
 157                    RSP,         RSP_H);
 158 
 159 
 160 //----------Architecture Description Register Classes--------------------------
 161 // Several register classes are automatically defined based upon information in
 162 // this architecture description.
 163 // 1) reg_class inline_cache_reg           ( /* as def'd in frame section */ )
 164 // 2) reg_class compiler_method_oop_reg    ( /* as def'd in frame section */ )
 165 // 2) reg_class interpreter_method_oop_reg ( /* as def'd in frame section */ )
 166 // 3) reg_class stack_slots( /* one chunk of stack-based "registers" */ )
 167 //
 168 
 169 // Empty register class.
 170 reg_class no_reg();
 171 

























































































 172 // Class for all pointer registers (including RSP and RBP)
 173 reg_class any_reg_with_rbp(RAX, RAX_H,
 174                            RDX, RDX_H,
 175                            RBP, RBP_H,
 176                            RDI, RDI_H,
 177                            RSI, RSI_H,
 178                            RCX, RCX_H,
 179                            RBX, RBX_H,
 180                            RSP, RSP_H,
 181                            R8,  R8_H,
 182                            R9,  R9_H,
 183                            R10, R10_H,
 184                            R11, R11_H,
 185                            R12, R12_H,
 186                            R13, R13_H,
 187                            R14, R14_H,
 188                            R15, R15_H);
 189 
 190 // Class for all pointer registers (including RSP, but excluding RBP)
 191 reg_class any_reg_no_rbp(RAX, RAX_H,
 192                          RDX, RDX_H,
 193                          RDI, RDI_H,
 194                          RSI, RSI_H,
 195                          RCX, RCX_H,
 196                          RBX, RBX_H,
 197                          RSP, RSP_H,
 198                          R8,  R8_H,
 199                          R9,  R9_H,
 200                          R10, R10_H,
 201                          R11, R11_H,
 202                          R12, R12_H,
 203                          R13, R13_H,
 204                          R14, R14_H,
 205                          R15, R15_H);
 206 
 207 // Dynamic register class that selects at runtime between register classes
 208 // any_reg_no_rbp and any_reg_with_rbp (depending on the value of the flag PreserveFramePointer).
 209 // Equivalent to: return PreserveFramePointer ? any_reg_no_rbp : any_reg_with_rbp;
 210 reg_class_dynamic any_reg(any_reg_no_rbp, any_reg_with_rbp, %{ PreserveFramePointer %});
 211 
 212 // Class for all pointer registers (excluding RSP)
 213 reg_class ptr_reg_with_rbp(RAX, RAX_H,
 214                            RDX, RDX_H,
 215                            RBP, RBP_H,
 216                            RDI, RDI_H,
 217                            RSI, RSI_H,
 218                            RCX, RCX_H,
 219                            RBX, RBX_H,
 220                            R8,  R8_H,
 221                            R9,  R9_H,
 222                            R10, R10_H,
 223                            R11, R11_H,
 224                            R13, R13_H,
 225                            R14, R14_H);
 226 
 227 // Class for all pointer registers (excluding RSP and RBP)
 228 reg_class ptr_reg_no_rbp(RAX, RAX_H,
 229                          RDX, RDX_H,
 230                          RDI, RDI_H,
 231                          RSI, RSI_H,
 232                          RCX, RCX_H,
 233                          RBX, RBX_H,
 234                          R8,  R8_H,
 235                          R9,  R9_H,
 236                          R10, R10_H,
 237                          R11, R11_H,
 238                          R13, R13_H,
 239                          R14, R14_H);
 240 
 241 // Dynamic register class that selects between ptr_reg_no_rbp and ptr_reg_with_rbp.
 242 reg_class_dynamic ptr_reg(ptr_reg_no_rbp, ptr_reg_with_rbp, %{ PreserveFramePointer %});
 243 
 244 // Class for all pointer registers (excluding RAX and RSP)
 245 reg_class ptr_no_rax_reg_with_rbp(RDX, RDX_H,
 246                                   RBP, RBP_H,
 247                                   RDI, RDI_H,
 248                                   RSI, RSI_H,
 249                                   RCX, RCX_H,
 250                                   RBX, RBX_H,
 251                                   R8,  R8_H,
 252                                   R9,  R9_H,
 253                                   R10, R10_H,
 254                                   R11, R11_H,
 255                                   R13, R13_H,
 256                                   R14, R14_H);
 257 
 258 // Class for all pointer registers (excluding RAX, RSP, and RBP)
 259 reg_class ptr_no_rax_reg_no_rbp(RDX, RDX_H,
 260                                 RDI, RDI_H,
 261                                 RSI, RSI_H,
 262                                 RCX, RCX_H,
 263                                 RBX, RBX_H,
 264                                 R8,  R8_H,
 265                                 R9,  R9_H,
 266                                 R10, R10_H,
 267                                 R11, R11_H,
 268                                 R13, R13_H,
 269                                 R14, R14_H);
 270 
 271 // Dynamic register class that selects between ptr_no_rax_reg_no_rbp and ptr_no_rax_reg_with_rbp.
 272 reg_class_dynamic ptr_no_rax_reg(ptr_no_rax_reg_no_rbp, ptr_no_rax_reg_with_rbp, %{ PreserveFramePointer %});
 273 
 274 // Class for all pointer registers (excluding RAX, RBX, and RSP)
 275 reg_class ptr_no_rax_rbx_reg_with_rbp(RDX, RDX_H,
 276                                       RBP, RBP_H,
 277                                       RDI, RDI_H,
 278                                       RSI, RSI_H,
 279                                       RCX, RCX_H,
 280                                       R8,  R8_H,
 281                                       R9,  R9_H,
 282                                       R10, R10_H,
 283                                       R11, R11_H,
 284                                       R13, R13_H,
 285                                       R14, R14_H);
 286 
 287 // Class for all pointer registers (excluding RAX, RBX, RSP, and RBP)
 288 reg_class ptr_no_rax_rbx_reg_no_rbp(RDX, RDX_H,
 289                                     RDI, RDI_H,
 290                                     RSI, RSI_H,
 291                                     RCX, RCX_H,
 292                                     R8,  R8_H,
 293                                     R9,  R9_H,
 294                                     R10, R10_H,
 295                                     R11, R11_H,
 296                                     R13, R13_H,
 297                                     R14, R14_H);
 298 
 299 // Dynamic register class that selects between ptr_no_rax_rbx_reg_no_rbp and ptr_no_rax_rbx_reg_with_rbp.
 300 reg_class_dynamic ptr_no_rax_rbx_reg(ptr_no_rax_rbx_reg_no_rbp, ptr_no_rax_rbx_reg_with_rbp, %{ PreserveFramePointer %});
 301 
 302 // Singleton class for RAX pointer register
 303 reg_class ptr_rax_reg(RAX, RAX_H);
 304 
 305 // Singleton class for RBX pointer register
 306 reg_class ptr_rbx_reg(RBX, RBX_H);
 307 
 308 // Singleton class for RSI pointer register
 309 reg_class ptr_rsi_reg(RSI, RSI_H);
 310 
 311 // Singleton class for RDI pointer register
 312 reg_class ptr_rdi_reg(RDI, RDI_H);
 313 
 314 // Singleton class for stack pointer
 315 reg_class ptr_rsp_reg(RSP, RSP_H);
 316 
 317 // Singleton class for TLS pointer
 318 reg_class ptr_r15_reg(R15, R15_H);
 319 
 320 // Class for all long registers (excluding RSP)
 321 reg_class long_reg_with_rbp(RAX, RAX_H,
 322                             RDX, RDX_H,
 323                             RBP, RBP_H,
 324                             RDI, RDI_H,
 325                             RSI, RSI_H,
 326                             RCX, RCX_H,
 327                             RBX, RBX_H,
 328                             R8,  R8_H,
 329                             R9,  R9_H,
 330                             R10, R10_H,
 331                             R11, R11_H,
 332                             R13, R13_H,
 333                             R14, R14_H);
 334 
 335 // Class for all long registers (excluding RSP and RBP)
 336 reg_class long_reg_no_rbp(RAX, RAX_H,
 337                           RDX, RDX_H,
 338                           RDI, RDI_H,
 339                           RSI, RSI_H,
 340                           RCX, RCX_H,
 341                           RBX, RBX_H,
 342                           R8,  R8_H,
 343                           R9,  R9_H,
 344                           R10, R10_H,
 345                           R11, R11_H,
 346                           R13, R13_H,
 347                           R14, R14_H);
 348 
 349 // Dynamic register class that selects between long_reg_no_rbp and long_reg_with_rbp.
 350 reg_class_dynamic long_reg(long_reg_no_rbp, long_reg_with_rbp, %{ PreserveFramePointer %});
 351 
 352 // Class for all long registers (excluding RAX, RDX and RSP)
 353 reg_class long_no_rax_rdx_reg_with_rbp(RBP, RBP_H,
 354                                        RDI, RDI_H,
 355                                        RSI, RSI_H,
 356                                        RCX, RCX_H,
 357                                        RBX, RBX_H,
 358                                        R8,  R8_H,
 359                                        R9,  R9_H,
 360                                        R10, R10_H,
 361                                        R11, R11_H,
 362                                        R13, R13_H,
 363                                        R14, R14_H);
 364 
 365 // Class for all long registers (excluding RAX, RDX, RSP, and RBP)
 366 reg_class long_no_rax_rdx_reg_no_rbp(RDI, RDI_H,
 367                                      RSI, RSI_H,
 368                                      RCX, RCX_H,
 369                                      RBX, RBX_H,
 370                                      R8,  R8_H,
 371                                      R9,  R9_H,
 372                                      R10, R10_H,
 373                                      R11, R11_H,
 374                                      R13, R13_H,
 375                                      R14, R14_H);
 376 
 377 // Dynamic register class that selects between long_no_rax_rdx_reg_no_rbp and long_no_rax_rdx_reg_with_rbp.
 378 reg_class_dynamic long_no_rax_rdx_reg(long_no_rax_rdx_reg_no_rbp, long_no_rax_rdx_reg_with_rbp, %{ PreserveFramePointer %});
 379 
 380 // Class for all long registers (excluding RCX and RSP)
 381 reg_class long_no_rcx_reg_with_rbp(RBP, RBP_H,
 382                                    RDI, RDI_H,
 383                                    RSI, RSI_H,
 384                                    RAX, RAX_H,
 385                                    RDX, RDX_H,
 386                                    RBX, RBX_H,
 387                                    R8,  R8_H,
 388                                    R9,  R9_H,
 389                                    R10, R10_H,
 390                                    R11, R11_H,
 391                                    R13, R13_H,
 392                                    R14, R14_H);
 393 
 394 // Class for all long registers (excluding RCX, RSP, and RBP)
 395 reg_class long_no_rcx_reg_no_rbp(RDI, RDI_H,
 396                                  RSI, RSI_H,
 397                                  RAX, RAX_H,
 398                                  RDX, RDX_H,
 399                                  RBX, RBX_H,
 400                                  R8,  R8_H,
 401                                  R9,  R9_H,
 402                                  R10, R10_H,
 403                                  R11, R11_H,
 404                                  R13, R13_H,
 405                                  R14, R14_H);
 406 
 407 // Dynamic register class that selects between long_no_rcx_reg_no_rbp and long_no_rcx_reg_with_rbp.
 408 reg_class_dynamic long_no_rcx_reg(long_no_rcx_reg_no_rbp, long_no_rcx_reg_with_rbp, %{ PreserveFramePointer %});
 409 
 410 // Singleton class for RAX long register
 411 reg_class long_rax_reg(RAX, RAX_H);
 412 
 413 // Singleton class for RCX long register
 414 reg_class long_rcx_reg(RCX, RCX_H);
 415 
 416 // Singleton class for RDX long register
 417 reg_class long_rdx_reg(RDX, RDX_H);
 418 
 419 // Class for all int registers (excluding RSP)
 420 reg_class int_reg_with_rbp(RAX,
 421                            RDX,
 422                            RBP,
 423                            RDI,
 424                            RSI,
 425                            RCX,
 426                            RBX,
 427                            R8,
 428                            R9,
 429                            R10,
 430                            R11,
 431                            R13,
 432                            R14);
 433 
 434 // Class for all int registers (excluding RSP and RBP)
 435 reg_class int_reg_no_rbp(RAX,
 436                          RDX,
 437                          RDI,
 438                          RSI,
 439                          RCX,
 440                          RBX,
 441                          R8,
 442                          R9,
 443                          R10,
 444                          R11,
 445                          R13,
 446                          R14);
 447 
 448 // Dynamic register class that selects between int_reg_no_rbp and int_reg_with_rbp.
 449 reg_class_dynamic int_reg(int_reg_no_rbp, int_reg_with_rbp, %{ PreserveFramePointer %});
 450 
 451 // Class for all int registers (excluding RCX and RSP)
 452 reg_class int_no_rcx_reg_with_rbp(RAX,
 453                                   RDX,
 454                                   RBP,
 455                                   RDI,
 456                                   RSI,
 457                                   RBX,
 458                                   R8,
 459                                   R9,
 460                                   R10,
 461                                   R11,
 462                                   R13,
 463                                   R14);
 464 
 465 // Class for all int registers (excluding RCX, RSP, and RBP)
 466 reg_class int_no_rcx_reg_no_rbp(RAX,
 467                                 RDX,
 468                                 RDI,
 469                                 RSI,
 470                                 RBX,
 471                                 R8,
 472                                 R9,
 473                                 R10,
 474                                 R11,
 475                                 R13,
 476                                 R14);
 477 
 478 // Dynamic register class that selects between int_no_rcx_reg_no_rbp and int_no_rcx_reg_with_rbp.
 479 reg_class_dynamic int_no_rcx_reg(int_no_rcx_reg_no_rbp, int_no_rcx_reg_with_rbp, %{ PreserveFramePointer %});
 480 
 481 // Class for all int registers (excluding RAX, RDX, and RSP)
 482 reg_class int_no_rax_rdx_reg_with_rbp(RBP,
 483                                       RDI,
 484                                       RSI,
 485                                       RCX,
 486                                       RBX,
 487                                       R8,
 488                                       R9,
 489                                       R10,
 490                                       R11,
 491                                       R13,
 492                                       R14);
 493 
 494 // Class for all int registers (excluding RAX, RDX, RSP, and RBP)
 495 reg_class int_no_rax_rdx_reg_no_rbp(RDI,
 496                                     RSI,
 497                                     RCX,
 498                                     RBX,
 499                                     R8,
 500                                     R9,
 501                                     R10,
 502                                     R11,
 503                                     R13,
 504                                     R14);
 505 
 506 // Dynamic register class that selects between int_no_rax_rdx_reg_no_rbp and int_no_rax_rdx_reg_with_rbp.
 507 reg_class_dynamic int_no_rax_rdx_reg(int_no_rax_rdx_reg_no_rbp, int_no_rax_rdx_reg_with_rbp, %{ PreserveFramePointer %});
 508 
 509 // Singleton class for RAX int register
 510 reg_class int_rax_reg(RAX);
 511 
 512 // Singleton class for RBX int register
 513 reg_class int_rbx_reg(RBX);
 514 
 515 // Singleton class for RCX int register
 516 reg_class int_rcx_reg(RCX);
 517 
 518 // Singleton class for RCX int register
 519 reg_class int_rdx_reg(RDX);
 520 
 521 // Singleton class for RCX int register
 522 reg_class int_rdi_reg(RDI);
 523 
 524 // Singleton class for instruction pointer
 525 // reg_class ip_reg(RIP);
 526 
 527 %}
 528 
 529 //----------SOURCE BLOCK-------------------------------------------------------
 530 // This is a block of C++ code which provides values, functions, and
 531 // definitions necessary in the rest of the architecture description
























 532 source %{
 533 #define   RELOC_IMM64    Assembler::imm_operand
 534 #define   RELOC_DISP32   Assembler::disp32_operand
 535 
 536 #define __ _masm.



































































































 537 
 538 static bool generate_vzeroupper(Compile* C) {
 539   return (VM_Version::supports_vzeroupper() && (C->max_vector_size() > 16 || C->clear_upper_avx() == true)) ? true: false;  // Generate vzeroupper
 540 }
 541 
 542 static int clear_avx_size() {
 543   return generate_vzeroupper(Compile::current()) ? 3: 0;  // vzeroupper
 544 }
 545 
 546 // !!!!! Special hack to get all types of calls to specify the byte offset
 547 //       from the start of the call to the point where the return address
 548 //       will point.
 549 int MachCallStaticJavaNode::ret_addr_offset()
 550 {
 551   int offset = 5; // 5 bytes from start of call to where return address points
 552   offset += clear_avx_size();
 553   return offset;
 554 }
 555 
 556 int MachCallDynamicJavaNode::ret_addr_offset()




 152                    RAX,         RAX_H,
 153                    RBP,         RBP_H,
 154                    R13,         R13_H,
 155                    R14,         R14_H,
 156                    R15,         R15_H,
 157                    RSP,         RSP_H);
 158 
 159 
 160 //----------Architecture Description Register Classes--------------------------
 161 // Several register classes are automatically defined based upon information in
 162 // this architecture description.
 163 // 1) reg_class inline_cache_reg           ( /* as def'd in frame section */ )
 164 // 2) reg_class compiler_method_oop_reg    ( /* as def'd in frame section */ )
 165 // 2) reg_class interpreter_method_oop_reg ( /* as def'd in frame section */ )
 166 // 3) reg_class stack_slots( /* one chunk of stack-based "registers" */ )
 167 //
 168 
 169 // Empty register class.
 170 reg_class no_reg();
 171 
 172 // Class for all pointer/long registers
 173 reg_class all_reg(RAX, RAX_H,
 174                   RDX, RDX_H,
 175                   RBP, RBP_H,
 176                   RDI, RDI_H,
 177                   RSI, RSI_H,
 178                   RCX, RCX_H,
 179                   RBX, RBX_H,
 180                   RSP, RSP_H,
 181                   R8,  R8_H,
 182                   R9,  R9_H,
 183                   R10, R10_H,
 184                   R11, R11_H,
 185                   R12, R12_H,
 186                   R13, R13_H,
 187                   R14, R14_H,
 188                   R15, R15_H);
 189 
 190 // Class for all int registers
 191 reg_class all_int_reg(RAX
 192                       RDX,
 193                       RBP,
 194                       RDI,
 195                       RSI,
 196                       RCX,
 197                       RBX,
 198                       R8,
 199                       R9,
 200                       R10,
 201                       R11,
 202                       R12,
 203                       R13,
 204                       R14);
 205 
 206 // Class for all pointer registers
 207 reg_class any_reg %{
 208   return _ANY_REG_mask;
 209 %}
 210 
 211 // Class for all pointer registers (excluding RSP)
 212 reg_class ptr_reg %{
 213   return _PTR_REG_mask;
 214 %}
 215 
 216 // Class for all pointer registers (excluding RSP and RBP)
 217 reg_class ptr_reg_no_rbp %{
 218   return _PTR_REG_NO_RBP_mask;
 219 %}
 220 
 221 // Class for all pointer registers (excluding RAX and RSP)
 222 reg_class ptr_no_rax_reg %{
 223   return _PTR_NO_RAX_REG_mask;
 224 %}
 225 
 226 // Class for all pointer registers (excluding RAX, RBX, and RSP)
 227 reg_class ptr_no_rax_rbx_reg %{
 228   return _PTR_NO_RAX_RBX_REG_mask;
 229 %}
 230 
 231 // Class for all long registers (excluding RSP)
 232 reg_class long_reg %{
 233   return _LONG_REG_mask;
 234 %}
 235 
 236 // Class for all long registers (excluding RAX, RDX and RSP)
 237 reg_class long_no_rax_rdx_reg %{
 238   return _LONG_NO_RAX_RDX_REG_mask;
 239 %}
 240 
 241 // Class for all long registers (excluding RCX and RSP)
 242 reg_class long_no_rcx_reg %{
 243   return _LONG_NO_RCX_REG_mask;
 244 %}
 245 
 246 // Class for all int registers (excluding RSP)
 247 reg_class int_reg %{
 248   return _INT_REG_mask;
 249 %}
 250 
 251 // Class for all int registers (excluding RAX, RDX, and RSP)
 252 reg_class int_no_rax_rdx_reg %{
 253   return _INT_NO_RAX_RDX_REG_mask;
 254 %}
 255 
 256 // Class for all int registers (excluding RCX and RSP)
 257 reg_class int_no_rcx_reg %{
 258   return _INT_NO_RCX_REG_mask;
 259 %}
 260 
 261 // Class for all pointer registers (including RSP and RBP)
 262 reg_class any_reg0_with_rbp(RAX, RAX_H,
 263                             RDX, RDX_H,
 264                             RBP, RBP_H,
 265                             RDI, RDI_H,
 266                             RSI, RSI_H,
 267                             RCX, RCX_H,
 268                             RBX, RBX_H,
 269                             RSP, RSP_H,
 270                             R8,  R8_H,
 271                             R9,  R9_H,
 272                             R10, R10_H,
 273                             R11, R11_H,
 274                             R12, R12_H,
 275                             R13, R13_H,
 276                             R14, R14_H,
 277                             R15, R15_H);
 278 
 279 // Class for all pointer registers (including RSP, but excluding RBP)
 280 reg_class any_reg0_no_rbp(RAX, RAX_H,
 281                           RDX, RDX_H,
 282                           RDI, RDI_H,
 283                           RSI, RSI_H,
 284                           RCX, RCX_H,
 285                           RBX, RBX_H,
 286                           RSP, RSP_H,
 287                           R8,  R8_H,
 288                           R9,  R9_H,
 289                           R10, R10_H,
 290                           R11, R11_H,
 291                           R12, R12_H,
 292                           R13, R13_H,
 293                           R14, R14_H,
 294                           R15, R15_H);
 295 
 296 // Dynamic register class that selects at runtime between register classes
 297 // any_reg_no_rbp and any_reg_with_rbp (depending on the value of the flag PreserveFramePointer).
 298 // Equivalent to: return PreserveFramePointer ? any_reg_no_rbp : any_reg_with_rbp;
 299 reg_class_dynamic any_reg0(any_reg0_no_rbp, any_reg0_with_rbp, %{ PreserveFramePointer %});
 300 
 301 // Class for all pointer registers
 302 reg_class ptr_reg0_with_rbp(RAX, RAX_H,
 303                             RDX, RDX_H,
 304                             RBP, RBP_H,
 305                             RDI, RDI_H,
 306                             RSI, RSI_H,
 307                             RCX, RCX_H,
 308                             RBX, RBX_H,
 309                             R8,  R8_H,
 310                             R9,  R9_H,
 311                             R10, R10_H,
 312                             R11, R11_H,
 313                             R13, R13_H,
 314                             R14, R14_H);
 315 
 316 reg_class ptr_reg0_no_rbp(RAX, RAX_H,

 317                           RDX, RDX_H,
 318                           RDI, RDI_H,
 319                           RSI, RSI_H,
 320                           RCX, RCX_H,
 321                           RBX, RBX_H,
 322                           R8,  R8_H,
 323                           R9,  R9_H,
 324                           R10, R10_H,
 325                           R11, R11_H,
 326                           R13, R13_H,
 327                           R14, R14_H);
 328 
 329 // Dynamic register class that selects between ptr_reg_no_rbp and ptr_reg_with_rbp.
 330 reg_class_dynamic ptr_reg0(ptr_reg0_no_rbp, ptr_reg0_with_rbp, %{ PreserveFramePointer %});
 331 
 332 // Class for all pointer registers (excluding RAX and RSP)
 333 reg_class ptr_no_rax_reg0_with_rbp(RDX, RDX_H,
 334                                   RBP, RBP_H,
 335                                   RDI, RDI_H,
 336                                   RSI, RSI_H,
 337                                   RCX, RCX_H,
 338                                   RBX, RBX_H,
 339                                   R8,  R8_H,
 340                                   R9,  R9_H,
 341                                   R10, R10_H,
 342                                   R11, R11_H,
 343                                   R13, R13_H,
 344                                   R14, R14_H);
 345 
 346 // Class for all pointer registers (excluding RAX, RSP, and RBP)
 347 reg_class ptr_no_rax_reg0_no_rbp(RDX, RDX_H,
 348                                 RDI, RDI_H,
 349                                 RSI, RSI_H,
 350                                 RCX, RCX_H,
 351                                 RBX, RBX_H,
 352                                 R8,  R8_H,
 353                                 R9,  R9_H,
 354                                 R10, R10_H,
 355                                 R11, R11_H,
 356                                 R13, R13_H,
 357                                 R14, R14_H);
 358 
 359 // Dynamic register class that selects between ptr_no_rax_reg_no_rbp and ptr_no_rax_reg_with_rbp.
 360 reg_class_dynamic ptr_no_rax_reg0(ptr_no_rax_reg0_no_rbp, ptr_no_rax_reg0_with_rbp, %{ PreserveFramePointer %});
 361 
 362 // Class for all pointer registers (excluding RAX, RBX, and RSP)
 363 reg_class ptr_no_rax_rbx_reg0_with_rbp(RDX, RDX_H,
 364                                       RBP, RBP_H,
 365                                       RDI, RDI_H,
 366                                       RSI, RSI_H,
 367                                       RCX, RCX_H,
 368                                       R8,  R8_H,
 369                                       R9,  R9_H,
 370                                       R10, R10_H,
 371                                       R11, R11_H,
 372                                       R13, R13_H,
 373                                       R14, R14_H);
 374 
 375 // Class for all pointer registers (excluding RAX, RBX, RSP, and RBP)
 376 reg_class ptr_no_rax_rbx_reg0_no_rbp(RDX, RDX_H,
 377                                     RDI, RDI_H,
 378                                     RSI, RSI_H,
 379                                     RCX, RCX_H,
 380                                     R8,  R8_H,
 381                                     R9,  R9_H,
 382                                     R10, R10_H,
 383                                     R11, R11_H,
 384                                     R13, R13_H,
 385                                     R14, R14_H);
 386 
 387 // Dynamic register class that selects between ptr_no_rax_rbx_reg_no_rbp and ptr_no_rax_rbx_reg_with_rbp.
 388 reg_class_dynamic ptr_no_rax_rbx_reg0(ptr_no_rax_rbx_reg0_no_rbp, ptr_no_rax_rbx_reg0_with_rbp, %{ PreserveFramePointer %});
 389 
 390 // Singleton class for RAX pointer register
 391 reg_class ptr_rax_reg(RAX, RAX_H);
 392 
 393 // Singleton class for RBX pointer register
 394 reg_class ptr_rbx_reg(RBX, RBX_H);
 395 
 396 // Singleton class for RSI pointer register
 397 reg_class ptr_rsi_reg(RSI, RSI_H);
 398 
 399 // Singleton class for RDI pointer register
 400 reg_class ptr_rdi_reg(RDI, RDI_H);
 401 
 402 // Singleton class for stack pointer
 403 reg_class ptr_rsp_reg(RSP, RSP_H);
 404 
 405 // Singleton class for TLS pointer
 406 reg_class ptr_r15_reg(R15, R15_H);
 407 
 408 // Class for all long registers (excluding RSP)
 409 reg_class long_reg0_with_rbp(RAX, RAX_H,
 410                             RDX, RDX_H,
 411                             RBP, RBP_H,
 412                             RDI, RDI_H,
 413                             RSI, RSI_H,
 414                             RCX, RCX_H,
 415                             RBX, RBX_H,
 416                             R8,  R8_H,
 417                             R9,  R9_H,
 418                             R10, R10_H,
 419                             R11, R11_H,
 420                             R13, R13_H,
 421                             R14, R14_H);
 422 
 423 // Class for all long registers (excluding RSP and RBP)
 424 reg_class long_reg0_no_rbp(RAX, RAX_H,
 425                           RDX, RDX_H,
 426                           RDI, RDI_H,
 427                           RSI, RSI_H,
 428                           RCX, RCX_H,
 429                           RBX, RBX_H,
 430                           R8,  R8_H,
 431                           R9,  R9_H,
 432                           R10, R10_H,
 433                           R11, R11_H,
 434                           R13, R13_H,
 435                           R14, R14_H);
 436 
 437 // Dynamic register class that selects between long_reg_no_rbp and long_reg_with_rbp.
 438 reg_class_dynamic long_reg0(long_reg0_no_rbp, long_reg0_with_rbp, %{ PreserveFramePointer %});
 439 
 440 // Class for all long registers (excluding RAX, RDX and RSP)
 441 reg_class long_no_rax_rdx_reg0_with_rbp(RBP, RBP_H,
 442                                        RDI, RDI_H,
 443                                        RSI, RSI_H,
 444                                        RCX, RCX_H,
 445                                        RBX, RBX_H,
 446                                        R8,  R8_H,
 447                                        R9,  R9_H,
 448                                        R10, R10_H,
 449                                        R11, R11_H,
 450                                        R13, R13_H,
 451                                        R14, R14_H);
 452 
 453 // Class for all long registers (excluding RAX, RDX, RSP, and RBP)
 454 reg_class long_no_rax_rdx_reg0_no_rbp(RDI, RDI_H,
 455                                      RSI, RSI_H,
 456                                      RCX, RCX_H,
 457                                      RBX, RBX_H,
 458                                      R8,  R8_H,
 459                                      R9,  R9_H,
 460                                      R10, R10_H,
 461                                      R11, R11_H,
 462                                      R13, R13_H,
 463                                      R14, R14_H);
 464 
 465 // Dynamic register class that selects between long_no_rax_rdx_reg_no_rbp and long_no_rax_rdx_reg_with_rbp.
 466 reg_class_dynamic long_no_rax_rdx_reg0(long_no_rax_rdx_reg0_no_rbp, long_no_rax_rdx_reg0_with_rbp, %{ PreserveFramePointer %});
 467 
 468 // Class for all long registers (excluding RCX and RSP)
 469 reg_class long_no_rcx_reg0_with_rbp(RBP, RBP_H,
 470                                    RDI, RDI_H,
 471                                    RSI, RSI_H,
 472                                    RAX, RAX_H,
 473                                    RDX, RDX_H,
 474                                    RBX, RBX_H,
 475                                    R8,  R8_H,
 476                                    R9,  R9_H,
 477                                    R10, R10_H,
 478                                    R11, R11_H,
 479                                    R13, R13_H,
 480                                    R14, R14_H);
 481 
 482 // Class for all long registers (excluding RCX, RSP, and RBP)
 483 reg_class long_no_rcx_reg0_no_rbp(RDI, RDI_H,
 484                                  RSI, RSI_H,
 485                                  RAX, RAX_H,
 486                                  RDX, RDX_H,
 487                                  RBX, RBX_H,
 488                                  R8,  R8_H,
 489                                  R9,  R9_H,
 490                                  R10, R10_H,
 491                                  R11, R11_H,
 492                                  R13, R13_H,
 493                                  R14, R14_H);
 494 
 495 // Dynamic register class that selects between long_no_rcx_reg_no_rbp and long_no_rcx_reg_with_rbp.
 496 reg_class_dynamic long_no_rcx_reg0(long_no_rcx_reg0_no_rbp, long_no_rcx_reg0_with_rbp, %{ PreserveFramePointer %});
 497 
 498 // Singleton class for RAX long register
 499 reg_class long_rax_reg(RAX, RAX_H);
 500 
 501 // Singleton class for RCX long register
 502 reg_class long_rcx_reg(RCX, RCX_H);
 503 
 504 // Singleton class for RDX long register
 505 reg_class long_rdx_reg(RDX, RDX_H);
 506 
 507 // Class for all int registers (excluding RSP)
 508 reg_class int_reg0_with_rbp(RAX,
 509                            RDX,
 510                            RBP,
 511                            RDI,
 512                            RSI,
 513                            RCX,
 514                            RBX,
 515                            R8,
 516                            R9,
 517                            R10,
 518                            R11,
 519                            R13,
 520                            R14);
 521 
 522 // Class for all int registers (excluding RSP and RBP)
 523 reg_class int_reg0_no_rbp(RAX,
 524                          RDX,
 525                          RDI,
 526                          RSI,
 527                          RCX,
 528                          RBX,
 529                          R8,
 530                          R9,
 531                          R10,
 532                          R11,
 533                          R13,
 534                          R14);
 535 
 536 // Dynamic register class that selects between int_reg_no_rbp and int_reg_with_rbp.
 537 reg_class_dynamic int_reg0(int_reg0_no_rbp, int_reg0_with_rbp, %{ PreserveFramePointer %});
 538 
 539 // Class for all int registers (excluding RCX and RSP)
 540 reg_class int_no_rcx_reg0_with_rbp(RAX,
 541                                   RDX,
 542                                   RBP,
 543                                   RDI,
 544                                   RSI,
 545                                   RBX,
 546                                   R8,
 547                                   R9,
 548                                   R10,
 549                                   R11,
 550                                   R13,
 551                                   R14);
 552 
 553 // Class for all int registers (excluding RCX, RSP, and RBP)
 554 reg_class int_no_rcx_reg0_no_rbp(RAX,
 555                                 RDX,
 556                                 RDI,
 557                                 RSI,
 558                                 RBX,
 559                                 R8,
 560                                 R9,
 561                                 R10,
 562                                 R11,
 563                                 R13,
 564                                 R14);
 565 
 566 // Dynamic register class that selects between int_no_rcx_reg_no_rbp and int_no_rcx_reg_with_rbp.
 567 reg_class_dynamic int_no_rcx_reg0(int_no_rcx_reg0_no_rbp, int_no_rcx_reg0_with_rbp, %{ PreserveFramePointer %});
 568 
 569 // Class for all int registers (excluding RAX, RDX, and RSP)
 570 reg_class int_no_rax_rdx_reg0_with_rbp(RBP,
 571                                       RDI,
 572                                       RSI,
 573                                       RCX,
 574                                       RBX,
 575                                       R8,
 576                                       R9,
 577                                       R10,
 578                                       R11,
 579                                       R13,
 580                                       R14);
 581 
 582 // Class for all int registers (excluding RAX, RDX, RSP, and RBP)
 583 reg_class int_no_rax_rdx_reg0_no_rbp(RDI,
 584                                     RSI,
 585                                     RCX,
 586                                     RBX,
 587                                     R8,
 588                                     R9,
 589                                     R10,
 590                                     R11,
 591                                     R13,
 592                                     R14);
 593 
 594 // Dynamic register class that selects between int_no_rax_rdx_reg_no_rbp and int_no_rax_rdx_reg_with_rbp.
 595 reg_class_dynamic int_no_rax_rdx_reg0(int_no_rax_rdx_reg0_no_rbp, int_no_rax_rdx_reg0_with_rbp, %{ PreserveFramePointer %});
 596 
 597 // Singleton class for RAX int register
 598 reg_class int_rax_reg(RAX);
 599 
 600 // Singleton class for RBX int register
 601 reg_class int_rbx_reg(RBX);
 602 
 603 // Singleton class for RCX int register
 604 reg_class int_rcx_reg(RCX);
 605 
 606 // Singleton class for RCX int register
 607 reg_class int_rdx_reg(RDX);
 608 
 609 // Singleton class for RCX int register
 610 reg_class int_rdi_reg(RDI);
 611 
 612 // Singleton class for instruction pointer
 613 // reg_class ip_reg(RIP);
 614 
 615 %}
 616 
 617 //----------SOURCE BLOCK-------------------------------------------------------
 618 // This is a block of C++ code which provides values, functions, and
 619 // definitions necessary in the rest of the architecture description
 620 source_hpp %{
 621 
 622 extern RegMask _ANY_REG_mask;
 623 extern RegMask _PTR_REG_mask;
 624 extern RegMask _PTR_REG_NO_RBP_mask;
 625 extern RegMask _PTR_NO_RAX_REG_mask;
 626 extern RegMask _PTR_NO_RAX_RBX_REG_mask;
 627 extern RegMask _LONG_REG_mask;
 628 extern RegMask _LONG_NO_RAX_RDX_REG_mask;
 629 extern RegMask _LONG_NO_RCX_REG_mask;
 630 extern RegMask _INT_REG_mask;
 631 extern RegMask _INT_NO_RAX_RDX_REG_mask;
 632 extern RegMask _INT_NO_RCX_REG_mask;
 633 
 634 extern RegMask _STACK_OR_PTR_REG_mask;
 635 extern RegMask _STACK_OR_LONG_REG_mask;
 636 extern RegMask _STACK_OR_INT_REG_mask;
 637 
 638 inline const RegMask& STACK_OR_PTR_REG_mask()  { return _STACK_OR_PTR_REG_mask;  }
 639 inline const RegMask& STACK_OR_LONG_REG_mask() { return _STACK_OR_LONG_REG_mask; }
 640 inline const RegMask& STACK_OR_INT_REG_mask()  { return _STACK_OR_INT_REG_mask;  }
 641 
 642 %}
 643 
 644 source %{
 645 #define   RELOC_IMM64    Assembler::imm_operand
 646 #define   RELOC_DISP32   Assembler::disp32_operand
 647 
 648 #define __ _masm.
 649 
 650 RegMask _ANY_REG_mask;
 651 RegMask _PTR_REG_mask;
 652 RegMask _PTR_REG_NO_RBP_mask;
 653 RegMask _PTR_NO_RAX_REG_mask;
 654 RegMask _PTR_NO_RAX_RBX_REG_mask;
 655 RegMask _LONG_REG_mask;
 656 RegMask _LONG_NO_RAX_RDX_REG_mask;
 657 RegMask _LONG_NO_RCX_REG_mask;
 658 RegMask _INT_REG_mask;
 659 RegMask _INT_NO_RAX_RDX_REG_mask;
 660 RegMask _INT_NO_RCX_REG_mask;
 661 RegMask _STACK_OR_PTR_REG_mask;
 662 RegMask _STACK_OR_LONG_REG_mask;
 663 RegMask _STACK_OR_INT_REG_mask;
 664 
 665 #ifdef ASSERT
 666 static bool same_mask(const RegMask &a, const RegMask &b) {
 667     RegMask a_sub_b = a; a_sub_b.SUBTRACT(b);
 668     RegMask b_sub_a = b; b_sub_a.SUBTRACT(a);
 669     return a_sub_b.Size() == 0 && b_sub_a.Size() == 0;
 670 }
 671 #endif
 672 
 673 void reg_mask_init() {
 674   // _ALL_REG_mask is generated by adlc from the all_reg register class below.
 675   // We derive a number of subsets from it.
 676   _ANY_REG_mask = _ALL_REG_mask;
 677 
 678   if (PreserveFramePointer) {
 679     _ANY_REG_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()));
 680     _ANY_REG_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()->next()));
 681   }
 682 
 683   _PTR_REG_mask = _ANY_REG_mask;
 684   _PTR_REG_mask.Remove(OptoReg::as_OptoReg(r12->as_VMReg()));
 685   _PTR_REG_mask.Remove(OptoReg::as_OptoReg(r12->as_VMReg()->next()));
 686   _PTR_REG_mask.Remove(OptoReg::as_OptoReg(rsp->as_VMReg()));
 687   _PTR_REG_mask.Remove(OptoReg::as_OptoReg(rsp->as_VMReg()->next()));
 688   _PTR_REG_mask.Remove(OptoReg::as_OptoReg(r15->as_VMReg()));
 689   _PTR_REG_mask.Remove(OptoReg::as_OptoReg(r15->as_VMReg()->next()));
 690 
 691   _STACK_OR_PTR_REG_mask = _PTR_REG_mask;
 692   _STACK_OR_PTR_REG_mask.OR(STACK_OR_STACK_SLOTS_mask());
 693 
 694   _PTR_REG_NO_RBP_mask = _PTR_REG_mask;
 695   _PTR_REG_NO_RBP_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()));
 696   _PTR_REG_NO_RBP_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()->next()));
 697 
 698   _PTR_NO_RAX_REG_mask = _PTR_REG_mask;
 699   _PTR_NO_RAX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()));
 700   _PTR_NO_RAX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()->next()));
 701 
 702   _PTR_NO_RAX_RBX_REG_mask = _PTR_NO_RAX_REG_mask;
 703   _PTR_NO_RAX_RBX_REG_mask.Remove(OptoReg::as_OptoReg(rbx->as_VMReg()));
 704   _PTR_NO_RAX_RBX_REG_mask.Remove(OptoReg::as_OptoReg(rbx->as_VMReg()->next()));
 705 
 706   _LONG_REG_mask = _PTR_REG_mask;
 707   _STACK_OR_LONG_REG_mask = _LONG_REG_mask;
 708   _STACK_OR_LONG_REG_mask.OR(STACK_OR_STACK_SLOTS_mask());
 709 
 710   _LONG_NO_RAX_RDX_REG_mask = _LONG_REG_mask;
 711   _LONG_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()));
 712   _LONG_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()->next()));
 713   _LONG_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rdx->as_VMReg()));
 714   _LONG_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rdx->as_VMReg()->next()));
 715 
 716   _LONG_NO_RCX_REG_mask = _LONG_REG_mask;
 717   _LONG_NO_RCX_REG_mask.Remove(OptoReg::as_OptoReg(rcx->as_VMReg()));
 718   _LONG_NO_RCX_REG_mask.Remove(OptoReg::as_OptoReg(rcx->as_VMReg()->next()));
 719 
 720   _INT_REG_mask = _ALL_INT_REG_mask;
 721   _INT_REG_mask.Remove(OptoReg::as_OptoReg(r12->as_VMReg()));
 722   if (PreserveFramePointer) {
 723     _INT_REG_mask.Remove(OptoReg::as_OptoReg(rbp->as_VMReg()));
 724   }
 725 
 726   _STACK_OR_INT_REG_mask = _INT_REG_mask;
 727   _STACK_OR_INT_REG_mask.OR(STACK_OR_STACK_SLOTS_mask());
 728 
 729   _INT_NO_RAX_RDX_REG_mask = _INT_REG_mask;
 730   _INT_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rax->as_VMReg()));
 731   _INT_NO_RAX_RDX_REG_mask.Remove(OptoReg::as_OptoReg(rdx->as_VMReg()));
 732 
 733   _INT_NO_RCX_REG_mask = _INT_REG_mask;
 734   _INT_NO_RCX_REG_mask.Remove(OptoReg::as_OptoReg(rcx->as_VMReg()));
 735 
 736   assert(same_mask(_ANY_REG_mask, ANY_REG0_mask()), "!");
 737   assert(same_mask(_PTR_REG_mask, PTR_REG0_mask()), "!");
 738   assert(same_mask(_PTR_REG_NO_RBP_mask, PTR_REG0_NO_RBP_mask()), "!");
 739   assert(same_mask(_PTR_NO_RAX_REG_mask, PTR_NO_RAX_REG0_mask()), "!");
 740   assert(same_mask(_PTR_NO_RAX_RBX_REG_mask, PTR_NO_RAX_RBX_REG0_mask()), "!");
 741   assert(same_mask(_LONG_REG_mask, LONG_REG0_mask()), "!");
 742   assert(same_mask(_LONG_NO_RAX_RDX_REG_mask, LONG_NO_RAX_RDX_REG0_mask()), "!");
 743   assert(same_mask(_LONG_NO_RCX_REG_mask, LONG_NO_RCX_REG0_mask()), "!");
 744   assert(same_mask(_INT_REG_mask, INT_REG0_mask()), "!");
 745   assert(same_mask(_INT_NO_RAX_RDX_REG_mask, INT_NO_RAX_RDX_REG0_mask()), "!");
 746   assert(same_mask(_INT_NO_RCX_REG_mask, INT_NO_RCX_REG0_mask()), "!");
 747 }
 748 
 749 static bool generate_vzeroupper(Compile* C) {
 750   return (VM_Version::supports_vzeroupper() && (C->max_vector_size() > 16 || C->clear_upper_avx() == true)) ? true: false;  // Generate vzeroupper
 751 }
 752 
 753 static int clear_avx_size() {
 754   return generate_vzeroupper(Compile::current()) ? 3: 0;  // vzeroupper
 755 }
 756 
 757 // !!!!! Special hack to get all types of calls to specify the byte offset
 758 //       from the start of the call to the point where the return address
 759 //       will point.
 760 int MachCallStaticJavaNode::ret_addr_offset()
 761 {
 762   int offset = 5; // 5 bytes from start of call to where return address points
 763   offset += clear_avx_size();
 764   return offset;
 765 }
 766 
 767 int MachCallDynamicJavaNode::ret_addr_offset()


< prev index next >