Certainly not, since bit-fields are both obvious and have been implemented in a variety of machines for the past 50 years or so.
They aren't worth it. On the few occasions when you need the facility, a mask and shift takes just two more instructions. (For comparisons or arithmetic on similar bit-fields, you can even omit the shift step.)
Rotate through carry may be used to insert and delete single bits. If you need many, then you either loop or use masks and all. SHLD/SHRD may be helpful too, btw.
I think the reason why you don't see such advanced instructions on old or primitive processors is because they're old and primitive. You should feel lucky to have (I)MUL and (I)DIV. :) When I began to program in ASM on Z80 (enhanced i8080) I didn't have this luxury. Also, the CPU ran at only about 3 MHz and instructions took several clocks. So, shifts, adds, LUTs -- all came handy.
If it really was the 8080 extended to more bits it would have been a better processor. You would have been able to address 32 bits with two 16 bit registers and not have to wait for a trip through the ALU on every memory operation.
The 8086 also had the "test" instruction to do an AND but not store the results
Could you please explain why, in your opinion, instructions such as the following 8 bit instructions as well as the respective 16 and 32 bit do not fit the bill?
OR AL,bbbbbbbbB AND AL,bbbbbbbbB XOR AL,bbbbbbbbB TEST AL,bbbbbbbbB
x86 is an entirely brain-damaged architecture. It's a good thing that Intel has superb process technology and zero business ethics, otherwise x86 would be a long-forgotten joke.
In article , snipped-for-privacy@highNOTlandTHIStechnologyPART.com says...>
If IBM hadn't selected the 8088 for the original IBMPC (and then bailed their asses out of a huge financial hole), Intel wouldn't have had time to perfect its zero business ethics.
That doesn't stop people from filing patents on bit field instructions.
Maybe intel/amd is scared of law suits ?
This will work up to a certain point... mostly when it's possible to shift-or bits into single memory cell or registers.
As soon as multiple memory cells have to be overwritten things can get quite nasty... especially if bits need to be preserved...
So I don't agree with you.
A simple example where "extract bits" instruction could be usefull is for huffman decompression... where huffman codes can have a number of variable bit fields stuck next to each other.
Extracting those bit fields (huffman codes) requires multiple x86 instructions, which slows down the huffman decoder.
A single instruction to do that would be preferred and would probably/possibly give higher decoding speed and this is just one but an important example ! ;)
And the original (A stepping) '386 had Insert Bits and Extract Bits instructions. Apparently Intel needed the microcode space, and pulled them in the B steppings.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.