From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111c93,32b357b741390d0e,start X-Google-Attributes: gid111c93,public X-Google-ArrivalTime: 2004-02-23 23:33:00 PST Newsgroups: comp.os.linux.alpha Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!zeus.visi.com!news-out.visi.com!green.octanews.net!news-out.octanews.net!news.glorb.com!newsgate.cistron.nl!transit.news.xs4all.nl!uucp.xs4all.nl!xs4all!sparc!albert From: albert@spenarnc.xs4all.nl (Albert van der Horst) Subject: CPYSE what is it good for? Organization: Dutch Forth Workshop Message-ID: Date: Mon, 23 Feb 2004 17:49:51 GMT Xref: archiver1.google.com comp.os.linux.alpha:515 I am experimenting with assembler on my DEC Alpha (XL266, 21064A) What I want to do is trim a g-floating consistently to 24 bits. That is the same 24 bits each time. 1.11011...001|0101.. * 2^48 --> 111011....001 0.11011...001|0101.. * 2^48 --> 011011....001 ^ 24 bit boundary. Of course CVTGF will (in the second case) bring one more bit into play. (Which in this case would be zero). It starts off with the number 1.1011..*2^47 . Of course in the above case you can multiply by 2^-24 and the do CVTGL CVTLG and multiply back by 2^24. This made me discover CPYSE . CPYSE Ra Rb Rc copies sign and exponent from Ra and fraction from Rb into Rc. The manual says "Floating values can be scaled to a known range using CPYSE" But I wonder what CPYSE can be good for because essential data is lost : Say Rb has exponent 0 then both 1.11011.. *2^48 --> 1.11011.. *2^0 1.11011.. *2^47 --> 1.11011.. *2^0 are mapped to the same number. Because you never know when an underflow occurs in fp arithmetic, this looks pretty lame. So CPYSE seem utterly worthless to me. Can anyone shed some light on this? (Maybe an example where it is useful.) Groetjes Albert -- -- Albert van der Horst,Oranjestr 8,3511 RA UTRECHT,THE NETHERLANDS One man-hour to invent, One man-week to implement, One lawyer-year to patent.