comments in amd64 isel

This commit is contained in:
Quentin Carbonneaux 2023-08-28 22:45:41 +02:00
parent d6c9669c3c
commit c5aca682a2

View file

@ -316,15 +316,15 @@ sel(Ins i, ANum *an, Fn *fn)
break; break;
case Oultof: case Oultof:
/* %mask =l and %arg.0, 1 /* %mask =l and %arg.0, 1
%isbig =l shr %arg.0, 63 * %isbig =l shr %arg.0, 63
%divided =l shr %arg.0, %isbig * %divided =l shr %arg.0, %isbig
%or =l or %mask, %divided * %or =l or %mask, %divided
%float =d sltof %or * %float =d sltof %or
%cast =l cast %float * %cast =l cast %float
%addend =l shl %isbig, 52 * %addend =l shl %isbig, 52
%sum =l add %cast, %addend * %sum =l add %cast, %addend
%result =d cast %sum * %result =d cast %sum
*/ */
r0 = newtmp("utof", k, fn); r0 = newtmp("utof", k, fn);
if (k == Ks) if (k == Ks)
kc = Kw, sh = 23; kc = Kw, sh = 23;
@ -364,6 +364,18 @@ sel(Ins i, ANum *an, Fn *fn)
i.to = r0; i.to = r0;
goto Emit; goto Emit;
} }
/* %try0 =l {s,d}tosi %fp
* %mask =l sar %try0, 63
*
* mask is all ones if the first
* try was oob, all zeroes o.w.
*
* %fps ={s,d} sub %fp, (1<<63)
* %try1 =l {s,d}tosi %fps
*
* %tmp =l and %mask, %try1
* %res =l or %tmp, %try0
*/
r0 = newtmp("ftou", kc, fn); r0 = newtmp("ftou", kc, fn);
for (j=0; j<4; j++) for (j=0; j<4; j++)
tmp[j] = newtmp("ftou", Kl, fn); tmp[j] = newtmp("ftou", Kl, fn);