@Test public void testLittle() { RegisterBuilder builder = new RegisterBuilder(); builder.addRegister("L_0_8", "", addr(0), 8, false, 0); builder.addRegister("L_0_4", "", addr(0), 4, false, 0); builder.addRegister("L_4_4", "", addr(4), 4, false, 0); builder.addRegister("L_0_2", "", addr(0), 2, false, 0); builder.addRegister("L_2_2", "", addr(2), 2, false, 0); registerManager = builder.getRegisterManager(); Assert.assertEquals("L_0_8", registerManager.getRegister(addr(0), 8).getName()); Assert.assertEquals("L_0_8", registerManager.getRegister(addr(0), 7).getName()); Assert.assertEquals("L_0_8", registerManager.getRegister(addr(0), 6).getName()); Assert.assertEquals("L_0_8", registerManager.getRegister(addr(0), 5).getName()); Assert.assertEquals("L_0_4", registerManager.getRegister(addr(0), 4).getName()); Assert.assertEquals("L_0_4", registerManager.getRegister(addr(0), 3).getName()); Assert.assertEquals("L_0_2", registerManager.getRegister(addr(0), 2).getName()); Assert.assertEquals("L_0_2", registerManager.getRegister(addr(0), 1).getName()); Assert.assertEquals("L_0_8", registerManager.getRegister(addr(0), 0).getName()); assertNull(registerManager.getRegister(addr(1), 8)); assertNull(registerManager.getRegister(addr(1), 7)); assertNull(registerManager.getRegister(addr(1), 6)); assertNull(registerManager.getRegister(addr(1), 5)); assertNull(registerManager.getRegister(addr(1), 4)); assertNull(registerManager.getRegister(addr(1), 3)); assertNull(registerManager.getRegister(addr(1), 2)); assertNull(registerManager.getRegister(addr(1), 1)); assertNull(registerManager.getRegister(addr(1), 0)); assertNull(registerManager.getRegister(addr(2), 8)); assertNull(registerManager.getRegister(addr(2), 7)); assertNull(registerManager.getRegister(addr(2), 6)); assertNull(registerManager.getRegister(addr(2), 5)); assertNull(registerManager.getRegister(addr(2), 4)); assertNull(registerManager.getRegister(addr(2), 3)); Assert.assertEquals("L_2_2", registerManager.getRegister(addr(2), 2).getName()); Assert.assertEquals("L_2_2", registerManager.getRegister(addr(2), 1).getName()); Assert.assertEquals("L_2_2", registerManager.getRegister(addr(2), 0).getName()); assertNull(registerManager.getRegister(addr(3), 8)); assertNull(registerManager.getRegister(addr(3), 7)); assertNull(registerManager.getRegister(addr(3), 6)); assertNull(registerManager.getRegister(addr(3), 5)); assertNull(registerManager.getRegister(addr(3), 4)); assertNull(registerManager.getRegister(addr(3), 3)); assertNull(registerManager.getRegister(addr(3), 2)); assertNull(registerManager.getRegister(addr(3), 1)); assertNull(registerManager.getRegister(addr(3), 0)); assertNull(registerManager.getRegister(addr(4), 8)); assertNull(registerManager.getRegister(addr(4), 7)); assertNull(registerManager.getRegister(addr(4), 6)); assertNull(registerManager.getRegister(addr(4), 5)); Assert.assertEquals("L_4_4", registerManager.getRegister(addr(4), 4).getName()); Assert.assertEquals("L_4_4", registerManager.getRegister(addr(4), 3).getName()); Assert.assertEquals("L_4_4", registerManager.getRegister(addr(4), 2).getName()); Assert.assertEquals("L_4_4", registerManager.getRegister(addr(4), 1).getName()); Assert.assertEquals("L_4_4", registerManager.getRegister(addr(4), 0).getName()); }
public Register getRegister(Address addr) { if (!addr.isRegisterAddress() && !addr.getAddressSpace().hasMappedRegisters()) { return null; } return sizeMap.get(new RegisterSizeKey(addr, 0)); }
RegisterManager { public Register getRegister(Address addr) { if (!addr.isRegisterAddress() && !addr.getAddressSpace().hasMappedRegisters()) { return null; } return sizeMap.get(new RegisterSizeKey(addr, 0)); } }
RegisterManager { public Register getRegister(Address addr) { if (!addr.isRegisterAddress() && !addr.getAddressSpace().hasMappedRegisters()) { return null; } return sizeMap.get(new RegisterSizeKey(addr, 0)); } RegisterManager(Register[] cookedRegisters); }
RegisterManager { public Register getRegister(Address addr) { if (!addr.isRegisterAddress() && !addr.getAddressSpace().hasMappedRegisters()) { return null; } return sizeMap.get(new RegisterSizeKey(addr, 0)); } RegisterManager(Register[] cookedRegisters); Register getContextBaseRegister(); Register getRegister(Address addr); Register[] getRegisters(Address addr); Register getRegister(Address addr, int size); Register getRegister(String name); Register[] getRegisters(); Register[] getSortedVectorRegisters(); }
RegisterManager { public Register getRegister(Address addr) { if (!addr.isRegisterAddress() && !addr.getAddressSpace().hasMappedRegisters()) { return null; } return sizeMap.get(new RegisterSizeKey(addr, 0)); } RegisterManager(Register[] cookedRegisters); Register getContextBaseRegister(); Register getRegister(Address addr); Register[] getRegisters(Address addr); Register getRegister(Address addr, int size); Register getRegister(String name); Register[] getRegisters(); Register[] getSortedVectorRegisters();  }