Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a clobber?

Clang TargetInfo has a method called getClobbers:

Returns a string of target-specific clobbers, in LLVM format.

So, what is a clobber?

like image 649
sdgfsdh Avatar asked Jan 27 '17 17:01

sdgfsdh


People also ask

What is clobber slang for?

clobber in British English (ˈklɒbə ) noun. British slang. personal belongings, such as clothes and accessories. Word origin.

Why is clobber slang for clothes?

clobber (v.) British slang an identical word principally had to do with clothing, as in clobber (n.) "clothes," (v.) "to dress smartly;" clobber up "to patch old clothes for reuse, conceal defects" (1851). The source of these seems to have been 19c.

Where does the term clobber come from?

The word clobber was originally World War II British air force slang, in the 1940s, and usually referred to aerial bombing. Definitions of clobber. verb. beat thoroughly and conclusively in a competition or fight.

Is clobber another word for clothes?

You can refer to someone's possessions, especially their clothes, as their clobber.


1 Answers

A clobbered register is a register which is trashed i.e. modified in unpredictable way by inline assembler. This usually happens when you need a temp. register or use particular instruction which happens to modify some register as a by-product.

Usually programmer explicitly declares registers which are clobbered by his inline asm code but some may be considered to be trashed by default and that's where getClobbers come into play.

getClobbers returns empty result for most targets. On MIPS GCC has historically not used $1 in generated code so most programmers didn't bother to declare it as clobbered. To reduce portability costs, LLVM considers $1 to be always clobbered in inline asm. Another example is arithmetic flags register (cc) which is considered to be always clobbered by inline asm by GCC on i386 and x86_64 targets.

like image 100
yugr Avatar answered Oct 11 '22 21:10

yugr