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.compilers.opt.ir; 014 015import org.jikesrvm.VM; 016import java.util.Enumeration; 017 018public class GenericPhysicalDefUse { 019 020 public static int getMaskTSPUses() { 021 if (VM.BuildForIA32) { 022 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.maskTSPUses; 023 } else { 024 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 025 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.maskTSPUses; 026 } 027 } 028 029 public static int getMaskTSPDefs() { 030 if (VM.BuildForIA32) { 031 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.maskTSPUses; 032 } else { 033 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 034 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.maskTSPUses; 035 } 036 } 037 038 public static String getString(int code) { 039 if (VM.BuildForIA32) { 040 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.getString(code); 041 } else { 042 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 043 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.getString(code); 044 } 045 } 046 047 public static Enumeration<Register> enumerate(int code, IR ir) { 048 if (VM.BuildForIA32) { 049 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.enumerate(code,ir); 050 } else { 051 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 052 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.enumerate(code,ir); 053 } 054 } 055 056 public static Enumeration<Register> enumerateAllImplicitDefUses(IR ir) { 057 if (VM.BuildForIA32) { 058 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.enumerateAllImplicitDefUses(ir); 059 } else { 060 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 061 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.enumerateAllImplicitDefUses(ir); 062 } 063 } 064 065 public static int mask() { 066 if (VM.BuildForIA32) { 067 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.mask; 068 } else { 069 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 070 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.mask; 071 } 072 } 073 public static int maskcallDefs() { 074 if (VM.BuildForIA32) { 075 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.maskcallDefs; 076 } else { 077 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 078 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.maskcallDefs; 079 } 080 } 081 082 public static int maskcallUses() { 083 if (VM.BuildForIA32) { 084 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.maskcallUses; 085 } else { 086 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 087 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.maskcallUses; 088 } 089 } 090 091 public static int maskAF_CF_OF_PF_SF_ZF() { 092 if (VM.VerifyAssertions) VM._assert(VM.BuildForIA32); 093 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.maskAF_CF_OF_PF_SF_ZF; 094 } 095 096 public static int maskCF() { 097 if (VM.VerifyAssertions) VM._assert(VM.BuildForIA32); 098 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.maskCF; 099 } 100 101 public static int maskIEEEMagicUses() { 102 if (VM.BuildForIA32) { 103 return org.jikesrvm.compilers.opt.ir.ia32.PhysicalDefUse.maskIEEEMagicUses; 104 } else { 105 if (VM.VerifyAssertions) VM._assert(VM.BuildForPowerPC); 106 return org.jikesrvm.compilers.opt.ir.ppc.PhysicalDefUse.maskIEEEMagicUses; 107 } 108 } 109}