flat assembler
Message board for the users of flat assembler.

Index > Main > why not exist caddne ?

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1865
Roman 21 Jan 2025, 09:54
in x86 exist asm instruction cmovne or cmovb.
Why not exist caddne or caddb or cadda ? Its so logical.
Code:
             cmp dl,0x39 ;if dl >'9' than add dl,7. This for hex text number.
             cadda dl,7
             cmp dh,0x39
             cadda dh,7    


Last edited by Roman on 21 Jan 2025, 19:41; edited 1 time in total
Post 21 Jan 2025, 09:54
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1051
Location: Russia
macomics 21 Jan 2025, 11:15
This is not a question about our salary. Ask Intel/AMD.
Post 21 Jan 2025, 11:15
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20481
Location: In your JS exploiting you and your system
revolution 21 Jan 2025, 12:11
Post 21 Jan 2025, 12:11
View user's profile Send private message Visit poster's website Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 754
Ali.Z 21 Jan 2025, 19:22
perhaps one day he will work at intel and implement these instructions as undocumented for his own use.

_________________
Asm For Wise Humans
Post 21 Jan 2025, 19:22
View user's profile Send private message Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1865
Roman 22 Jan 2025, 06:07
And not exist cmove dl,al.
Crazy things.

Code:
             mov ax,dx
             add ax,0x0707

             cmp dl,0x39 ;for hex text number.
             cmova dl,al
             cmp dh,0x39
             cmova dh,ah 
    
Post 22 Jan 2025, 06:07
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2582
Furs 22 Jan 2025, 17:37
Roman wrote:
And not exist cmove dl,al.
Crazy things.

Code:
             mov ax,dx
             add ax,0x0707

             cmp dl,0x39 ;for hex text number.
             cmova dl,al
             cmp dh,0x39
             cmova dh,ah 
    
Instructions take bytes to encode, bloating them up with unnecessary bits and opcodes.
Post 22 Jan 2025, 17:37
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20481
Location: In your JS exploiting you and your system
revolution 23 Jan 2025, 06:07
If one wanted to speculate, then I assume that Intel/AMD have certainly considered such instructions.

Creating new encodings for new instructions doesn't appear to be a problem. As evidenced by all the new instruction being added on a regular basis.

Perhaps the "real" reason is that the existing batch of HLL compilers wouldn't be able to make good use of such instructions, thus making them "useless" for most people? And the few people that could find them useful (i.e. asm coders) are an insignificant portion of the whole?

Compare to ARM, where almost all of the 32-bit instructions can be predicated upon a condition. But in the 64-bit encodings almost none of the instructions can be predicated. I have no doubt it was studied and discovered that "wasted" predicate bits could be better used for other purposes (e.g. more registers). At least as far as HLLs go. Manual assembly could make much better use of them, but since "no one" programs raw assembly anymore, then the manufacturers don't consider it a high priority.

Anyhow, just speculation. For a definitive answer, ask Intel/AMD. Razz
Post 23 Jan 2025, 06:07
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1865
Roman 23 Jan 2025, 13:34
I thinking Intel might be created 30 user asm instructions.
And mechanism(several Special asm commands) to upload microcode to this instructions.
And any programer could created owned asm command.


Last edited by Roman on 23 Jan 2025, 13:40; edited 1 time in total
Post 23 Jan 2025, 13:34
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20481
Location: In your JS exploiting you and your system
revolution 23 Jan 2025, 13:38
Anything microcoded would be "slow", so you probably won't like it. Better to just use those highly optimised "fast" native instructions.
Post 23 Jan 2025, 13:38
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1865
Roman 23 Jan 2025, 13:50
Quote:
"fast" native instructions

This instructions Hardware and not be modified?
Like as microcode.
Post 23 Jan 2025, 13:50
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2582
Furs 23 Jan 2025, 15:35
revolution wrote:
Creating new encodings for new instructions doesn't appear to be a problem. As evidenced by all the new instruction being added on a regular basis.
Those are specialized instructions for the most part.

In this case you can easily do it by re-arranging the code with other instructions so what's the point in bloating up the encoding for no benefit (actually less instruction cache so likely worse)?
Post 23 Jan 2025, 15:35
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20481
Location: In your JS exploiting you and your system
revolution 24 Jan 2025, 04:36
Furs wrote:
In this case you can easily do it by re-arranging the code with other instructions so what's the point in bloating up the encoding for no benefit (actually less instruction cache so likely worse)?
And those are precisely the kinds of reasons that Intel/AMD will consider before adding new instructions. At least that is my impression, I don't think they are stupid, they will probably have many other considerations that someone like me didn't even realise would factor into it.
Post 24 Jan 2025, 04:36
View user's profile Send private message Visit poster's website Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1865
Roman 24 Jan 2025, 12:11
I don't think so.
For example exist asm commands like dpps dot product and fpu load 1.0 fld1 and very powerful command nop.
No problem write code without this instructions.
Intel/amd beter created cross product one asm Sse instruction more good than dpps.

Intel created several Avx512 good instructions, but for busines sector. In avx2 this instructions not exist.
This suggests that Intel is more interested in making money than helping a simple programmer or user.
Post 24 Jan 2025, 12:11
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1051
Location: Russia
macomics 24 Jan 2025, 16:03
Roman wrote:
very powerful command nop.
The nop command is not on its own. This is just a convention that closes the xchg eax, eax command.

reg
90h = 10010000b = xchg eax, eax = nop
91h = 10010001b = xchg eax, ecx
...
Post 24 Jan 2025, 16:03
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20481
Location: In your JS exploiting you and your system
revolution 24 Jan 2025, 16:07
macomics wrote:
90h = 10010000b = xchg eax, eax = nop.
On 64-bit CPUs 0x90 is a real nop, and doesn't do "xchg eax,eax", because otherwise that would zero the upper bis of rax.
Post 24 Jan 2025, 16:07
View user's profile Send private message Visit poster's website Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 2582
Furs 24 Jan 2025, 17:34
Roman wrote:
I don't think so.
For example exist asm commands like dpps dot product and fpu load 1.0 fld1 and very powerful command nop.
"powerful" commands taking a lot of bytes to encode are fine (dot product), but fld1 is optimized for small encoding. x87 was optimized for using very few bytes at encoding the instructions. Back in the day, it was a huge issue. That's why it uses a stack of registers.

That ship has sailed long ago, those opcodes are taken for a long, long time already. Forget about using them. Razz
Post 24 Jan 2025, 17:34
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.