Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

re: Windows PL/I cant inline math functions
From: "David Frank" <dave_frank@hotmail.com>, Road Runner High Speed Online http:/
/www.rr.com
Date: Fri, 05 Nov 2004 12:07:21 GMT
.
| I assert that IBM compiler writers fall into the category mentioned below,
| prove me wrong by posting PL/I's assy listing of    y = exp(x)
.
IBM PL/I for Windows, OS/2 etc, uses hardware SIN, COS etc
for the various BIF etc.
.
For these it uses:
FSIN	for sine
FCOS	for cosine
FPTAN 	for tangent
FPATAN	for arcsine
FPATAN	for arccosine
FPATAN	for arctangent
FSQRT	for square root
etc etc

example:

;***** 6 	Y = SINF(X);
FLD	DWORD PTR [EBP-08H];	X
FSIN
FSTP	ST(0)
.
| CVF takes considerably more than that to compute EXP(x),  see below 17
| consecutive floating inst. plus additional housekeeping.
|
| -------------
| program test
| x = 3.33
| y = exp(x)
| end program
| -------------
| .486
|  .MODEL flat
|  COMM .bss$:12
|  .data
| .literal$ REAL4 040551EB8r ; REAL4 3.330000
|  SDWORD 00h ; SDWORD 0
|  .data
| .drectve$ BYTE  "-defaultlib:dfor.lib "
|  BYTE  "-defaultlib:libc.lib "
|  BYTE  "-defaultlib:dfconsol.lib "
|  BYTE  "-defaultlib:dfport.lib "
|  BYTE  "-defaultlib:kernel32.lib "
|  BYTE 0
|  REPEAT 4
|  BYTE 0
|  ENDM
|  EXTERN  _for_set_reentrancy@4:PROC
|  .CODE
|  ;      1 program test
|  PUBLIC _MAIN__
| _MAIN__ PROC
|  push ebp
|  mov ebp, esp
|  sub esp, 32
|  sub esp, 4
|  lea eax, dword ptr .literal$+4
|  push eax
|  ffree st(6)
|  ffree st(5)
|  call _for_set_reentrancy@4
|  add esp, 4
|  mov eax, dword ptr .literal$             ; 000002
|  mov dword ptr .bss$+8, eax
|  fld dword ptr .bss$+8              ; 000003
|  ffree st(6)
|  ffree st(7)
|  fldl2e
|  fmulp st(1), st(0)
|  fld st(0)
|  frndint
|  fxch st(1)
|  fsub st(0), st(1)
|  f2xm1
|  fld1
|  faddp st(1), st(0)
|  fscale
|  fstp st(1)
|  fstp st(6)
|  fld st(5)
|  fstp dword ptr .bss$+4
|  mov eax, 1                ; 000004
|  ffree st(6)
|  ffree st(5)
|  mov esp, ebp
|  pop ebp
|  ret
| _MAIN__ ENDP
|  END

Report this thread to moderator Post Follow-up to this message
Old Post
robin
11-16-04 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:57 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.