DevMaster.net Forums
[[ Home | Forums | 3D Engines Database | Wiki | Articles/Tutorials | Game Dev Jobs | IRC Chat Network | Contact Us ]]

Go Back   DevMaster.net Forums > Site Discussions > Articles Discussion
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-12-2004, 12:34 AM   #1
DmEditor
DevMaster Editor
 
Join Date: Jan 2005
Posts: 54
Default

Linear Optimization
Author: Nicolas Capens
Description: The article focuses on the implementation of the back-end compiler that speeds up compilation time and also generates optimized code, which is especially applicable for shader compilation.
DmEditor is offline   Reply With Quote
Old 11-15-2004, 03:07 AM   #2
Kenneth Gorking
Senior Member
 
Kenneth Gorking's Avatar
 
Join Date: Aug 2004
Location: Århus, Denmark
Posts: 688
Default

Very nice article! I have actually been looking for something like this for my script compiler, so to see it land right under my nose was brilliant.

Have you considered implementing some kind of inlinening of functions, so that calls to the one-liner 'whatever()' function or something doesn't get called a billion times a second?

I have implemented something i call native functions, which are basically engine functions you can define in your script, and when you call them from your script, they are executed in the engine, like 'operator *(matrix,vector)'. What I want to ask, is how would this work with your code, can I call engine-functions from my script through SoftWire, and have it run well?
___________________________________________
"Stupid bug! You go squish now!!" - Homer Simpson
Kenneth Gorking is offline   Reply With Quote
Old 11-15-2004, 03:46 PM   #3
Nick
Senior Member
 
Join Date: Aug 2004
Location: Ghent, Belgium
Posts: 1,056
Default

Quote:
Originally Posted by Kenneth Gorking
What I want to ask, is how would this work with your code, can I call engine-functions from my script through SoftWire, and have it run well?
Absolutely. First you have to make sure you can get the address of the function you'd like to call. So generally it has to be a static function. Passing it to SoftWire is as simple as this:
Quote:
call((int)myFunction);
So this will generate the code that calls myFunction(). The cast to int is required because we want to literally use the function's address as a constant.

Inlining is possible too. Instead of using the above call, just let SoftWire generate the code for the implementation of the function.
Nick is offline   Reply With Quote
Old 11-17-2004, 12:59 AM   #4
Kenneth Gorking
Senior Member
 
Kenneth Gorking's Avatar
 
Join Date: Aug 2004
Location: Århus, Denmark
Posts: 688
Default

I Tried running your demo-app that comes the source code, and it crashed because windows XP SP2 doesn't allow this sort of thing to happen. Couldn't this be a problem for people who want to use Softwire in their own apps? Besides having to give it permission yourself, is there anything to do about it? What does the Java VM do with its JIT-compiled code?

I would also suggest that you change 'int' to 'void*' when passing function addresses, because the function pointer would be truncated from 64 to 32 bit on 64-bit processors, and that could chrash it.
___________________________________________
"Stupid bug! You go squish now!!" - Homer Simpson
Kenneth Gorking is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -7. The time now is 04:12 AM.


Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.