Skip to content
Tcl Source Code Artifact [688cc6bb96]
Login

Artifact [688cc6bb96]

Artifact 688cc6bb96238083bdd63081043c4185f1f716ed:

Ticket change [688cc6bb96] - New ticket [bf029ced86b614a4|bf029ced86] <i>binary.test 40.3 signed NaN fails on IRIX/MIPS machines</i>. by dexter1 on 2017-01-11 21:22:44.
D 2017-01-11T21:22:44.244
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment I've\scompiled\stcl\s8.6.6\sfrom\ssource.\r\nSystem\sis\sa\sChallenge\sS\sserver\swith\sMIPS\sR4400\sprocessor.\sIRIX\sversion\sis\s6.5.22m\sand\sthe\scompiler\sused\sis\sMIPSPro\s7.4.4\swith\sall\savailable\svendor-patches\sinstalled.\sCFLAGS\sare\s"-O2\s-mips3\s-n32"\r\n\r\nWhen\sperforming\s'make\stest'\sit\sfails\sas\sfollows:\r\n\r\n====\sbinary-40.3\sScanNumber:\sNaN\sFAILED\r\n====\sContents\sof\stest\scase:\r\n\r\n\s\s\s\sunset\s-nocomplain\sarg1\r\n\s\s\s\slist\s[binary\sscan\s\\xff\\xff\\xff\\xff\sf1\sarg1]\s$arg1\r\n\r\n----\sResult\swas:\r\n1\sNaN(7ffffffffffff)\r\n----\sResult\sshould\shave\sbeen\s(glob\smatching):\r\n1\s-NaN*\r\n====\sbinary-40.3\sFAILED\r\n\r\nThe\stest\sexpects\sa\ssingle\sprecision\sNaN\swith\sthe\ssign\sbit\sset,\sbecause\sthe\soriginal\sbit\spattern's\smost\ssignificant\sbit\sis\s1.\sA\sshort\sversion\sof\sthis\stest\sis\sthe\sfollowing\stwo-liner\sin\stcl:\r\n\r\nlist\s[binary\sscan\s\\xff\\xff\\xff\\xff\sf1\sarg1]\r\nputs\s$arg1\r\n\r\nwhich\son\sthe\sChallenge\sS\sproduces:\r\n\r\ncyane:~/tcltest>\s../src/tcl8.6.6/unix/tcltest\s./nan.tcl\r\nNaN(7ffffffffffff)\r\n\r\n\r\nIt\sdepends\son\sthe\sparticular\sMIPS\sprocessor\show\sthe\ssign\sof\sa\sNaN\sresult\sis\sstored\sand\spresented.\sUpon\sprinting\sthe\sNaN\swith\sa\sprintf\sin\sC\swe\sdiscovered\sthat\sthe\ssingle\sprecision\sNaN\sgets\sconverted\sto\sa\sdouble\sprecision\sNaN,\swith\sloss\sof\sthe\ssign.\sAn\sexample:\r\n\r\n#include\s<stdio.h>\r\n\r\nint\smain(void)\r\n{\r\n\s\s\s\s\s\s\s\sunsigned\sint\si;\r\n\s\s\s\s\s\s\s\sunsigned\slong\slong\sx;\r\n\r\n\s\s\s\s\s\s\s\sx\s=\s0xffffffffffffffff;\r\n\s\s\s\s\s\s\s\sprintf("double\sof\s%llx\sis\s%f\s\\n",x,*(double*)&x);\r\n\r\n\s\s\s\s\s\s\s\sx\s=\s0x7fffffffffffffff;\r\n\s\s\s\s\s\s\s\sprintf("double\sof\s%llx\sis\s%f\s\\n",x,*(double*)&x);\r\n\r\n\s\s\s\s\s\s\s\si\s=\s0xffffffff;\r\n\s\s\s\s\s\s\s\sprintf("float\sof\s%x\sis\s%f\s\\n",i,*(float*)&i);\r\n\r\n\s\s\s\s\s\s\s\si\s=\s0x7fffffff;\r\n\s\s\s\s\s\s\s\sprintf("float\sof\s%x\sis\s%f\s\\n",i,*(float*)&i);\r\n\r\n\s\s\s\s\s\s\s\sreturn\s0;\r\n}\r\n\r\ngives:\r\n\r\ndouble\sof\sffffffffffffffff\sis\s-nan0xffffffff\s\r\ndouble\sof\s7fffffffffffffff\sis\snan0xffffffff\s\r\nfloat\sof\sffffffff\sis\snan0x7fffffff\s\r\nfloat\sof\s7fffffff\sis\snan0x7fffffff\s\r\n\r\nThis\sresults\shappens\sfor\sR4400\sprocessors\sand\sR10000\sprocessors\sas\sfellow\senthusiasts\shave\sverified\sthis.\sThe\sdouble\sprecision\sretains\sits\ssign,\sbut\sthe\ssingle\sprecision\sdoes\snot.\sWe\sbelieve\sthat\sthose\sprocessors\shandle\sconversion\sin\shardware,\sdifferent\sthan\sfor\sinstance\sthe\sR8000\sprocessor.\sWe\shaven't\stested\sthat\sprocessor\syet\showever,\sdue\sto\sthe\sfact\sthat\sthey\sare\svery\suncommon.\r\n\r\nBecause\sIEEE-754-2008\sstandard\splaces\sno\svalue\sto\sthe\ssign\sbit\sand\sthe\sNaN\ssigns\sare\snot\sconsistent\son\sseveral\sMIPS\sProcessors,\si\swonder\sif\sthat\sexplicit\stest\sfor\sNaN\swith\ssign\sshould\sbe\seither\sbe\sretained\sand\sdisabled\sfor\sIRIX\sor\smaybe\sweakened\sto\sdisregard\ssign\sin\sthe\sgeneral\scase.
J foundin 8.6.6
J is_private 0
J login dexter1
J priority 5\sMedium
J private_contact f6a32afcad2bdbc0e0c91beb6d44f2ddf022a09d
J resolution None
J severity Minor
J status Open
J submitter dexter1
J subsystem 48.\sNumber\sHandling
J title binary.test\s40.3\ssigned\sNaN\sfails\son\sIRIX/MIPS\smachines
J type Bug
K bf029ced86b614a4c29dc15b0ddc2b222e489004
U dexter1
Z 18a8bb05538fb1bfbdea2572c9d7457a