Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
35 user(s) are online (27 user(s) are browsing Forums)

Members: 0
Guests: 35

more...

Support us!

Headlines

Forum Index


Board index » All Posts (corto)




Re: Profiling on amigaos4
Not too shy to talk
Not too shy to talk


@Spectre660

Quote:

@corto

https://www.amigans.net/modules/xforum ... id=105477#forumpost105477


Oops! I'm so sorry ... I really did not remember. So I did not keep my promise ... I was too far too long ... but after an house, my third child and several job changes, I start again to have some free time

Go to top


Re: Profiling on amigaos4
Not too shy to talk
Not too shy to talk


@kas1e

Quote:

So, questions is : what we have today to do normal profiling of our apps ?

There was "hieronymus" on os4depot. It wasn't feature rich, but it was a start. Through it wasn't working on many machines, and work only on AmigaOne (G3/G4), Sam440 and Sam460. Also started from os4 FE, it didn't works Sam460ex. As it also no more in develop we probably can forget about for now.


Hieronymus is not as advanced as I would like but don't consider it dead yet

I have unreleased improvements that I would have to publish in a new version, to make it working in an alternative mode without machine restriction. And other things.
I was not aware about problems with Sam460.

Go to top


Re: type of crash: alignment exeption, how to fix ?
Not too shy to talk
Not too shy to talk


@kas1e Great! Thank you for that. And I am sorry for not having answered to you and sent the diff. So you did it. I was not sure at all they will accept the patch, as any systems emulate the alignment exception on float accesses.

A comment above the structures could have been added to explain the reason for padding but that good enough.

I hope this engine will allow to provide new software.

Go to top


Re: type of crash: alignment exeption, how to fix ?
Not too shy to talk
Not too shy to talk


@kas1e

Thank you for the links on models. I've sent you a modified loader by email, that could fix alignment problems in an easier way, padding the beginning of structures (still packed) in order to get the float fields aligned on 4 bytes. I dynamically allocate structures and copy the data to the address of the field Flags (just after the 3-byte padding).

I hope that will work!

Go to top


Re: type of crash: alignment exeption, how to fix ?
Not too shy to talk
Not too shy to talk


@kas1e

I will be busy in the coming days but on the week-end, I will attend the Alchimie show here in France so I will be 2 days programming on Amiga with my friends (hey thellier!)

That could be nice to try to make it working there.

Could you provide a ms3d model? All files I find are corrupted archives or they failed to be extracted ...

Go to top


Re: type of crash: alignment exeption, how to fix ?
Not too shy to talk
Not too shy to talk


@kas1e

Ok, you're right about the management of this kind of exception by Linux.

About speed: no difference, that's a matter of few instructions at load time.

What I proposer could certainly be cleaner but how you can avoid a copy in a structure that add an abstraction level, as the initial structure is badly aligned and playing with fields and padding won't give the expected result.

I will have to look at your example as I'm not so familiar with C++ and so I'm not sure to understand what you want to do there.

Go to top


Re: type of crash: alignment exeption, how to fix ?
Not too shy to talk
Not too shy to talk


Glad to see that allowed you to go to the next steps ...

As you said, you will have to fix the part with MS3DTriangle, MS3DJoint, ...

Do you know if a working Linux PPC port exists?

Go to top


Re: type of crash: alignment exeption, how to fix ?
Not too shy to talk
Not too shy to talk


@kas1e

I'm sorry again but I wrote the code being at work earlier today ... The compiler is right about uninitialized vertices, I omitted to allocate them!

MS3DVertex *vertices;
...
vertices = new MS3DVertex[numVertices];

And don't forget to free them at the end of the function:

delete [] vertices;

I hope that will work ... In any case, don't modify the organization of structures that match a binary chunk loaded from data file.

Go to top


Re: type of crash: alignment exeption, how to fix ?
Not too shy to talk
Not too shy to talk


@kas1e

Oops, I am really sorry, I mixed 2 variants ...

You can comment the line:
MS3DVertexPacked *vertices_packed = (MS3DVertexPacked *)pPtr;


Note that you certainly will also see a crash at:
f32 framesPerSecond = *(float*)pPtr;


Again, you can convert it replacing the line by this block:
f32 framesPerSecond;
    
HybridFloat tmpfloat;

    
tmpfloat.cvalue[3] = pPtr[0];
    
tmpfloat.cvalue[2] = pPtr[1];
    
tmpfloat.cvalue[1] = pPtr[2];
    
tmpfloat.cvalue[0] = pPtr[3];
    
    
framesPerSecond tmpfloat.fvalue;


Go to top


Re: type of crash: alignment exeption, how to fix ?
Not too shy to talk
Not too shy to talk


@kas1e

I don't recommend to hack playing with optimization level: even if it stops crashing, that would be due to a side effect.

The problem is that the structure is directly loaded from the binary file. As salass0 said, the loader have to be modified.

I thought about this solution: The idea is to access float values from the loaded binary only with byte access.

- Declare a union to manage access with float and bytes, rename the struct MS3DVertex into MS3DVertexPacked and define a struct MS3DVertex without the PACK_STRUCT keyword:

union HybridFloat {
    
float fvalue;
    
char cvalue[4];
};

struct MS3DVertexPacked
{
    
u8 Flags;
    
HybridFloat Vertex[3];
    
char BoneID;
    
u8 RefCount;
PACK_STRUCT;

struct MS3DVertex
{
    
u8 Flags;
    
float Vertex[3];
    
char BoneID;
    
u8 RefCount;
};


- Modify the code (lines 206 to 225) by something like that (sorry, not able to compile and test here):

MS3DVertex *vertices;
    
MS3DVertexPacked *vertices_packed = (MS3DVertexPacked *)pPtr;
    
HybridFloat tmpfloat;
    
char *pVPtr;
    
pVPtr pPtr// address of the first packed vertex in memory
    
pPtr += sizeof(MS3DVertexPacked) * numVertices;
    if (
pPtr buffer+fileSize)
    {
        
delete [] buffer;
        
os::Printer::log("Loading failed. Corrupted data found."file->getFileName(), ELL_ERROR);
        return 
false;
    }
    for (
u16 tmp=0tmp<numVertices; ++tmp)
    {
#ifdef __BIG_ENDIAN__
        // Read per byte with swapping and fill the 3 vertices in the final structure
        // pVPtr[0] is ignored, it contains the char field Flags
        
tmpfloat.cvalue[3] = pVPtr[1];
        
tmpfloat.cvalue[2] = pVPtr[2];
        
tmpfloat.cvalue[1] = pVPtr[3];
        
tmpfloat.cvalue[0] = pVPtr[4];
        
vertices[tmp].Vertex[0] = tmpfloat.fvalue;
        
tmpfloat.cvalue[3] = pVPtr[5];
        
tmpfloat.cvalue[2] = pVPtr[6];
        
tmpfloat.cvalue[1] = pVPtr[7];
        
tmpfloat.cvalue[0] = pVPtr[8];
        
vertices[tmp].Vertex[1] = tmpfloat.fvalue;
        
tmpfloat.cvalue[3] = pVPtr[9];
        
tmpfloat.cvalue[2] = pVPtr[10];
        
tmpfloat.cvalue[1] = pVPtr[11];
        
tmpfloat.cvalue[0] = pVPtr[12];
        
vertices[tmp].Vertex[2] = - tmpfloat.fvalue;

        
// Go to the next vertex structure
        
pVPtr += sizeof(struct MS3DVertexPacked);
#else
        
vertices[tmp].Vertex[2] = -vertices[tmp].Vertex[2];
#endif
    
}


Additionally, about gcc options, avoid optimization options except -OX ones. And about -fexpensive-optimizations, the doc says it is activated with -O2 and stronger levels.


Go to top


Re: Maximum memory X1000
Not too shy to talk
Not too shy to talk


@broadblues

Quote:
Every program that wants to use extended memory needs to add specific support for it.


This is why it was obvious that almost no apps would be written supporting this feature (reserved for motivated and skilled developers) and also because almost all apps don't need large amounts of memory.
I am glad to see that helped with SketchBlock but this feature should be entirely managed by the OS. Maybe one day ...

@Raziel

I recently looked for memory sticks for my X1000 but I didn't find 4 GB ones. So I thought that we could have 2 GB in each of the 4 slots, that is to say 8 GB max.
Anyway, that's not necessary to buy 16 GB betting they will be addressed by OS4 soon.

Go to top


Re: PCC ASM memcpy ?
Not too shy to talk
Not too shy to talk


@thellier Using asm is not always (and even rarely) the solution. Before focusing no optimization, that's better to measure performance and then identify problems.

Go to top


Re: PCC ASM memcpy ?
Not too shy to talk
Not too shy to talk


@thellier

Did you notice low performance on memcpy or CopyMem? Does it concern a specific board? If so, which one?

In the past, I realized benchmarks on memory operations and functions written by hand are rarely optimal (or better on some models but worst on some others).

Go to top


Re: gcc -fexceptions
Not too shy to talk
Not too shy to talk


@Raziel

Quote:

@broadblues

I see, thank you again

Will reconfigure and compile all my projects and if anything comes up may bother you again


This gcc 5.4 is intended to become the official version but it is necessary to check that there are all features we need and that they work.
That's maybe not comfortable but joining our efforts, we will have a solid compiler (and tools ready for more recent version like 6.1).

Don't hesitate to create issues in the project on github.

Go to top


Re: gcc -fexceptions
Not too shy to talk
Not too shy to talk


@Raziel

Native compiler for OS4 and OS4 cross-compiler for Debian based Linux are available here:
https://github.com/sba1/adtools

That's well explained in the readme, that gives a link for direct download.

I use the latest:
https://dl.bintray.com/sba1/adtools-na ... ools-os4-20170623-404.lha

Go to top


Re: gcc -fexceptions
Not too shy to talk
Not too shy to talk


It seems there was at least one problem in the code:

try {
tf = bin ? luaU_undump1(z) : luaY_parser(z);
status = 0;
} else {

I'm not a C++ expert but it seems that throwing a char string is not a good ideally, an exception type should be preferred.

About the error "exception handling disabled, use -fexceptions to enable", I don't know ... I tried a similar case in a short example here and it works with g++ 5.4.

By the way, if you still use 5.3, you should update to 5.4, so you will be able to report some problems about the version that is in development here:
https://github.com/sba1/adtools/issues

Go to top


Re: gcc -fexceptions
Not too shy to talk
Not too shy to talk


Are not exceptions working by default (even without -fexceptions)?

@Raziel Could you provide an example and the error you get?

Go to top


Re: ffmpeg AltiVec on PA6-T
Not too shy to talk
Not too shy to talk


@MickJT Thank you for the detailed answer. My following question would have been about filling an issue on the adtools github, but you already answered

Go to top


Re: ffmpeg AltiVec on PA6-T
Not too shy to talk
Not too shy to talk


@MickJT

That's not clear for me which build environment (cross-compiler?) you use.

You mentioned adtools on sourceforge but it moved to:
https://github.com/adtools

If you're not using the official SDK, I recommend to look at:
https://github.com/sba1/adtools

You can get gcc (and binutils) to install on OS4 or Linux (Debian).

Go to top


Re: Alchimie is this week-end
Not too shy to talk
Not too shy to talk


It was really an amazing week-end, guys!

Much fun, a concert, but there was also several contests (music, gfx, demos, ... with incredible Amstrad demos) and conferences (OS4 status, PowerPC notebook, FriendUp, ...).

Go to top



TopTop
« 1 2 (3) 4 5 6 ... 15 »




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project