Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
30 crawler(s) on-line.
 149 guest(s) on-line.
 3 member(s) on-line.


 amigakit,  OldFart,  saimo

You are an anonymous user.
Register Now!
 saimo:  1 min ago
 amigakit:  2 mins ago
 OldFart:  2 mins ago
 _ThEcRoW:  22 mins ago
 NutsAboutAmiga:  49 mins ago
 retrofaza:  50 mins ago
 Rob:  50 mins ago
 OlafS25:  1 hr 13 mins ago
 Gunnar:  1 hr 21 mins ago
 Kremlar:  1 hr 35 mins ago

/  Forum Index
   /  Amiga OS4.x \ Workbench 4.x
      /  Does AOS4 support ALTIVEC?
Register To Post

Goto page ( Previous Page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 Next Page )
PosterThread
Jorge 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 11:35:49
#121 ]
Cult Member
Joined: 20-Oct-2003
Posts: 657
From: Scottsdale, AZ

@MagicSN

Quote:
I'd say it might make sense to check what sort of CPU (check == with the provided API by the AltiVec-using


Well, now isn't that a cool thing in combination with the interface structures:


struct RenderIF * aRenderIF;

if (ExecIF->GetCPU()) & ALTIVEC) // or however this goes
{
render_lib = OpenLibrary("myPlainG3Render.library",0);
aRenderIF = ObtainInterface(render_lib);
}
else
{
render_lib = OpenLibrary("mySIMDRender.library",0);
aRenderIF = ObtainInterface(render_lib);
}

aRenderIF->RenderMe();


I guess this would work ;)



Real OOP at OS level

_________________
AmigaOne XE G3/933/VIA/FM801/R200 (fixed),
G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!)
µA1-MK2/G3/933/R200/CMI8738
XE/G4 (broken 7450/800)

 Status: Offline
Profile     Report this post  
olegil 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 12:25:22
#122 ]
Elite Member
Joined: 22-Aug-2003
Posts: 5895
From: Work

@Jorge

If that one gets verified it needs to become the start of a HOW-TO immediately

_________________
This weeks pet peeve:
Using "voltage" instead of "potential", which leads to inventing new words like "amperage" instead of "current" (I, measured in A) or possible "charge" (amperehours, Ah or Coulomb, C). Sometimes I don't even know what people mean.

 Status: Offline
Profile     Report this post  
salass00 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 12:29:25
#123 ]
Elite Member
Joined: 31-Oct-2003
Posts: 2707
From: Finland

@Jorge

As long as the jump-tables are compatible (same LVO values) the same should be possible to do with preOS4 style libraries as well.

 Status: Offline
Profile     Report this post  
Jorge 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 15:14:42
#124 ]
Cult Member
Joined: 20-Oct-2003
Posts: 657
From: Scottsdale, AZ

@salass00

Quote:
As long as the jump-tables are compatible (same LVO values) the same should be possible to do with preOS4 style libraries as well.


Well, there is nothing like LVOs on PPC libraries and there is no Interface for 68k code

So, guess, no, it won't work with preOS4 libs...

Both libraries just have to export the same interface structures, that's it. The rest is handled by the OS.

_________________
AmigaOne XE G3/933/VIA/FM801/R200 (fixed),
G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!)
µA1-MK2/G3/933/R200/CMI8738
XE/G4 (broken 7450/800)

 Status: Offline
Profile     Report this post  
Jorge 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 15:20:03
#125 ]
Cult Member
Joined: 20-Oct-2003
Posts: 657
From: Scottsdale, AZ

@olegil

Quote:
If that one gets verified it needs to become the start of a HOW-TO immediately

Oops, I guess it won't. Inverted logic I'd put a bug in that code ... damn

_________________
AmigaOne XE G3/933/VIA/FM801/R200 (fixed),
G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!)
µA1-MK2/G3/933/R200/CMI8738
XE/G4 (broken 7450/800)

 Status: Offline
Profile     Report this post  
Chris_Y 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 15:23:23
#126 ]
Elite Member
Joined: 21-Jun-2003
Posts: 3203
From: Beds, UK

@Jorge

Why not just install the correct version of the library, thus shifting any logic to the installation script? That would be more sensible than adding detection code to every single piece of code that uses the library, surely?

Chris

_________________
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar is Tabitha by Eric W Schwartz

 Status: Offline
Profile     Report this post  
Jorge 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 15:26:40
#127 ]
Cult Member
Joined: 20-Oct-2003
Posts: 657
From: Scottsdale, AZ

@salass00

BTW: If you mean pre OS4 (e.g. 3.x) then you'd just find a mechanism to export the jumptable into a struct, add the libbase, do some stubs (or one), and call a lib thru that stub (guess then you'll eventually have reinvented OS4 And you still hack it in, because a lib cannot guarantee and verify/validate the LVO of that lib. Why not take what's here already

_________________
AmigaOne XE G3/933/VIA/FM801/R200 (fixed),
G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!)
µA1-MK2/G3/933/R200/CMI8738
XE/G4 (broken 7450/800)

 Status: Offline
Profile     Report this post  
salass00 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 15:26:46
#128 ]
Elite Member
Joined: 31-Oct-2003
Posts: 2707
From: Finland

@Jorge

Yes there is. How do you think pre-OS4 PPC libraries work? Anyway this is all off-topic, the thread is about altivec and not libraries/interfaces.

 Status: Offline
Profile     Report this post  
ssolie 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 15:29:57
#129 ]
Elite Member
Joined: 10-Mar-2003
Posts: 2755
From: Alberta, Canada

@Jorge
Quote:
Well, now isn't that a cool thing in combination with the interface structures...


You're close but ExecSG interfaces have distinct names as well as types. You would have the same library (e.g. same file in LIBS:) but with two distinct interfaces. In your code you would have to employ something like the Adapter pattern to hide the fact that the same function is being executed by two different interfaces.

All will become clear when you've read through the OS4 SDK docs...

_________________
ExecSG Team Lead

 Status: Offline
Profile     Report this post  
Jorge 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 15:34:08
#130 ]
Cult Member
Joined: 20-Oct-2003
Posts: 657
From: Scottsdale, AZ

@Chris_Y

Quote:
install the correct version of the library

Because it will simply crash if you call Altivec on a G3 ? (and install the g4 lib by accident).

_________________
AmigaOne XE G3/933/VIA/FM801/R200 (fixed),
G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!)
µA1-MK2/G3/933/R200/CMI8738
XE/G4 (broken 7450/800)

 Status: Offline
Profile     Report this post  
Jorge 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 15:36:03
#131 ]
Cult Member
Joined: 20-Oct-2003
Posts: 657
From: Scottsdale, AZ

@ssolie

Quote:
distinct names

Sure: Both have a "main" interface, indeed.

_________________
AmigaOne XE G3/933/VIA/FM801/R200 (fixed),
G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!)
µA1-MK2/G3/933/R200/CMI8738
XE/G4 (broken 7450/800)

 Status: Offline
Profile     Report this post  
xeron 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 16:32:34
#132 ]
Elite Member
Joined: 22-Jun-2003
Posts: 2440
From: Weston-Super-Mare, Somerset, England, UK, Europe, Earth, The Milky Way, The Universe

@Jorge

More like:


struct Library *RenderBase = NULL;
struct RenderIFace *IRender = NULL;

if( IExec->GetCPUSomethingOrOther() ) // i can't remember the actual function off the top of my head right now, either
{
  RenderBase = IExec->OpenLibrary("myPlainG3Render.library",0);
} else {
  RenderBase = IExec->OpenLibrary("altivecrender.library",0);
}
IRender = IExec->GetInterface( RenderBase, "main", 1, NULL );

IRender->RenderMe();

_________________
Playstation Network ID: xeron6

 Status: Offline
Profile     Report this post  
Chris_Y 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 17:19:56
#133 ]
Elite Member
Joined: 21-Jun-2003
Posts: 3203
From: Beds, UK

@Jorge

Quote:

Jorge wrote:

Because it will simply crash if you call Altivec on a G3 ? (and install the g4 lib by accident).


That's why you have to install the correct version. Or you could put detection code in the library itself, either popping up a requester if you have the Altivec version on a non-Altivec machine, or containing non-Altivec versions of the Altivec routines.

If you are going to the trouble of having optimised libraries, it seems a bit silly to check for Altivec and call the correct library in every program that uses that library, especially when 680x0, WOS, PUP etc libraries have worked perfectly well in the past using my method (select the correct library at installation time)

Chris

_________________
"Miracles we do at once, the impossible takes a little longer" - AJS on Hyperion
Avatar is Tabitha by Eric W Schwartz

 Status: Offline
Profile     Report this post  
Jorge 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 17:43:54
#134 ]
Cult Member
Joined: 20-Oct-2003
Posts: 657
From: Scottsdale, AZ

@xeron

_________________
AmigaOne XE G3/933/VIA/FM801/R200 (fixed),
G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!)
µA1-MK2/G3/933/R200/CMI8738
XE/G4 (broken 7450/800)

 Status: Offline
Profile     Report this post  
Rogue 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 19:25:13
#135 ]
OS4 Core Developer
Joined: 14-Jul-2003
Posts: 3999
From: Unknown

@xeron,Jorge:

It could also be done something like


struct Library *RenderBase = NULL;
struct RenderIFace *IRender = NULL;
uint32 vectorUnit;

RenderBase = IExec->OpenLibrary("render.library", 0);

IExec->GetCPUInfoTags(GCIT_VectorUnit, &vectorUnit);

if (vectorUnit == VECTORTYPE_ALTIVEC || vectorUnit == VECTORTYPE_VMX)
{
IRender = (struct RenderIFace *)IExec->GetInterface(RenderBase, "altivec", 1, NULL);
}
else
{
IRender = (struct RenderIFace *)IExec->GetInterface(RenderBase, "plain", 1, NULL);
}

if (!IRender) printf("Oops, no appropriate rendering interface found\n");


i.e. you can have one single library which implements the functions for both altivec and normal CPU's. This would allow you to share common code between the two interfaces, or switch interfaces based on a preference item.

_________________
Seriously, if you want to contact me do not bother sending me a PM here. Write me a mail

 Status: Offline
Profile     Report this post  
ssolie 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 19:44:25
#136 ]
Elite Member
Joined: 10-Mar-2003
Posts: 2755
From: Alberta, Canada

@Rogue
Oh sure, cheat with type casting...

_________________
ExecSG Team Lead

 Status: Offline
Profile     Report this post  
Anonymous 
Re: Does AOS4 support ALTIVEC?
Posted on 1-Jun-2004 23:17:53
# ]

0
0

Quote:

Rogue wrote:
@xeron,Jorge:


struct Library *RenderBase = NULL;
struct RenderIFace *IRender = NULL;
uint32 vectorUnit;

RenderBase = IExec->OpenLibrary("render.library", 0);

IExec->GetCPUInfoTags(GCIT_VectorUnit, &vectorUnit);

if (vectorUnit == VECTORTYPE_ALTIVEC || vectorUnit == VECTORTYPE_VMX)
{
IRender = (struct RenderIFace *)IExec->GetInterface(RenderBase, "altivec", 1, NULL);
}
else
{
IRender = (struct RenderIFace *)IExec->GetInterface(RenderBase, "plain", 1, NULL);
}

if (!IRender) printf("Oops, no appropriate rendering interface found\n");


Hello Rogue, xeron, Jorge,

Oh you guys and your speaking in tongues!

But seriously, FAN TAS TIC!

We need as many capabilities in the earliest wide release version of the new and improved AOS as possible, so that anyone with an interest can actively use it NOW.

Very important because of the severe lag in MHz our AmigaOnes have compared to AMD and intel.

I hope some amazing vector graphis games appear, super duper Tempest, or Tron like landscapes.


I keep going on and on about it, but here goes, I hope you can get a RAID driver up and running too. Very significant (my opinion). (I know of the bulging "to do" list you have, so I guess it'll have to wait .)



AmigaOne! AOS4.0! If OS$<>"AOS" Then self_destruct

 
     Report this post  
Jorge 
Re: Does AOS4 support ALTIVEC?
Posted on 2-Jun-2004 6:38:30
#138 ]
Cult Member
Joined: 20-Oct-2003
Posts: 657
From: Scottsdale, AZ

@ssolie

Quote:
Oh sure, cheat with type casting...

I would not call this "cheat". That's pretty the purpose of an interface NOT to contain any data. Else it wouldn't be an interface. Well struct Interface contains a (header) entry of struct InterfaceData, but this is a unique control header for all interfaces.

@Rogue

Cool idea

_________________
AmigaOne XE G3/933/VIA/FM801/R200 (fixed),
G3SE/600/Voodoo3/Sil680/RTL8139/SBLive! (noiseless!)
µA1-MK2/G3/933/R200/CMI8738
XE/G4 (broken 7450/800)

 Status: Offline
Profile     Report this post  
Rogue 
Re: Does AOS4 support ALTIVEC?
Posted on 2-Jun-2004 7:05:27
#139 ]
OS4 Core Developer
Joined: 14-Jul-2003
Posts: 3999
From: Unknown

@ssolie

Quote:

ssolie wrote:
@Rogue
Oh sure, cheat with type casting...


Well, doesn't need to be cheating. Both interfaces could be in fact RenderIFace because both are functionally the same

_________________
Seriously, if you want to contact me do not bother sending me a PM here. Write me a mail

 Status: Offline
Profile     Report this post  
EntilZha 
Re: Does AOS4 support ALTIVEC?
Posted on 2-Jun-2004 9:18:21
#140 ]
OS4 Core Developer
Joined: 27-Aug-2003
Posts: 1679
From: The Jedi Academy, Yavin 4

@Rogue

Another possibility is for the interface to check for Altivec availablility at init time, and set some of it's methods accordingly. After all, the Altivec uint will probably not go away

_________________
Thomas, the kernel guy

"I don't have a frigging clue. I'm norwegian" -- Ole-Egil

All opinions expressed are my own and do not necessarily represent those of Hyperion Entertainment

 Status: Offline
Profile     Report this post  
Goto page ( Previous Page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 Next Page )

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle