📄 ssincos.u
字号:
|* @(#)ssincos.u 1.1 92/07/30 Copyright Sun Microsystems, Inc. 1988|* |* Single Precision Sin, Cos, SinCos.|* lpreg is 0 for cos, 1 for sin, 2 for sincos|* routine xs.sin 001000000000 ; ; ; ; ; ; ; lpreg!1 ; ; ; ; ptr5!c_dmode call sinckmode; i2cmp enra halt; regtoti; rcssp ptr5; call sckifinf; i2land enra halt; regtoti; rcssp ptr5; routine xs.cos 001000000010 ; ; ; ; ; ; ; lpreg!0 ; ; ; ; ptr5!c_dmode call sinckmode; i2cmp enra halt; regtoti; rcssp ptr5; call sckifinf; i2land enra halt; regtoti; rcssp ptr5; routine xs.sincos 001001100000 ; ; ; ; ; ; ; lpreg!2 ; ; ; ; ptr5!c_dmode call sinckmode; i2cmp enra halt; regtoti; rcssp ptr5; call sckifinf; i2land enra halt; regtoti; rcssp ptr5; sckifinf: ; i2land; ; ; ; i2cmp enrb tioe tisp halt; ; ; ; ; ; ptr5; ptr5!c_ssin jeq bail.out; halt; ; ptr5;|* Check for INEXACT ; smul enra enrb halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!stwom7 jtierr bail.out cstat; scmp aluacreg enrb halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!c_stwom5 jge tisOK; scmp aluacreg enrb halt; regtoti; rcssp ptr5; ; ; ; ptr2; jge tsgetiny; smul enra enrb halt; regtoti; rcssp ptr2; ; ; ; ptr5; ptr5!sone|* if DO_COS, return 1.0 jloop0 scostiny; snop enra halt; regtoti; rcssp ptr5; ; ; ; ptr1; ; ; ; ; lpreg-|* if DO_SIN of abs(x)<tiny, sin(x) = x jloop0 idle1; snop halt; tmptoreg; ptr1;|* if SIN_COS, return x to ptr1, 1.0 to ptr4 ; ; ; ptr4; call idle1; tioe tisp halt; titoreg; rcssp ptr4;scostiny: call idle1; tioe tisp halt; titoreg; rcssp ptr1;tsgetiny:|* DO_COS, start halt*z ; srccmul clkcc halt; ; ptr5; ptr5!shalf jloop0 scosgetiny; ; ; ptr5; ; smul mulacreg enrb halt; regtoti; rcssp ptr5; |* DO_SIN, retrun x-z*(x*f1_6) x is in RA ; ; ; ptr5; ptr5!c_s1_6 ; smul enrb halt; regtoti; rcssp ptr5; ; ; ; ; lpreg- ; smul mulacreg mulbmul halt;; ; ; smul mulacreg mulbmul; ; ptr2; ; srsub aluamul enrb halt; regtoti; rcssp ptr2; jloop0 idle1; ; ; ptr1; ; tioe tisp halt; titoreg; rcssp ptr1; ; ; ; ptr5; ptr5!shalf ; smul mulacreg enrb halt; regtoti; rcssp ptr5; ; smul mulacreg; ; ptr5; ptr5!sone ; srsub aluamul enrb halt; regtoti; rcssp ptr5; ; ; ; ptr4; call idle1; tioe tisp halt; titoreg; rcssp ptr4;scosgetiny: ; smul mulacreg; ; ptr5; ptr5!sone ; srsub aluamul enrb halt; regtoti; rcssp ptr5; ; ; ; ptr1; call idle1; tioe tisp halt; titoreg; rcssp ptr1;tisOK: ; ; ; ptr2; ; scvtd enra halt; regtoti; rcssp ptr2; ; scvtd enra halt; regtoti; rcssp ptr2; ; dnop; ; ptr5; ptr5!0x700+0xD1 ; dnop tioe tilsw halt; titoreg; rcslsw ptr5; ; dnop tioe timsw halt; titoreg; rcsmsw ptr5; ; ; ; ptr5; ptr5!c_sizero ; ; regtotmp; rcssp ptr5; ; ; ; ptr5; ptr5!0x700+0xD0 ; ; tmptoreg; rcssp ptr5; ; ; ; ptr5; ptr5!c_spio4 ; scmp aluacreg enrb halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!c_spio2 jle stlepio4; scmp aluacreg enrb halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!szero jgt stgtpio2; enrb halt; regtoti; rcssp ptr5; ; scmp enra halt; regtoti; rcssp ptr2; ; ; ; ptr5; ptr5!c_sione jle sxis0; halt; regtotmp; rcssp ptr5; ; ; ; ptr5; ptr5!0x700+0xD0 ; halt; tmptoreg; rcssp ptr5; ; ; ; ptr5; ptr5!0x700+0xD1 ; dnop enra loaddp halt; regtoti; rcsmsw ptr5; ; dnop enra loaddp halt; regtoti; rcslsw ptr5; ; dnop; ; ptr5; ptr5!c_dpio2 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dsub enrb loaddp halt; regtoti; rcslsw ptr5; ; dnop tioe tilsw; ; ptr5; ptr5!0x700+0xD1 ; dnop tioe tilsw halt; titoreg; rcslsw ptr5; call stlepio4; dnop tioe timsw halt; titoreg; rcsmsw ptr5;sxis0: ; ; ; ptr5; ptr5!c_simone ; halt; regtotmp; rcssp ptr5; ; ; ; ptr5; ptr5!0x700+0xD0 ; halt; tmptoreg; rcssp ptr5; ; ; ; ptr5; ptr5!0x700+0xD1 ; dnop enra loaddp halt; regtoti; rcsmsw ptr5; ; dnop enra loaddp halt; regtoti; rcslsw ptr5; ; dnop; ; ptr5; ptr5!c_dpio2 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dadd enrb loaddp halt; regtoti; rcslsw ptr5; ; dnop; ; ptr5; ptr5!0x700+0xD1 ; dnop tioe tilsw halt; titoreg; rcslsw ptr5; call stlepio4; dnop tioe timsw halt; titoreg; rcsmsw ptr5;stgtpio2: ; ; ; ptr5; ptr5!c_stwo19pio2 ; scmp aluacreg enrb halt; regtoti; rcssp ptr5; ; ; ; ptr2; jgt stisbig; enra halt; regtoti; rcssp ptr2; ; ; ; ptr5; ptr5!c_sinvpio2 ; smul enrb halt; regtoti; rcssp ptr5;|* convert it to int: ; smul; ; ; ; scvtint aluamul halt; ; ; ; scvtint aluamul; ; ptr5; ptr5!0x700+0xD0 ; dfloat enra tioe tisp halt; titoreg; rcssp ptr5; ; dfloat enra tioe tisp halt; ; ; ; dnop; ; ptr5; ptr5!0x700+0xD2 ; dnop srccalu clkcc tioe tilsw halt;titoreg; rcslsw ptr5; ; dnop tioe timsw halt; titoreg; rcsmsw ptr5; ; dnop; ; ptr5; ptr5!c_dpio2 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dmul mulacreg enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulacreg; ; ptr5; ptr5!0x700+0xD1 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; drsub aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dnop; ; ; ; dnop srccalu clkcc tioe tilsw halt;; ;|* Get msw of z ANDED w/ 7ff0 0000 |* ; i2cmp enrb tioe timsw halt; ; ptr5; ptr5!c_si7ffmask ; i2land enra halt; regtoti; rcssp ptr5; ; ; ; ; ; tioe tisp halt; titotmp; rcssp; ptr5!0x700+0xD2|* Get msw of w ANDED w/ 0x7ff00000|* ; i2land enrb tioe tisp halt; regtoti; rcsmsw ptr5; ; i2land; ; ; ; i2sub alubalu enra halt; tmptoti; rcssp; ; i2sub alubalu; ; ptr5; ptr5!c_ssin_cons ; i2cmp alubalu enra halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!c_dpio2_1 jle yeqz; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dnop aluacreg enrb loaddp halt; regtoti; rcslsw ptr5; ; dnop; ; ptr5; ptr5!0x700+0xD2 ; dnop enra loaddp halt; regtoti; rcsmsw ptr5; ; dmul enra loaddp halt; regtoti; rcslsw ptr5; ; dmul; ; ptr5; ptr5!0x700+0xD1 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; drsub aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dnop ; ; ptr5; ptr5!c_dsnpio2_t66 ; dnop enrb srccalu clkcc loaddp halt;regtoti; rcsmsw ptr5; ; dmul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul; ; ; ; dnop halt; ; ; ; drsub aluamul alubcreg halt; ; ; ; dnop; ; ptr5; ptr5!0x700+0xD1 ; dnop tioe tilsw halt; titoreg; rcslsw ptr5; call stlepio4; dnop tioe timsw halt; titoreg; rcsmsw ptr5;yeqz:|* dnop of aluacreg has started. Pass it over to D1 ; dnop; ; ptr5; ptr5!0x700+0xD1 ; dnop tioe tilsw halt; titoreg; rcslsw ptr5; call stlepio4; dnop tioe timsw halt; titoreg; rcsmsw ptr5; stisbig:|* Fist make msw of y positive by logical AND w/ 7FFFFFFF ; ; ; ptr5; ptr5!sqnan ; i2cmp enrb halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!0x700+0xD1 ; i2land enra halt; regtoti; rcsmsw ptr5; ; ; ; ; call r_argred; i2cmp enra tioe tisp halt; ; ;|note: r_argred will call stlepio4 at the endstlepio4: ; ; ; ptr5; ptr5!0x700+0xD1 ; dnop enra enrb loaddp halt; regtoti; rcsmsw ptr5; ; dmul enra enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul; ; ; ; dnop srccmul clkcc; ; ; ; dnop; ; ptr5; ptr5!0x700+0xD0|* Add 1 to n (n++) ; i2cmp enra halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!c_sione jloop snotcos; i2add enrb halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!0x700+0xD0 ; i2cmp enra tioe tisp halt; titoreg; rcssp ptr5; lpreg!1snotcos: ; i2land halt; ; ; lpreg- ; i2land; ; ptr5; ptr5!c_sizero jloop sdosincos; i2cmp alubalu enra halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!c_dssin2 jne nisnoteq0; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dmul mulacreg enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulacreg; ; ptr5; ptr5!c_dssin1 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dadd aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulaalu mulbcreg; ; ; ; dmul mulaalu mulbcreg; ; ptr5; ptr5!c_dssin0 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dadd aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulaalu mulbcreg; ; ; ; dmul mulaalu mulbcreg; ; ptr5; ptr5!done ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; drsub aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; drsub aluamul; ; ptr5; ptr5!0x700+0xD1 ; dnop enrb srccalu clkcc loaddp halt;regtoti; rcsmsw ptr5; ; dmul mulacreg enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulacreg; ; ; ; dnop halt; ; ; ; dnop tioe tilsw halt; titotmp; rcslsw; call endit; dnop tioe timsw halt; titotmp; rcsmsw;nisnoteq0: ; dnop; ; ptr5; ptr5!c_dscos_2 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dmul mulacreg enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulacreg; ; ptr5; ptr5!c_dscos_1 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dadd aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulaalu mulbcreg; ; ; ; dmul mulaalu mulbcreg; ; ptr5; ptr5!c_dscos_0 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dadd aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulaalu mulbcreg; ; ; ; dmul mulaalu mulbcreg; ; ptr5; ptr5!dhalf ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; drsub aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulaalu mulbcreg; ; ; ; dmul mulaalu mulbcreg; ; ptr5; ptr5!done ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; drsub aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dnop; ; ; ; dnop tioe tilsw halt; titotmp; rcslsw; call endit; dnop tioe timsw halt; titotmp; rcsmsw;endit: ; ; ; ptr5; ptr5!0x700+0xD0 ; i2cmp enra halt; regtoti; rcssp ptr5; ; ; ; ptr5; ptr5!c_sitwo ; i2land enrb halt; regtoti; rcssp ptr5; ; i2land; ; ptr5; ptr5!c_sizero ; i2cmp alubalu enra halt; regtoti; rcssp ptr5; ; ; ; ; jeq nand2; dnop enra enrb loaddp halt; tmptoti; rcsmsw; ; dneg enra enrb loaddp halt; tmptoti; rcslsw; ; dnop; ; ; ; dnop srccalu clkcc halt; ; ; ; dcvts aluacreg halt; ; ; ; ; ; ptr1; call idle1; tioe tisp halt; titoreg; rcssp ptr1;nand2: ; dnop enra loaddp halt; tmptoti; rcsmsw; ; dcvts enra loaddp halt; tmptoti; rcslsw; ; ; ; ptr1; call idle1; tioe tisp halt; titoreg; rcssp ptr1;sdosincos: ; dnop; ; ptr5; ptr5!c_dscos_2 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dmul mulacreg enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulacreg; ; ptr5; ptr5!c_dscos_1 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dadd aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulaalu mulbcreg; ; ; ; dmul mulaalu mulbcreg; ; ptr5; ptr5!c_dscos_0 ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; dadd aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulaalu mulbcreg; ; ; ; dmul mulaalu mulbcreg; ; ptr5; ptr5!dhalf ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; drsub aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dmul mulaalu mulbcreg; ; ; ; dmul mulaalu mulbcreg; ; ptr5; ptr5!done ; dnop enrb loaddp halt; regtoti; rcsmsw ptr5; ; drsub aluamul enrb loaddp halt; regtoti; rcslsw ptr5; ; dnop; ; ; ; dnop enra tioe timsw loaddp halt;; ; ; dcvts enra tioe tilsw loaddp halt;; ; ; ; ; ptr5; ptr5!0x700+0xD5
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -