Curious but wouldn't it be better, perhaps, instead of providing .asm files, to compile the code directly into the executable? That way the source stays consistently C++ and LLVM is just used more or less as a bridge for the drawers.

I really don't mind having the LLVM dependency, but all things considered (and especially after playing with the LLVM target types) I'm thinking it would be better to have a single block of code that gets put together by the compiler and associated utilities rather than having to compile in the .asm files manually. That would also be beneficial for cross-architecture compiles - for example, compiling QZDoom for ARM devices. (ARMs have souls too, ya know! Even if you mostly hold it with your arm! .... okay I'll show myself out... sorry...)

Sorry, I am not trying to be nitpicky. I just dislike the idea of dealing with .asm files at all, and having the drawer code right at the gate seems to be more ideal for anyone trying to mod the engine, rather than someone who would have to eventually get LLVM anyway just to even make changes to the drawers.

Spoiler: Zen Sarcasm

1. Do not walk behind me, for I may not lead. Do not walk ahead of me, for I may not follow. Do not walk beside me, either. Just pretty much leave me the hell alone.
2. The journey of a thousand miles begins with a broken fan belt and a leaky tire.
3. It's always darkest before dawn. So if you're going to steal your neighbor's newspaper, that's the time to do it.
4. Don't be irreplaceable. If you can't be replaced, you can't be promoted.
5. No one is listening until you fart.
6. Always remember that you're unique. Just like everyone else.
7. Never test the depth of the water with both feet.
8. If you think nobody cares if you're alive, try missing a couple of car payments.
9. Before you criticize someone, you should walk a mile in their shoes.That way, when you criticize them, you're a mile away and you have their shoes.
10. If at first you don't succeed, skydiving is not for you.
11. Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day.
12. If you lend someone $20 and never see that person again, it was probably worth it.
13. If you tell the truth, you don't have to remember anything.
14. Sex is like air. It's not important unless you aren't getting any.
15. Don't squat with your spurs on.
16. Some days you're the bug; some days you're the windshield.
17. Don't worry; it only seems kinky the first time.
18. Good judgment comes from bad experience, and a lot of that comes from bad judgment.
19. The quickest way to double your money is to fold it in half and put it back in your pocket.
20. A closed mouth gathers no foot.
21. Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.
22. There are two theories to arguing with women. Neither one works.
23. Generally speaking, you aren't learning much when your lips are moving.
24. Experience is something you don't get until just after you need it.
25. Never miss a good chance to shut up.
26. We are born naked, wet and hungry, and get slapped on our behind. Then things get worse.
27. Never, under any circumstances, take a sleeping pill and a laxative on the same night.
28. There is a fine line between "hobby" and "mental illness."
29. No matter what happens, somebody will find a way to take it too seriously.
30. There comes a time when you should stop expecting other people to make a big deal about your birthday...around age 12.
31. Everyone seems normal until you get to know them

Well, the .asm files gets linked into the executable - all of them. For example, there would be a DrawColumnSSE2, DrawColumnSSE4, DrawColumnAVX and DrawColumnAVX2. When QZDoom boots, it looks at the CPU and decides it can do SSE4. So it points DrawColumn to DrawColumnSSE4.

The drawergen tool could theoretically output .cpp files instead of .asm, but the catch here is that such .cpp files would have to be compiled with specific flags to inform the compiler that it can safely generate SSE and AVX opcodes. The actual contents of those .cpp files would probably not be much more readable than the corresponding .asm files. It would remove the need for LLVM, but using LLVM still has the advantage of being able to "talk" more directly to a compiler backend. Stuff like me already telling LLVM that there cannot possibly be any pointer aliasing going on between the texture pointers and the framebuffer pointers, or which for loops to unroll and by how much.

Writing the drawers as purely C++ code is not really an option. The LLVM drawers are somewhere between 50% to 100% faster than the SSE intrinsics versions that the truecolor branch had. Those, in turn, were twice as fast as pure C++ code without intrinsics. We also have something like 50 drawer variations at this point, which is one of the reasons the launch time has gone up as much as it has.

What I mean is leaving the LLVM drawer code as-is, but instead of compiling at run-time, to compile it directly into the executable at compile time, and not have to embed the LLVM libraries themselves directly into the executable.

LLVM would be executed by MSVC++, and would simply compile the drawers into the 4 sets you mentioned and then MSVC++ would pick up the 4 generated .asm files, run NASM/YASM to get .obj files, and link them accordingly.

It's almost the same as your original proposal, except a: the .asm files would not exist in the actual source, and b: it would still improve boot times by offloading the compile to the compiler, rather than the user.

Spoiler: Zen Sarcasm

1. Do not walk behind me, for I may not lead. Do not walk ahead of me, for I may not follow. Do not walk beside me, either. Just pretty much leave me the hell alone.
2. The journey of a thousand miles begins with a broken fan belt and a leaky tire.
3. It's always darkest before dawn. So if you're going to steal your neighbor's newspaper, that's the time to do it.
4. Don't be irreplaceable. If you can't be replaced, you can't be promoted.
5. No one is listening until you fart.
6. Always remember that you're unique. Just like everyone else.
7. Never test the depth of the water with both feet.
8. If you think nobody cares if you're alive, try missing a couple of car payments.
9. Before you criticize someone, you should walk a mile in their shoes.That way, when you criticize them, you're a mile away and you have their shoes.
10. If at first you don't succeed, skydiving is not for you.
11. Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day.
12. If you lend someone $20 and never see that person again, it was probably worth it.
13. If you tell the truth, you don't have to remember anything.
14. Sex is like air. It's not important unless you aren't getting any.
15. Don't squat with your spurs on.
16. Some days you're the bug; some days you're the windshield.
17. Don't worry; it only seems kinky the first time.
18. Good judgment comes from bad experience, and a lot of that comes from bad judgment.
19. The quickest way to double your money is to fold it in half and put it back in your pocket.
20. A closed mouth gathers no foot.
21. Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.
22. There are two theories to arguing with women. Neither one works.
23. Generally speaking, you aren't learning much when your lips are moving.
24. Experience is something you don't get until just after you need it.
25. Never miss a good chance to shut up.
26. We are born naked, wet and hungry, and get slapped on our behind. Then things get worse.
27. Never, under any circumstances, take a sleeping pill and a laxative on the same night.
28. There is a fine line between "hobby" and "mental illness."
29. No matter what happens, somebody will find a way to take it too seriously.
30. There comes a time when you should stop expecting other people to make a big deal about your birthday...around age 12.
31. Everyone seems normal until you get to know them

That's exactly what that the drawergen tool would do. It is the drawergen tool that needs LLVM, and not QZDoom. Either then run the drawergen tool as part of CMake, or just add the .asm files to the repository so only LLVM is needed if you need to update the drawers.

My goal with this suggestion is - if the person preparing the executable modifies any part of the original source - including the drawers - those changes are effected immediately without the need to manually run an intermediary tool (which would be run automatically by MSVC++, anyway).

Spoiler: Zen Sarcasm

1. Do not walk behind me, for I may not lead. Do not walk ahead of me, for I may not follow. Do not walk beside me, either. Just pretty much leave me the hell alone.
2. The journey of a thousand miles begins with a broken fan belt and a leaky tire.
3. It's always darkest before dawn. So if you're going to steal your neighbor's newspaper, that's the time to do it.
4. Don't be irreplaceable. If you can't be replaced, you can't be promoted.
5. No one is listening until you fart.
6. Always remember that you're unique. Just like everyone else.
7. Never test the depth of the water with both feet.
8. If you think nobody cares if you're alive, try missing a couple of car payments.
9. Before you criticize someone, you should walk a mile in their shoes.That way, when you criticize them, you're a mile away and you have their shoes.
10. If at first you don't succeed, skydiving is not for you.
11. Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day.
12. If you lend someone $20 and never see that person again, it was probably worth it.
13. If you tell the truth, you don't have to remember anything.
14. Sex is like air. It's not important unless you aren't getting any.
15. Don't squat with your spurs on.
16. Some days you're the bug; some days you're the windshield.
17. Don't worry; it only seems kinky the first time.
18. Good judgment comes from bad experience, and a lot of that comes from bad judgment.
19. The quickest way to double your money is to fold it in half and put it back in your pocket.
20. A closed mouth gathers no foot.
21. Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.
22. There are two theories to arguing with women. Neither one works.
23. Generally speaking, you aren't learning much when your lips are moving.
24. Experience is something you don't get until just after you need it.
25. Never miss a good chance to shut up.
26. We are born naked, wet and hungry, and get slapped on our behind. Then things get worse.
27. Never, under any circumstances, take a sleeping pill and a laxative on the same night.
28. There is a fine line between "hobby" and "mental illness."
29. No matter what happens, somebody will find a way to take it too seriously.
30. There comes a time when you should stop expecting other people to make a big deal about your birthday...around age 12.
31. Everyone seems normal until you get to know them

I'm sorry. I am not trying to make this difficult for you. It was just a suggestion.

Spoiler: Zen Sarcasm

1. Do not walk behind me, for I may not lead. Do not walk ahead of me, for I may not follow. Do not walk beside me, either. Just pretty much leave me the hell alone.
2. The journey of a thousand miles begins with a broken fan belt and a leaky tire.
3. It's always darkest before dawn. So if you're going to steal your neighbor's newspaper, that's the time to do it.
4. Don't be irreplaceable. If you can't be replaced, you can't be promoted.
5. No one is listening until you fart.
6. Always remember that you're unique. Just like everyone else.
7. Never test the depth of the water with both feet.
8. If you think nobody cares if you're alive, try missing a couple of car payments.
9. Before you criticize someone, you should walk a mile in their shoes.That way, when you criticize them, you're a mile away and you have their shoes.
10. If at first you don't succeed, skydiving is not for you.
11. Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day.
12. If you lend someone $20 and never see that person again, it was probably worth it.
13. If you tell the truth, you don't have to remember anything.
14. Sex is like air. It's not important unless you aren't getting any.
15. Don't squat with your spurs on.
16. Some days you're the bug; some days you're the windshield.
17. Don't worry; it only seems kinky the first time.
18. Good judgment comes from bad experience, and a lot of that comes from bad judgment.
19. The quickest way to double your money is to fold it in half and put it back in your pocket.
20. A closed mouth gathers no foot.
21. Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.
22. There are two theories to arguing with women. Neither one works.
23. Generally speaking, you aren't learning much when your lips are moving.
24. Experience is something you don't get until just after you need it.
25. Never miss a good chance to shut up.
26. We are born naked, wet and hungry, and get slapped on our behind. Then things get worse.
27. Never, under any circumstances, take a sleeping pill and a laxative on the same night.
28. There is a fine line between "hobby" and "mental illness."
29. No matter what happens, somebody will find a way to take it too seriously.
30. There comes a time when you should stop expecting other people to make a big deal about your birthday...around age 12.
31. Everyone seems normal until you get to know them

1. Do not walk behind me, for I may not lead. Do not walk ahead of me, for I may not follow. Do not walk beside me, either. Just pretty much leave me the hell alone.
2. The journey of a thousand miles begins with a broken fan belt and a leaky tire.
3. It's always darkest before dawn. So if you're going to steal your neighbor's newspaper, that's the time to do it.
4. Don't be irreplaceable. If you can't be replaced, you can't be promoted.
5. No one is listening until you fart.
6. Always remember that you're unique. Just like everyone else.
7. Never test the depth of the water with both feet.
8. If you think nobody cares if you're alive, try missing a couple of car payments.
9. Before you criticize someone, you should walk a mile in their shoes.That way, when you criticize them, you're a mile away and you have their shoes.
10. If at first you don't succeed, skydiving is not for you.
11. Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day.
12. If you lend someone $20 and never see that person again, it was probably worth it.
13. If you tell the truth, you don't have to remember anything.
14. Sex is like air. It's not important unless you aren't getting any.
15. Don't squat with your spurs on.
16. Some days you're the bug; some days you're the windshield.
17. Don't worry; it only seems kinky the first time.
18. Good judgment comes from bad experience, and a lot of that comes from bad judgment.
19. The quickest way to double your money is to fold it in half and put it back in your pocket.
20. A closed mouth gathers no foot.
21. Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.
22. There are two theories to arguing with women. Neither one works.
23. Generally speaking, you aren't learning much when your lips are moving.
24. Experience is something you don't get until just after you need it.
25. Never miss a good chance to shut up.
26. We are born naked, wet and hungry, and get slapped on our behind. Then things get worse.
27. Never, under any circumstances, take a sleeping pill and a laxative on the same night.
28. There is a fine line between "hobby" and "mental illness."
29. No matter what happens, somebody will find a way to take it too seriously.
30. There comes a time when you should stop expecting other people to make a big deal about your birthday...around age 12.
31. Everyone seems normal until you get to know them

Trouble with .obj is that I don't know how to get LLVM to output that (although I'm 100% sure it can). It is probably the best option, but I don't like going through hell first. LLVM's documentation is virtually non-existent for its C++ API.

Well - the .asm -> NASM path is fine even if not preferable - whatever works comes first over efficiency and cleanliness.

ZDoom may be eliminating its NASM dependency soon though, which will put QZDoom in a bind because that's one commit that it will have to delay.

Spoiler: Zen Sarcasm

1. Do not walk behind me, for I may not lead. Do not walk ahead of me, for I may not follow. Do not walk beside me, either. Just pretty much leave me the hell alone.
2. The journey of a thousand miles begins with a broken fan belt and a leaky tire.
3. It's always darkest before dawn. So if you're going to steal your neighbor's newspaper, that's the time to do it.
4. Don't be irreplaceable. If you can't be replaced, you can't be promoted.
5. No one is listening until you fart.
6. Always remember that you're unique. Just like everyone else.
7. Never test the depth of the water with both feet.
8. If you think nobody cares if you're alive, try missing a couple of car payments.
9. Before you criticize someone, you should walk a mile in their shoes.That way, when you criticize them, you're a mile away and you have their shoes.
10. If at first you don't succeed, skydiving is not for you.
11. Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day.
12. If you lend someone $20 and never see that person again, it was probably worth it.
13. If you tell the truth, you don't have to remember anything.
14. Sex is like air. It's not important unless you aren't getting any.
15. Don't squat with your spurs on.
16. Some days you're the bug; some days you're the windshield.
17. Don't worry; it only seems kinky the first time.
18. Good judgment comes from bad experience, and a lot of that comes from bad judgment.
19. The quickest way to double your money is to fold it in half and put it back in your pocket.
20. A closed mouth gathers no foot.
21. Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.
22. There are two theories to arguing with women. Neither one works.
23. Generally speaking, you aren't learning much when your lips are moving.
24. Experience is something you don't get until just after you need it.
25. Never miss a good chance to shut up.
26. We are born naked, wet and hungry, and get slapped on our behind. Then things get worse.
27. Never, under any circumstances, take a sleeping pill and a laxative on the same night.
28. There is a fine line between "hobby" and "mental illness."
29. No matter what happens, somebody will find a way to take it too seriously.
30. There comes a time when you should stop expecting other people to make a big deal about your birthday...around age 12.
31. Everyone seems normal until you get to know them

Concerning assemblers, the only reason ZDoom uses NASM is because it's platform independent. If you can create files for both MASM and GAS it should work everywhere, as MASM is part of the VS distribution.

Turns out getting it to create the .obj file was a lot easier than I expected. The drawers are now generated at compile time rather than run time. It only creates the SSE 2 version for now, because from what I could tell it didn't really make any speed difference between that and the AVX-2 version. Good news is this doesn't require any assembler at all and the start time is now as fast as ZDoom.

The bad news is that the tool runs on every build, which is not really needed. I need to find some good way for it to know that the .obj file is already up to date and doesn't need a recompile.

1. Do not walk behind me, for I may not lead. Do not walk ahead of me, for I may not follow. Do not walk beside me, either. Just pretty much leave me the hell alone.
2. The journey of a thousand miles begins with a broken fan belt and a leaky tire.
3. It's always darkest before dawn. So if you're going to steal your neighbor's newspaper, that's the time to do it.
4. Don't be irreplaceable. If you can't be replaced, you can't be promoted.
5. No one is listening until you fart.
6. Always remember that you're unique. Just like everyone else.
7. Never test the depth of the water with both feet.
8. If you think nobody cares if you're alive, try missing a couple of car payments.
9. Before you criticize someone, you should walk a mile in their shoes.That way, when you criticize them, you're a mile away and you have their shoes.
10. If at first you don't succeed, skydiving is not for you.
11. Give a man a fish and he will eat for a day. Teach him how to fish, and he will sit in a boat and drink beer all day.
12. If you lend someone $20 and never see that person again, it was probably worth it.
13. If you tell the truth, you don't have to remember anything.
14. Sex is like air. It's not important unless you aren't getting any.
15. Don't squat with your spurs on.
16. Some days you're the bug; some days you're the windshield.
17. Don't worry; it only seems kinky the first time.
18. Good judgment comes from bad experience, and a lot of that comes from bad judgment.
19. The quickest way to double your money is to fold it in half and put it back in your pocket.
20. A closed mouth gathers no foot.
21. Duct tape is like the Force. It has a light side and a dark side, and it holds the universe together.
22. There are two theories to arguing with women. Neither one works.
23. Generally speaking, you aren't learning much when your lips are moving.
24. Experience is something you don't get until just after you need it.
25. Never miss a good chance to shut up.
26. We are born naked, wet and hungry, and get slapped on our behind. Then things get worse.
27. Never, under any circumstances, take a sleeping pill and a laxative on the same night.
28. There is a fine line between "hobby" and "mental illness."
29. No matter what happens, somebody will find a way to take it too seriously.
30. There comes a time when you should stop expecting other people to make a big deal about your birthday...around age 12.
31. Everyone seems normal until you get to know them