emulenv.cc (4712:79b4c64296ce) emulenv.cc (4848:25a45e79f9ea)
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

--- 59 unchanged lines hidden (view full) ---

68 scale = 1 << machInst.sib.scale;
69 index = machInst.sib.index | (machInst.rex.x << 3);
70 base = machInst.sib.base | (machInst.rex.b << 3);
71 //In this special case, we don't use a base. The displacement also
72 //changes, but that's managed by the predecoder.
73 if (machInst.sib.base == INTREG_RBP && machInst.modRM.mod == 0)
74 base = NUM_INTREGS;
75 //In -this- special case, we don't use an index.
1/*
2 * Copyright (c) 2007 The Hewlett-Packard Development Company
3 * All rights reserved.
4 *
5 * Redistribution and use of this software in source and binary forms,
6 * with or without modification, are permitted provided that the
7 * following conditions are met:
8 *

--- 59 unchanged lines hidden (view full) ---

68 scale = 1 << machInst.sib.scale;
69 index = machInst.sib.index | (machInst.rex.x << 3);
70 base = machInst.sib.base | (machInst.rex.b << 3);
71 //In this special case, we don't use a base. The displacement also
72 //changes, but that's managed by the predecoder.
73 if (machInst.sib.base == INTREG_RBP && machInst.modRM.mod == 0)
74 base = NUM_INTREGS;
75 //In -this- special case, we don't use an index.
76 if (machInst.sib.index == INTREG_RSP)
76 if (index == INTREG_RSP)
77 index = NUM_INTREGS;
78 } else {
79 if (machInst.addrSize == 2) {
80 warn("I'm not really using 16 bit MODRM like I'm supposed to!\n");
81 } else {
82 scale = 0;
83 base = machInst.modRM.rm | (machInst.rex.b << 3);
84 if (machInst.modRM.mod == 0 && machInst.modRM.rm == 5) {
77 index = NUM_INTREGS;
78 } else {
79 if (machInst.addrSize == 2) {
80 warn("I'm not really using 16 bit MODRM like I'm supposed to!\n");
81 } else {
82 scale = 0;
83 base = machInst.modRM.rm | (machInst.rex.b << 3);
84 if (machInst.modRM.mod == 0 && machInst.modRM.rm == 5) {
85 base = NUM_INTREGS;
86 //Since we need to use a different encoding of this
87 //instruction anyway, just ignore the base in those cases
85 //Since we need to use a different encoding of this
86 //instruction anyway, just ignore the base in those cases
88// if (machInst.mode.submode == SixtyFourBitMode)
89// base = NUM_INTREGS+7;
87 base = NUM_INTREGS;
90 }
91 }
92 }
93}
94
88 }
89 }
90 }
91}
92