Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
203 user(s) are online (136 user(s) are browsing Forums)

Members: 0
Guests: 203

more...

Headlines

Forum Index


Board index » All Posts (corto)




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


Re: Amigaterie French event, by Huno
Not too shy to talk
Not too shy to talk


@Hans Yes, an EGL implementation.

Thank you to all involved on the work around all that (Nova, OpenGLES, ...).

That was a great and fun week-end! Very motivating, with news, demos and discussions ...

@Rigo And several people were using CodeBench (and wondering about a new version).

@thellier Please consider staying more next time!


Edited by corto on 2017/4/3 9:49:51
Go to top


Re: Cow3Dv6- Warp3DNova Benchmarking time !-Sam460 users need help for Hans!
Not too shy to talk
Not too shy to talk


@Hans Finally I think there will be a possibility to make Hieronymus working on the X1000.

I have to look at that and ... see if it still works on other platforms with the Update 1.

@spectre660 and all
I am very interested in feedback and bug reports about Hieronymus but please, don't copy paste a whole GrimReaper trace in forums. Thanks!

Go to top


Re: SortBench for SysMon : Ask for tests and results
Not too shy to talk
Not too shy to talk


Results on my uAOne:

SORTBENCH 1.1 (Gunnar von Boehn)
Its a CPU benchmark that stresses CPU, DCache and branch prediction.
CPU: IBM PowerPC 750 GX @ 800MHz; L1:32768 L2:1048576 L3:0
-------------------------------------------------------------
1K Element : 1687 MB/sec
2K Element : 1682 MB/sec
4K Element : 1681 MB/sec
8K Element : 1694 MB/sec
16K Element : 1459 MB/sec
32K Element : 1405 MB/sec

I have to say I am quite surprised.

Go to top


Re: SortBench for SysMon : Ask for tests and results
Not too shy to talk
Not too shy to talk


@tommysammy You should follow Raziel's advice because the benchmark is not supposed to access RAM.

@elwood Strange, your results are 2 times smaller than other Sam460 users. Either you have a process that consumes CPU in the background or you overclocked the CPU and that has an effect.

@zzd10h I will run it on my uAOne.

Go to top


Re: Interested in learning OpenGL ES 2 or Warp3D Nova?
Not too shy to talk
Not too shy to talk


@Hans

Thank you for this additionnal content that makes Warp3D Nova closer to people who want to develop with it.
I answer the survey right now.

Go to top


Re: Motherboard with IBM Power8 cpu... any use for OS4?
Not too shy to talk
Not too shy to talk


@tlosm
Why did you say it was little endian if you didn't know?

@elwood
The mode is chosen thanks to a bit in a privileged register (MSR).

@eliyahu
Thanks for the clear and detailed information.

Go to top


Re: New stuff from the French guys
Not too shy to talk
Not too shy to talk


Congrats, guys!

Really to bad I had to cancel few days ago, so I missed the event this year. Very curious to see the work done and ... pictures!

I would also be interested in having details about optimisations ... Huno, I hope you will explain.

Go to top



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




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project