Lack of bit field instructions in x86 instruction set because of patents ?
Mar 06, 2009 315 Replies
S
Skybuck Flying
Hello,
I have a question for you:
Can the lack of bit field instructions in the x86 instruction set be explained by patents held by other cpu designers like motorola ?
Or is there another reason why x86 instruction set is missing bit field instructions ?
Bye, Skybuck.
Didn't find your answer? Ask the community — no account required.
G
Glen Herrmannsfeldt
The 8008 didn't have them.
The 8080 was designed as an extended 8008. The 8086 was the 8080 extended to 16 bits.
Also, you can do bit operations with AND and OR instructions.
-- glen
J
JJ
What kind of bit field instruction(s) is lacking?
S
Skybuck Flying
See motorola processor or nec processor.
InsertBits, ExtractBits, stuff like that ;)
Bye, Skybuck.
S
Skybuck Flying
Yes but only one 8, 16, 32 bits all at once at fixed positions.
To manipulate only a few of those bits requires using masks, shifting, and-ing, not-ing, or-ing, xor-ing etc.
Which can become quite a lot of instructions to do something "relatively simply" like "insert" a few bits into some memory bit location.
(I wouldn't call it insert though... just "move/copy bits into a memory bit location/offset".
A single clock/cycle instruction would be nice.... (or 1 latency in current terms ;))
Bye, Skybuck.
R
Robert Baer
HAY! I will have you know that the cows are *NOT* missing bits in the field!
H
Harold Aptroot
So that means that BT, BTC, BTR and BTS were not sufficient? Your bitfields must be larger?
K
Ken Hagan
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.)
A
Alexei A. Frounze
d
it
nt
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.
Alex
M
MooseFET
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
L
lavron
d
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
where "b" represents a zero or one bit.
J
Jacko
Hi
Z80B, what a large chip, you lucky, lucky man. 6502 or even
formatting link
cheers jacko
J
John Larkin
Because the 4004 didn't have them.
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.
John
K
krw
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.
M
MitchAlsup
No
Barcelona (AMD) introduced 5 (or was it 7) bit manipulation instructions.
Mitch
J
John Larkin
Yeah, tragic mistakes, selecting Intel and Microsoft. It could have been Motorola and DR.
John
K
krw
Wouldn't have been Motorola, but ignoring DR was an oversight.
S
Skybuck Flying
Here is an example of what a motorola processor presumeably does with one instruction:
function KeepLowBits( Value : longword; Bits : longword ) : longword; inline; begin Result := Value; // 32 bits case. if Bits
S
Skybuck Flying
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 ! ;)
Bye, Skybuck =D
R
robertwessel2
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.
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.