regop.isa (5675:7828ee363019) regop.isa (5678:9af6981bb086)
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

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

231 void
232 divide(uint64_t dividend, uint64_t divisor,
233 uint64_t &quotient, uint64_t &remainder);
234
235 enum SegmentSelectorCheck {
236 SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck,
237 SegSSCheck, SegIretCheck, SegIntCSCheck
238 };
1// Copyright (c) 2007-2008 The Hewlett-Packard Development Company
2// All rights reserved.
3//
4// Redistribution and use of this software in source and binary forms,
5// with or without modification, are permitted provided that the
6// following conditions are met:
7//
8// The software must be used only for Non-Commercial Use which means any

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

231 void
232 divide(uint64_t dividend, uint64_t divisor,
233 uint64_t &quotient, uint64_t &remainder);
234
235 enum SegmentSelectorCheck {
236 SegNoCheck, SegCSCheck, SegCallGateCheck, SegIntGateCheck,
237 SegSSCheck, SegIretCheck, SegIntCSCheck
238 };
239
240 enum LongModeDescriptorType {
241 LDT64 = 2,
242 AvailableTSS64 = 9,
243 BusyTSS64 = 0xb,
244 CallGate64 = 0xc,
245 IntGate64 = 0xe,
246 TrapGate64 = 0xf
247 };
239}};
240
241output decoder {{
242 void
243 divide(uint64_t dividend, uint64_t divisor,
244 uint64_t &quotient, uint64_t &remainder)
245 {
246 //Check for divide by zero.

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

1093 // Check for a NULL selector and set ZF,EZF appropriately.
1094 ccFlagBits = ccFlagBits & ~(ext & (ZFBit | EZFBit));
1095 if (!selector.si && !selector.ti)
1096 ccFlagBits = ccFlagBits | (ext & (ZFBit | EZFBit));
1097 '''
1098
1099 class Wrdh(RegOp):
1100 code = '''
248}};
249
250output decoder {{
251 void
252 divide(uint64_t dividend, uint64_t divisor,
253 uint64_t &quotient, uint64_t &remainder)
254 {
255 //Check for divide by zero.

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

1102 // Check for a NULL selector and set ZF,EZF appropriately.
1103 ccFlagBits = ccFlagBits & ~(ext & (ZFBit | EZFBit));
1104 if (!selector.si && !selector.ti)
1105 ccFlagBits = ccFlagBits | (ext & (ZFBit | EZFBit));
1106 '''
1107
1108 class Wrdh(RegOp):
1109 code = '''
1110 SegDescriptor desc = SrcReg1;
1101
1111
1112 uint64_t target = bits(SrcReg2, 31, 0) << 32;
1113 switch(desc.type) {
1114 case LDT64:
1115 case AvailableTSS64:
1116 case BusyTSS64:
1117 replaceBits(target, 23, 0, desc.baseLow);
1118 replaceBits(target, 31, 24, desc.baseHigh);
1119 break;
1120 case CallGate64:
1121 case IntGate64:
1122 case TrapGate64:
1123 replaceBits(target, 15, 0, bits(desc, 15, 0));
1124 replaceBits(target, 31, 16, bits(desc, 63, 48));
1125 break;
1126 default:
1127 panic("Wrdh used with wrong descriptor type!\\n");
1128 }
1129 DestReg = target;
1102 '''
1103
1104 class Wrtsc(WrRegOp):
1105 code = '''
1106 TscOp = psrc1;
1107 '''
1108
1109 class Rdtsc(RdRegOp):

--- 48 unchanged lines hidden ---
1130 '''
1131
1132 class Wrtsc(WrRegOp):
1133 code = '''
1134 TscOp = psrc1;
1135 '''
1136
1137 class Rdtsc(RdRegOp):

--- 48 unchanged lines hidden ---