Changeset 5624
- Timestamp:
- Dec 16, 2006, 4:25:59 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ccl/lisp-kernel/ppc-exceptions.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/lisp-kernel/ppc-exceptions.c
r5622 r5624 1157 1157 int 1158 1158 altivec_present = 1; 1159 1160 1159 1160 1161 /* This only tries to implement the "optional" fsqrt and fsqrts 1162 instructions, which were generally implemented on IBM hardware 1163 but generally not available on Motorola/Freescale systems. 1164 */ 1165 OSStatus 1166 handle_unimplemented_instruction(ExceptionInformation *xp, 1167 opcode instruction, 1168 TCR *tcr) 1169 { 1170 (void) zero_fpscr(tcr); 1171 enable_fp_exceptions(); 1172 /* the rc bit (bit 0 in the instruction) is supposed to cause 1173 some FPSCR bits to be copied to CR1. OpenMCL doesn't generate 1174 fsqrt. or fsqrts. 1175 */ 1176 if (((major_opcode_p(instruction,major_opcode_FPU_DOUBLE)) || 1177 (major_opcode_p(instruction,major_opcode_FPU_SINGLE))) && 1178 ((instruction & ((1 << 6) -2)) == (22<<1))) { 1179 double b, d; 1180 1181 b = xpFPR(xp,RB_field(instruction)); 1182 d = sqrt(b); 1183 xpFPSCR(xp) = ((xpFPSCR(xp) & ~_FPU_RESERVED) | 1184 (get_fpscr() & _FPU_RESERVED)); 1185 xpFPR(xp,RT_field(instruction)) = d; 1186 adjust_exception_pc(xp,4); 1187 return 0; 1188 } 1189 1190 return -1; 1191 } 1161 1192 1162 1193 OSStatus … … 1192 1223 } else if (is_conditional_trap(instruction)) { 1193 1224 status = handle_trap(xp, instruction, program_counter, info); 1225 } else { 1226 status = handle_unimplemented_instruction(xp,instruction,tcr); 1194 1227 } 1195 1228 } else if (xnum == SIGNAL_FOR_PROCESS_INTERRUPT) {
Note:
See TracChangeset
for help on using the changeset viewer.
