001/* 002 * This file is part of the Jikes RVM project (http://jikesrvm.org). 003 * 004 * This file is licensed to You under the Eclipse Public License (EPL); 005 * You may not use this file except in compliance with the License. You 006 * may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/eclipse-1.0.php 009 * 010 * See the COPYRIGHT.txt file distributed with this work for information 011 * regarding copyright ownership. 012 */ 013package org.jikesrvm.architecture; 014 015import org.jikesrvm.VM; 016 017import org.vmmagic.pragma.Uninterruptible; 018 019public class ArchConstants { 020 021 @Uninterruptible 022 public static int getLogInstructionWidth() { 023 if (VM.BuildForIA32) { 024 return org.jikesrvm.ia32.RegisterConstants.LG_INSTRUCTION_WIDTH; 025 } else { 026 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 027 return org.jikesrvm.ppc.RegisterConstants.LG_INSTRUCTION_WIDTH; 028 } 029 } 030 031 @Uninterruptible 032 public static int getNumberOfGPRs() { 033 if (VM.BuildForIA32) { 034 return org.jikesrvm.ia32.RegisterConstants.NUM_GPRS; 035 } else { 036 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 037 return org.jikesrvm.ppc.RegisterConstants.NUM_GPRS; 038 } 039 } 040 041 @Uninterruptible 042 public static int getNumberOfFPRs() { 043 if (VM.BuildForIA32) { 044 return org.jikesrvm.ia32.RegisterConstants.NUM_FPRS; 045 } else { 046 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 047 return org.jikesrvm.ppc.RegisterConstants.NUM_FPRS; 048 } 049 } 050 051 @Uninterruptible 052 public static int getInstructionWidth() { 053 if (VM.BuildForIA32) { 054 return org.jikesrvm.ia32.RegisterConstants.INSTRUCTION_WIDTH; 055 } else { 056 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 057 return org.jikesrvm.ppc.RegisterConstants.INSTRUCTION_WIDTH; 058 } 059 } 060 061}