Psst

The Partridge Family were neither partridges nor a family. Discuss.
User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Psst

Post by chili » December 29th, 2016, 1:25 am

Chili

trybane@gmail.com
Posts: 109
Joined: August 11th, 2016, 11:17 am

Re: Psst

Post by trybane@gmail.com » December 29th, 2016, 1:27 am

Do you understand what an Easter Egg is?

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Psst

Post by chili » December 29th, 2016, 1:30 am

I can has chocolate?
Chili

User avatar
cyboryxmen
Posts: 190
Joined: November 14th, 2014, 2:03 am

Re: Psst

Post by cyboryxmen » December 31st, 2016, 5:37 pm

I'm surprised you didn't try to teach assembly by trying to program functions in x86 assembly that can be called from a C++ program. That would turn this exercise from a little distraction to the usual lessons to something that people can use for their usual C++ programming. It would really tie in this segment with the main tutorials nicely and will give people more incentive to explore this subject.

With the advent of new SIMD technologies like AVX plus the ability to better know what instructions your C++ code will eventually translate to, knowing assembly can really help people code better. I feel that every programmer needs to better understand the structure of the cpu by researching the code that it would execute. Things like registers and the different memory addressing modes, the x87 fpu and how it is separate from the core cpu, branch prediction and structuring code to make better use of them, SSE, AVX and other SIMD technologies plus other quirks of the cpu are more hidden from you when you are coding in C++ rather than assembly.

I feel that it would be more advantageous for everyone if you try to integrate the assembly exercises to the C++ tutorials by teaching how to program C++ functions in assembly that can be called from a C++ program. Perhaps that in addition to the usual tutorials, you can show how to code in assembly a more optimised version of the C++ code. A simple example would be a function coded in assembly that does calculations with AVX or one that copies data more efficiently.
Zekilk

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Psst

Post by albinopapa » December 31st, 2016, 6:05 pm

I don't think chili plans on doing a ASM tutorial series.

MSVC is what chili uses for tutorial series currently for C++, and it doesn't support inline ASM in x64 mode.

Chili does have a few SSE videos up on Youtube, you should check them out.:)

I doubt many people would be interested in programming in ASM, at least not in this community. While it is probably used here and there in the gaming community, it's probably only used in the most critical places in code where performance is concerned. I'm not saying it wouldn't be an interesting idea, but it would detract from what I believe is what chili's tutorial series are all about, learning the programming skills to create games.

Plus, I think this was a distraction for chili and a treat/gift for us as members of his community. If anything, he'd probably continue it for his "Patreons".
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

trybane@gmail.com
Posts: 109
Joined: August 11th, 2016, 11:17 am

Re: Psst

Post by trybane@gmail.com » January 1st, 2017, 2:53 am

You nailed it exactly papa, this was a sneak peak for non-patrons and the rest of the series of this will be a patron-only series, or at least that's his current plan. This isn't a tutorial series on ASM and he doesn't plan on doing on. ASM is something he enjoys doing and something I'm interested in myself, but not necessary for game programming.

I'll stop here though since everything I could say would be a repeat of what papa said :P

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Psst

Post by chili » January 1st, 2017, 3:25 am

Yeah, the fact of the matter is hand coding ASM is a fools game these days. You are correct about SIMD code, it can bring great improvements when used in the correct places. It turns out that those places are few and far between, but when you find them, SSE/AVX can blow other code out of the water.

But coding SIMD with raw ASM modules is not productive. There are things called compiler intrinsics these days that do the job way better. They enable you to specify the instructions being emitted, but they still allow the compiler to reorder instructions and align them / unroll loops / etc for optimal performance. It's the best of both worlds really.

And before you go buck wild and break out the intrinsics, technologies like C++ AMP will give you SIMD at a much higher level of abstraction that will be sufficient in many / most situations.

The real power of ASM these days is in learning to READ compiler output (disassembly) so that you can better understand and diagnose performance issues (and sometimes bugs). This is why I believe that tinkering around with ASM is not a waste of time, not for the end game of becoming an ASM programmer, but for the purposes of learning how to read x86 ASM and understanding better how the CPU works.
Chili

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Psst

Post by albinopapa » January 1st, 2017, 7:49 am

technologies like C++ AMP will give you SIMD at a much higher level of abstraction that will be sufficient in many / most situations.
I think this would only apply if you had Windows 8 and set the accelerator to the WARP device. Other than that, I believe it uses the GPU, unless you are referring to how the GPU uses it's own version of SIMD instructions.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Psst

Post by chili » January 1st, 2017, 8:39 am

Amp can generate both GPU compute
and CPU SSE stuff.
Chili

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Psst

Post by albinopapa » January 1st, 2017, 10:42 am

Didn't know that, except through the WARP accelerator.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Post Reply