Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcsri!uthub!utecfb!larry From: larry@utecfb.Toronto.Edu (Larry Philps) Newsgroups: comp.unix.wizards,comp.bugs.4bsd Subject: 4.3BSD UVAXII instruction emulation code is WRONG! (REPOST) Message-ID: <114@utecfb.Toronto.Edu> Date: Mon, 22-Dec-86 10:24:32 EST Article-I.D.: utecfb.114 Posted: Mon Dec 22 10:24:32 1986 Date-Received: Mon, 22-Dec-86 18:46:02 EST Organization: Engineering Computing Facility, University of Toronto Lines: 39 Keywords: 4.3 instruction emulation code broken [This is a repost. utzoo had transmission problem the day I posted this and I don't think it made it out the network proper.] Index: /sys/vax/emulate.s 4.3BSD Description: The UVAX does not have 27 of the instructions that are part of the vax architecture. To get around this problem, 4.3 locore.s and emulate.s trap programs that try to use the non-existant instructions and emulate them using other instructions. Well - at least one of the packed decimal instructions is broken. Worse - doprnt uses them to make printing numbers "easy". After starting with "my program work on the 780 but not on the UVAX" and two days of going cross-eyed, the following program demonstrates the problem. I "THINK" that the problem is with the "ashp" instruction, but am not sure - it could also be "cvtlp" or "editpc" Just in case you don't realise it, this is a very serious problem. Any program you are running on a UVAX under 4.3 that does floating point calculations is likely giving the wrong answers! Anyway, I don't have a fix (yet), I am tired, and I am going home. If anyone has a fix or even understands how the emulate code for "ashp" works I would greatly appreciate some help. Repeat-By: Compile and run the following program on 4.2, or 4.3 on any VAX or UVAX system. When you run it on a non-UVAX you will get "1" as the result - this is correct. On a UVAX you will get "0". main() { float hpos = 0.9; printf("%.0f\n", hpos); } -- Larry Philps Engineering Computing Facility University of Toronto Usenet: {linus, ihnp4, allegra, decvax, floyd}!utcsri!utecfa!larry CSNET: larry@Toronto ARPA: larry%Toronto@CSNet-Relay