Archive

Posts Tagged ‘processor’

Designing a processor for increased source portability costs

February 9th, 2010 Derek-Jones 4 comments

How might a vendor make it difficult for developers to port open source applications to their proprietary cpu? Keeping the instruction set secret is one technique, another is to design a cpu that breaks often relied upon assumptions that developers have about the characteristics of the architecture on which their code executes.

Of course breaking architectural assumptions does not prevent open source being ported to a platform, but could significantly slow down the migration; giving more time for customers to become locked into the software shipped with the product.

Which assumptions should be broken to have the maximum impact on porting open source? The major open source applications (e.g., Firefox, MySQL, etc) run on 32/64-bit architectures that have an unsigned address space, whose integer representation uses two’s complement arithmetic and arithmetic operations on these integer values wrap on over/underflow.

32/64-bit. There is plenty of experience showing that migrating code from 16-bit to 32-bit environments can involve a lot of effort (e.g., migrating Windows 286/386 code to the Intel 486) and plenty of companies are finding the migration from 32 to 64-bits costly.

Designing a 128-bit processor might not be cost effective, but what about a 40-bit processor, like a number of high end DSP chips? I suspect that there are many power-of-2 assumptions lurking in a lot of code. A 40-bit integer type could prove very expensive for ports of code written with a 32/64-bit mindset (dare I suggest a 20-bit short; DSP vendors have preferred 16-bits because it uses less storage?).

Unsigned address space (i.e., lowest address is zero). Some code assumes that addresses with the top bit set are at the top end of memory and not just below the middle (e.g., some garbage collectors). Processors having a signed address space (i.e., zero is in the middle of storage) are sufficiently rare (e.g., the Inmos Transputer) that source is unlikely to support a HAS_SIGNED_ADDRESS build option.

How much code might need to be rewritten? I have no idea. While the code is likely to be very important there might not be a lot of it.

Two’s complement. Developers are constantly told not to write code that relies on the internal representation of data types. However, they might be forgiven for thinking that nobody uses anything other than two’s complement to represent integer types these days (I suspect Univac does not have that much new code ported to it’s range of one’s complement machines).

How much code will break when ported to a one’s complement processor? The representation of negative numbers in one’s complement and two’s complement is different and the representation of positive numbers the same. In common usage positive values are significantly more common than negative values and many variables (having a signed type) never get to hold a negative value.

While I have no practical experience, or know of anybody who has, I suspect the use of one’s complement might not be that big a problem. If you have experience please comment.

Arithmetic that wraps (i.e., positive values overflow negative and negative values underflow positive). While expressions explicitly written to wrap might be rare, how many calculations contain intermediate values that have wrapped but deliver a correct final result because they are ‘unwrapped’ by a subsequent operation?

Arithmetic operation that saturate are needed in applications such as graphics where, for instance, increasing the brightness should not suddenly cause the darkest setting to occur. Some graphics processors include support for arithmetic operations that saturate.

The impact of saturation arithmetic on portability is difficult to judge. A lot of code contains variables having signed char and short types, but when they appear as the operand in a binary operation these are promoted to int in C/C++/etc which probably has sufficient range not to overflow (most values created during program execution are small). Again I am lacking in practical experience and comments are welcome.

Floating-point. Many programs do not make use of floating-point arithmetic and those that do rarely manipulate such values at the bit level. Using a non-IEEE 754 floating-point representation will probably have little impact on the portability of applications of interest to most users.

Update. Thanks to Cate for pointing out that I had forgotten to discuss why using non-8-bit chars does is not a worthwhile design decision.

Both POSIX and the C/C++ Standards require that the char type be represented in at least 8 bits. Computers supporting less than 8-bits were still being used in the early 80s (e.g., the much beloved ICL 1900 supported 6-bit characters). The C Standard also requires that char be the smallest unit of addressable storage, which means that it must be possible for a pointer to point at an object having a char type.

Designing a processor where the smallest unit of storage is greater than 8-bits but not a power-of-2 is likely to substantially increase all sorts of costs and complicate things enormously (e.g., interfaces to main memory which are designed to work with power of two interfaces). The purpose of this design is to increase other people’s cost, not the proprietary vendor’s cost.

What about that pointer requirement? Perhaps the smallest unit of storage that a pointer could address might be 16 or 40 bits? Such processors exist and compiler writers have used both solutions to the problems they present. One solution is for a pointer to contain the address of the storage location + offset of the byte within that storage (Cray used this approach on a processor whose pointers could only point at 64-bit chunks of storage, with the compiler generating the code to extract the appropriate byte), the other is to declare that the char type occupies 40-bits (several DSP compilers have taken this approach).

Having the compiler declare that char is not 8-bits wide would cause all sorts of grief, so lets not go there. What about the Cray compiler approach?

Some of the address bits on 64-bit processors are not used yet (because few customers need that amount of storage) so compiler writers could get around host-processor pointers not supporting the granularity needed to point at 8-bit objects by storing the extra information in ‘unused’ pointer bits (the compiler generating the appropriate insertion and extraction code). The end result is that the compiler can hide pointer addressability issues :-) .

Secret instruction sets about to make a come-back

January 28th, 2010 Derek-Jones 4 comments

Now it has happened Apple’s launch of a new processor, the A4, seems such an obvious thing to do. As the manufacturer of propriety products Apple wants to have complete control over the software that customers run on those products. Using a processor whose instruction set and electrical signals are not publicly available goes a very long way to ensuring that somebody else’s BIOS/OS/drivers/etc do not replace Apple’s or that the distributed software is not ‘usefully’ patched (Apple have yet to reveal their intentions on publishing instruction set details, this is an off-the-cuff prediction on my part).

Why are Apple funding the development of the LLVM C/C++ compiler? Because it enables them to write a back-end for the A4 without revealing the instruction set (using gcc for this purpose would require that the source be distributed, revealing the instruction set). So much for my prediction that Apple will stop funding LLVM.

The landscape of compute intensive cpus used to be populated with a wide variety of offerings from many manufacturers. The very high price of riding the crest of Moore’s law is one of the reasons that Intel’s x86 acquired such a huge chunk of this market; one by one processor companies decided not to make the investment needed to keep their products competitive. Now that the applicability of Moore’s law is drawing to an end the treadmill of continued processor performance upgrades is starting to fading away. Apple are not looking at a processor upgrade cycle, that they need to keep up with to be competitive, that stretches very far into the future.

Isn’t keeping an instruction set secret commercial suicide? The way to sell hardware is to make sure that lots of software runs on it and software developers want instruction set details (well ok, a small number do, but I’m sure lots of others get a warm fuzzy feeling knowing that the information is available should they need it). This is very much a last century view. The world is awash with an enormous variety of software, including lot of it very useful open source, and there is a lot more information available about the set of applications many customers want to use most of the time. Other than existing practice there is little reason why a manufacturer of a proprietary product, that is not a processor, needs to release instruction set details.

In the early 1980s I was at the technical launch of the Inmos Transputer and was told that the instruction set would not be published because the company did not want to be tied down to backwards compatibility. Perish the thought that customers would write assembler because the Inmos supplied compilers produced poor quality code or that a third party compiler would good enough to gain a significant market share. In marketing ability Inmos was the polar opposite of Apple. For a while HP were not very forthcoming on the instruction set behind their PA-RISC processor.

Will the A4 instruction set remain secret? On the whole, perhaps it can. The software based approaches to reverse engineering an instruction set require access to a compiler that generates it. For instance, changing a plus to a minus in one expression and looking for the small change in the generated executable; figuring out which status flags are set under which conditions is harder, but given time it can be done. Why would Apple release executable compilers if it wants to control the software that runs on the A4?

If the instruction set were cracked where would a developer go to obtain a compiler targeting the A4?

Given the FSF’s history with Apple I would not be surprised if there was a fatwa against support for a proprietary instruction set in gcc. I suspect Apple would frown very heavily on such support ever being in the standard llvm distribution. I could see Apple’s lawyers sending letters to anybody making available a compiler that generated A4 code.

In the past manufacturers have tried to keep processor instruction sets secret and found that commercial reality required them to make this information freely available. Perhaps in the long term, like Moore’s law, the publication of detailed instruction set information may just be a passing phase.

www.wenn.com
FireStats icon Powered by FireStatswww.tinynibbles.com cialis daily dosage pharmacy

cheapest viagra usa

canada viagra

overnight delivery viagra

discount propecia rx

lowest priced propecia

mail order propecia

cialis fast delivery usa

online generic cialis 100 mg

order cheap levitra

order levitra online

levitra online sales

canada propecia prescription

how much does cialis cost

once a day viagra

levitra next day delivery

buy propecia generic

cialis purchase

cialis quick shipment

levitra sales uk

cialis fast delivery

buy now propecia

buy cheap levitra

ordering cialis gel

cheap levitra

cialis to buy

cheap levitra tablets

canadian propecia rx

buying levitra online

cheap cialis

canadian online pharmacy cialis

buy cheap generic levitra

generic viagra made in usa

indian generic levitra

cialis on women

for sale levitra

online pharmacy propecia viagra

generic levitra purchase

canadian healthcare pharmacy

canada online pharmacy propecia

how to get cialis in canada

best price cialis

canadian viagra 50mg

buy levitra us

buy cialis in usa

herbal propecia

canada cheap propecia

cost levitra low

cialis prescription

cialis soft pills

buy cialis once daily

canadian healthcare viagra

indian cialis generic

generic propecia online pharmacy

buy viagra online cheap us

can i get viagra in mexico

cialis and ketoconazole

levitra now online

ordering propecia online

order prescription propecia

generic propecia for sale

buy viagra without prescription

cost of propecia

cheapest overnight cialis

lowest propecia 1 mg

i need to buy propecia

cialis delivered overnight

ganeric cialis

cialis 5 mg italia

cheap viagra canada or india

low cost levitra

generic propecia effective

lowest price propecia

low cost canadian viagra

levitra low price

cialis overnight delivery

buy generic propecia

brand name cialis overnight

buy cialis online uk

levitra online prescription

info levitra

cheap viagra online

buy levitra online viagra

cialis refractory

order cheapest propecia online

cialis 5 mg

generic propecia finasteride

online ordering propecia

overnight delivery cialis

buy branded viagra

cialis headaches

cheap propecia 5mg

buy cheap levitra online

cialis 100 mg generic

cialis uk

get levitra

brand cialis for sale

healthcare canadian pharmacy

levitra in canada

cialis buy overnight

china viagra

buy generic cialis

canadian drugs propecia

cheap discount levitra

cheapest propecia prescription

discount drug propecia

how much to buy viagra in pounds

cheap propecia uk

cialis woman

lowest cost levitra

cheapest propecia sale uk

buy canada levitra

buy fast propecia

buy propecia online prescription

canada meds viagra

lowest price propecia best

best price for generic cialis

cialis professional 20 mg

cheap prescription propecia

cialis by mail

generic propecia 5mg

cialis tablets

cheapest viagra online

buy propecia in the uk

buying online propecia

buy levitra online from canada

cheap cialis soft

natural viagra

online pharmacy propecia renova

online levitra

levitra pill

brand name cialis

generic viagra 100 mg

how much is viagra

levitra online us

generic cialis soft tabs

indian viagra

levitra 10mg

cialis discount

buy propecia prescriptions online

buy cheapest propecia

levitra cheap fast

cheap propecia no prescription

buy cialis cannada

5 mg original brand cialis

buy propecia online

buy 5 mg cialis

cialis daily in canada

cialis 100 mg

how much cialis

buy levitra online no prescription

levitra tabs

generic levitra overnight delivery

generic viagra online

cost of daily cialis

buy propecia without prescription

cialis profesional

getting cialis from canada

discount propecia online

canada viagra generic

cialis price

discount us propecia

discount levitra online

buy viagra

cialis no prescription

order generic levitra

buy propecia on line

levitra for sale

levitra viagra online

cialis vs levitra

canadian viagra and healthcare

buying cialis soft tabs 100 mg

lowest price levitra

cheap levitra uk

levitra where to buy

cheap fast levitra

order cheap propecia

discount levitra purchase

online propecia prescriptions

5 mg daily cialis

buying cialis

cheap levitra without prescription

order propecia

cialis price in canada

fda levitra

cialis cheap

once daily cialis

generic levitra online

buy generic viagra india rx

buying viagra in canada

lowest propecia prices in canada

levitra mail order

buy viagra china

levitra order prescription

buy viagra online

buy cialis online canada

buy viagra mexico

best viagra

cialis in mexico

cheapest viagra

buy cheap generic propecia

buy propecia online pharmacy

buying generic propecia

low cost propecia

buy viagra germany canadian meds

buy cialis for daily use

online cialis

discount propecia propecia

cheap canadian viagra

cialis online

generic propecia sale

get cialis

buy propecia canada

buy propecia now

buying cialis next day delivery

cheap viagra from uk

cialis tablets foreign

obtain viagra without prescription

levitra cost

cialis from mexico

low price levitra

buy online prescription propecia

brand viagra over the net

cheap propecia online prescription

cialis from canada

indian cialis

buy real cialis

buy cialis without prescription

buying propecia online

best price propecia

buy prescription propecia without

cialis strenght mg

cheap cialis from india

buy levitra vardenafil

lowest propecia prices

buying generic cialis mexico rx

mexico pharmacy cialis

levitra online

cialis professional 100 mg

buy generic levitra

levitra buy online

buy levitra uk

brand viagra professional

cialis en mexico

canada viagra pharmacies scam

generic viagra india

lowest price for propecia

levitra online no prescription

cheapest prices for viagra

next day viagra

canadian pharmacies cialis

cost of viagra

buy cialis usa

discount cialis india

buy cialis fedex shipping

buy propecia cheap

get propecia online pharmacy

canadian viagra india

discount levitra rx

levitra discount

get levitra online

generic propecia fda approved

mail order levitra

generic levitra vardenafil

daily dosage cialis

cialis generic 100 mg

cialis transdermal

cialis next day delivery

best price levitra

best price generic propecia

generic cialis sale

canadian viagra

genuine cialis pills

canada online pharmacy levitra

hydrochlorothiazide cialis

levitra in india

buy propecia where

how to buy cialis in canada

buy cialis 5 mg

does generic cialis work

next day delivery cialis

online cheap viagra

cialis price 100 mg

cialis alternative

generic viagra canada

how to get viagra

name brand cialis

mexico levitra

generic viagra made in india

cheap order prescription propecia

cialis and diarrhea

lowest price on non generic levitra

how strong is 5 mg of cialis

combine cialis and levitra

generic cialis next day shipping

get cialis online

gele viagra

cheap propecia online

canadian healthcare

cialis one a day