
Never thought I would actually see it running in Linux, even only for a few seconds :P

Sonarpulse wrote:Seeing that screenshot makes me way too happy :D mind if I edit it in to the first post?Go right ahead
mach1ne wrote:Thats freaking awesome! I might test it on my virtual machine... if something can emulate someone's grandma's rig, it is a virtual machine on windows.
Never thought I would actually see it running in Linux, even only for a few seconds :P
Sonarpulse wrote: Here's the thing, the very new "%c" tells gcc to deference [name] value. The parenthesis are at&t syntax way of dereferencing the assembly: gcc just passes it to the assembler verbatim. If it weren't for the fact that I knew because of the "p" constraint that the value given (the address of a global variable) would have to be resolved to a (link-time) constant and thus a number with new dollar prefix, I would probably end up with two sets of parenthesis verbatim.Ahh, so %c is a GCC thing for [name]s? Then I think I understand.
important to note: when one uses a constraint such as "m", the value is referenced automatically, and then dereferenced automatically so you need neither %c, nor & in the C expression. With "r" it likewise substitutes the value for the register name, which is also sort of like referencing except register names are "dereferenced" back to their contents automatically. With "p" it DOESN'T automatically reference the value, which is why I have to do that in the C expression.
Sonarpulse wrote: Here's the thing, I don't really know whether it's faster to hack some C that works with both compilers and then fix the gcc assembly, or vice versa, which why I see no_asm and conservative as the first step, and do a hell of a lot of rebasing in git. Certainly working on either branch will help the other one, so do whatever you think is best.I think I'll work on conservative until we can proove that simply converting the assembly, and fixing some of the C wont help.
On a somewhat related, when I emailed the gcc help thread, they suggested that I make a test_main, so to speak. So far I have just done been doing static code comparisons, but especially if we are going to try to get conservative working first, some dynamic testing would go along way. It will be a pain to run the MSVC and build up tables of values, but if we buckle down and do it I think we'll be glad we did.
Sonarpulse wrote:Oh, I though you needed help with fixing the syntax... but anyway, I made a flowchart of your C code here:https://www.dropbox.com/s/s5hos5yyqpaw3 ... ucture.png, and then produced some new C code here: https://pastee.org/myue7.VladVP wrote:Hmm... looks complicated... I'll try taking a look at it tomorrow...Great. GreaseMonkey said that it has do with unpacking vxls, which matches what little I can gleam from it. Some of It I can easily turn into a do-while loop, and there are a couple other things to make it more readable, but I left it as is for now so it can be compared side by side to the assembly (and hopefully the disassembly can be too.)
Sonarpulse wrote:Awesome! That flowchart especially looks crazy complex. Thanks so much Vlad.No problem
.file "temp.c"
.text
.p2align 4,,15
.globl expandbit256
.type expandbit256, @function
expandbit256:
.LFB0:
.cfi_startproc
movl 4(%esp), %ecx
movl 8(%esp), %eax
cmpb $32, 1(%ecx)
jne .L7
.L2:
movl xbsflor, %edx
cmpb $0, (%ecx)
movl 128(%edx), %edx
je .L10
.L3:
.p2align 4,,7
.p2align 3
.L8:
movl %edx, (%eax)
addl $4, %eax
movl $-1, %edx
jmp .L8
.L7:
movl $0, (%eax)
addl $4, %eax
movl $0, (%eax)
addl $4, %eax
jmp .L7
.L10:
ret
.cfi_endproc
.LFE0:
.size expandbit256, .-expandbit256
.ident "GCC: (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2"
.section .note.GNU-stack,"",@progbits
eax = (int32_t)((int8_t*)s)[3];eax = (uint32_t)((uint8_t*)s)[3];
Sonarpulse wrote:haha, well there is a few things in sdlmain, and it's still buggy so I didn't do the C all right. The barebones to get it to compile are on github, but I'm still "un-spagetti-ing" it. That's where your chart comes in handy!Yes... I have been considering making a map of the structure of Voxlap; i.e. what functions and subroutines use what other functions...
Sonarpulse wrote: OK, yeah I basically did what you did, except I have an initial jump and then a while loop. I dunno what's better.Yes... I'm glad you've made the while loops, but... well... I would say that all those labels aren't really preferable...
Yes... I have been considering making a map of the structure of Voxlap; i.e. what functions and subroutines use what other functions...Any chance I could help? I'm trying to assign proper types to all the longs, so I'm browsing a lot of code too.
g++ -o binaries/simple.exe -lmingw32 -lSDLmain -lSDL -mwindows -ggdb -Wall -Wextra -Wno-unused-variable -Wno-unused-parameter -Wno-unused-but-set-variable binaries/simple.obj binaries/voxlap5.obj binaries/v5.obj binaries/kplib.obj binaries/sdlmain1.obj
VladVP wrote:Yes... I have been considering making a map of the structure of Voxlap; i.e. what functions and subroutines use what other functions...Yes, I think all three of us should do this. I was thinking get the function documentation and stick it in voxlap5.cpp for doxygen, which I already used in simple.cpp. Then perhaps we can document the static/inline functions too the same way (hopefully doxygen knows what to do for that). I so far have barely even looked at that documentation, which is probably a huge mistake.
I actually think I'll attempt that... It would be VERY useful for the blacbox testing that I'm planning to to do on all the functions in voxlib.txt.
Sonarpulse wrote: OK, yeah I basically did what you did, except I have an initial jump and then a while loop. I dunno what's better.Yes... I'm glad you've made the while loops, but... well... I would say that all those labels aren't really preferable...
C:\MinGW\include\SDL\C:\MinGW\msys\1.0\lib\Users browsing this forum: No registered users and 5 guests