锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
PS: 緲昏瘧鑳藉緢濂界殑璁粌涓涓漢鐨勮嫳璇拰姹夎鍙ュ瓙緇勭粐鑳藉姏錛屾椂涓嶆椂鐨勮瀛﹁嫳璇殑濞冨皾璇曚竴涓嬬炕璇戣嫳璇鏂囦篃綆楁槸鏌愮閿葷偧鍚с?/span>
鏈變附瀹夊縐戞櫘鍏?/span>(鍑虹敓浜?/span>1954騫?/span>10鏈?/span>10鏃?/span>)錛屽鍚庡悕瀛楁湵涓藉畨濞滆開鎷夛紝鏄竴涓痙鍥?/span>-縐橀瞾鍝轟鉤鍔ㄧ墿瀛﹀銆傚ス鏄?/span>1971騫村叞钀?/span>508鑸彮絀洪毦鐨勫敮涓騫稿瓨鑰咃紝絀洪毦鍙戠敓鍚庣嫭鑷竴浜哄湪浜氶┈閫婄儹甯﹂洦鏋楃敓媧諱簡11澶┿備粬浠?/span>3000綾?/span>(9843鑻卞昂)鍧犺惤錛岃惤鍦版椂浠嶇劧琚畨鍏ㄥ甫鎹嗗湪搴ф涓娿?br />
浜嬪墠
鏈變附瀹夊浜?/span>1954騫村嚭鐢熶簬縐橀瞾鍒╅┈錛岀埗姣嶉兘鏄湪鍒╅┈鑷劧鍘嗗彶鍗氱墿棣嗗伐浣滅殑寰峰浗浜恒傚ス鏄敓鐗╁瀹舵眽鏂▉寤夌鏅厠鍜岄笩綾誨瀹剁帥涓戒簹縐戞櫘鍏嬬殑鍞竴瀛╁瓙銆傚湪鏈變附瀹夊14宀佹椂錛屽叾鐖舵瘝甯﹀ス鍘諱簹椹婇洦鏋楀緩閫犵爺絀跺熀鍦?/span>--娼樺彜閭c傚湪榪欓噷濂規垚浜嗕竴涓?#8220;涓涙灄瀛╁瓙”錛屽浜嗛噹澶栫敓瀛樻妧鑳姐傛暀鑲插綋灞涓嶅悓鎰忚繖鏍峰仛錛岃姹傛湵鑾夊畨濞滃洖鍒板埄椹簹鍘嗗北澶у啹媧牎寰鋒剰蹇楀鏍″弬鍔犺冭瘯銆傚ス浜?/span>1971騫?/span>12鏈?/span>23鏃ュ湪姝ゆ牎姣曚笟銆?br />
絀洪毦
鏈變附瀹夊縐戞櫘鍏嬪湪緇忓巻紓ㄩ毦涓婃湁鍙岄噸鐢熷瓨鏁呬簨鍙緵璁茶堪銆傚湪1971騫村湥璇炶妭鍓嶅錛屾湵涓藉畨濞滄惌涔樹簡鍏拌惃508鑸彮銆傞偅鏃跺ス鍒氫粠楂樹腑姣曚笟錛屽ス鐨勬瘝浜茬帥涓戒簹鏈墦綆楀湪1971騫?/span>12鏈?/span>19-20鏃ュ甫鐫濂沖効鍘繪綐鍙ら偅錛屼絾鏄湵涓藉畨濞滃笇鏈涜兘鍦?/span>12鏈?/span>23鏃ュ幓鍒╅┈鍙傚姞姣曚笟鍏哥ぜ銆傜帥涓戒簹鍚屾剰錛屾墦綆楀湥璇炶妭鍓嶅鍐嶉寰娼樺彜閭o紝鍙槸闄や簡閲屽凹鎬濆悰鐗規鑸┖(鍏拌惃)榪樻湁絀轟綑鍏朵綑鎵鏈夎埅鐝殑甯綅鍧囧凡鍞絼銆傚敖綆′笀澶眽鏂▉寤夊己鐑堣姹傚瀛愪笉瑕佷箻鍧愰偅瀹惰埅絀哄叕鍙哥殑鑸彮錛屽洜涓鴻鑸┖鍏徃鏃╁凡鑷悕鏄憲錛屼絾鏈緇堝ス浠繕鏄瀹氫簡鏈虹エ銆傞鏈鴻搗椋炰笉涔呴伃閬囬棯鐢碉紝鍦ㄧ┖涓紑濮嬭В浣撳茍涓澶村啿鍚戝湴闈€傛湵涓藉畨濞滃彂鐜拌嚜宸變竴鐩磋鎹嗗湪搴ф涓婏紝涓嬭惤灝嗚繎2鑻遍噷鏈緇堣惤鍏ョ椴佺儹甯﹂洦鏋椼?/span>
鍦ㄦ湵涓藉畨濞滅鏅厠鐨勬嬈′簨浠朵笂錛屼笓瀹舵寚鍑虹敱浜庡湪涓嬮檷涓ス琚畨鏀懼埌搴ф涓婃墠瀵艱嚧濂規椿浜嗕笅鏉ワ紝鍙槸鏂簡閿侀鑰屽凡銆傚ス鏄鑸彮鐨勫敮涓騫稿瓨鑰咃紝欏虹潃婧祦鍦ㄩ洦鏋楅噷鐢熸椿浜?/span>11澶┿?/span>
鍦ㄥス閱掕繃鏉ュ悗涓涙灄閲岀殑鏄嗚櫕涓嶅啀鍙挰濂癸紝鍙槸铔嗗凡緇忔劅鏌撲簡濂圭殑鑳寵唺錛?/span>9澶╁悗錛屽ス鎵懼埌浜嗕竴澶勯湶钀ュ湴銆傚湪姝わ紝濂圭粰鑷繁榪涜浜嗗垵綰ф不鐤楋紝渚嬪鐢ㄦ苯娌規祰鍒拌泦鎰熸煋鐨勯儴浣嶃傝泦瀹蟲曟苯娌瑰氨紱誨紑浜嗕激鍙c傚嚑涓皬鏃跺欏悗錛岃繍鏈ㄥ伐浜哄彂鐜頒簡濂癸紝緇欎笌鍩烘湰鍖葷枟騫舵妸濂瑰甫鍒版洿瀹滃眳鐨勫尯鍩燂紝鐒跺悗濂硅絀鴻繍鍒板尰闄€?/span>
浼ゅ彛鎭㈠鍚庯紝鏈變附瀹夊甯姪鎼滄晳闃熷畾浣嶅け浜嬪湴鐐瑰拰鎼滄晳姝婚毦鑰呭案浣撱傚ス濡堝鐨勫案浣撲簬1972騫?/span>1鏈?/span>12鏃ヨ鍙戠幇銆傛湵涓藉畨濞滃洖鍒板痙鍥藉悗浼ゅ彛瀹屽叏鎭㈠浜嗘甯搞傝窡鐖舵瘝綾諱技錛屾湵涓藉畨濞滆幏寰楃敓鐗╁瀛︿綅鍚庤繑鍥炵椴佺戶緇繁鍏ョ爺絀惰潤铦犮傚ス鐨勫弻閲嶇敓瀛樻晠浜嬫垚浜嗕功鍜岀數褰辯殑涓諱綋錛屽叾涓寘鎷簡濂圭殑鑷紶鍜屼粬浼狅紝“褰撴垜浠庡ぉ鑰岄檷”錛屼互鍙婂婕旀矁綰寵但灝斾綈鏍肩殑綰綍鐗?#8220;緲呰唨涓婄殑甯屾湜”銆備粬(娌冪撼璧皵浣愭牸)鍦?/span>1971騫翠篃棰勫畾浜嗗ス(鏈變附瀹夊)鐨勯偅嬈¤埅鐝紝椋炴満璧烽鍓嶆渶鍚庝竴鍒嗛挓鏀瑰彉璁″垝錛屼粠鑰岃翰榪囦竴鍔?br />
浜嬪悗
鏈變附瀹夊鐨勪莖騫稿瓨媧繪垚浜嗗悇縐嶇瀻鐚滄帹鏂殑涓婚銆?寰堟槑鏄懼ス琚畨鍏ㄥ甫鎹嗗湪搴ф涓婃湁浜嗘煇縐嶇▼搴︾殑鐩劇墝鍜岀紦鍐詫紝鑰屼笖鐞嗚涓婂鍥存暣鎺掔殑搴ф錛屽氨鏄湵涓藉畨濞滀袱杈圭殑閭d簺錛岃搗鍒頒簡闄嶈惤浼炵殑浣滅敤錛屽噺緙撲簡濂逛笅钀界殑閫熷害..."銆?#8220;椋庢毚婕傜Щ浠ュ強钀藉湴鐐瑰帤鍘氱殑鏋濆彾鍙互榪涗竴姝ラ檷浣庨噷鍐插嚮鍔?..”銆?/span>
鏈變附瀹夊鍥炲埌寰峰浗褰誨簳搴峰榪囨潵錛岃蛋浜嗙埗姣嶄竴鏍風殑璺紝鍦ㄥ熀灝斿ぇ瀛﹀涔犵敓鐗╋紝1980騫存瘯涓氥傚湪鎱曞凹榛戦害鍏嬭タ綾沖叞澶у鑾峰緱鍗氬+瀛︿綅鍚庤繑鍥炲埌縐橀瞾灞曞紑鍝轟鉤鍔ㄧ墿鐮旂┒錛屼笓娉ㄤ簬铦欒潬錛屽湪1987騫村彂琛ㄨ鏂囷紝“縐橀瞾鐑甫闆ㄦ灄閲屼竴涓潤铦犵敓鐗╃帇鍥界殑鐮旂┒”銆?/span>1989騫存湵鑾夊畨濞滅鏅厠鍜屼竴涓笓娉ㄤ簬鐮旂┒瀵勭敓榛勮渹鐨勬槅铏瀹惰壘鍔涘厠榪媺緇撳銆?/span>2000騫存湵涓藉畨濞滄帴綆′簡娼樺彜閭e綋涓婁簡涓諱換錛岀埗浜插幓涓栦簡銆?/span>
鐜板湪鏈變附瀹夊榪媺鍦ㄦ厱灝奸粦宸翠紣鍒╀簹鍔ㄧ墿瀛﹁拹钘忕爺絀朵腑蹇冨綋綆$悊鍛樸傚ス鐨勮嚜浼犲拰浠栦紶”褰撴垜浠庡ぉ鑰岄檷”(寰瘋: Als ich vom Himmel fie)浜?/span>2011騫?/span>3鏈?/span>10鏃ョ敱媧劇弨鏋楁牸鍑虹増錛屼負姝ゅス鑾峰緱浜?/span>2011鏌惓鏂囧濂栥?/span>2019騫寸椴佹斂搴滄巿浜堝ス楂樼駭鍐涘畼鐨勬澃鍑烘湇鍔″銆?br />
Stride is an important concept in digital image processing. It allows performing several operations with an image in a very fast manner (in constant time) by simple modification of image metadata. If you are interested in finding out what stride is and how to use it stick with us.
Pixel representation in a computer memory
Before we dive into the concept of stride we first need to revise how digital images are stored in a computer memory. We will start from a pixel.
An image pixel is represented in a computer memory by a fixed number of bits. Typical pixel bit depth (amount of bits per pixel) is 32, 16, 8 or, for binary images, 1 bit. In typical RGB images, 8 bits are often used to store the color value of a single channel. Thus, the total bit depth of one pixel is 24. Processing 32 and 16-bit chunks of data is simple and effective on a typical 32 and 64-bit processors. Therefore, the pixels are stored in the format of 32 bits, where the older (or younger, depending on the implementation) 8 bits remain unused. Such an approach to storing pixels requires more memory, but it allows speeding up image processing by using the standard size of the machine word. Thus, a standard RGB image occupies 32 bits in memory and has a depth of 24 bits. We will call another 8 bits necessary to supplement the size of the memory occupied by a pixel to the value of a multiple of degree 2, pixel padding. The total number of bytes occupied by a pixel in memory is called pixel stride (See Image 1).
Image representation in a computer memory
Images are stored in computer memory pixel-by-pixel, line by line. The upper left corner of the image is usually chosen as a coordinate origin (the upper left pixel of the image has the index [0, 0]). The image is stored in memory as a one-dimensional array. Pixels of the first line of the image are first written to the memory, then pixels of the second line and so on up to the last line. Each line in addition to the pixel bytes may also contain additional bytes — line padding. Additional bytes usually do not contain useful information and do not affect the visualization of an image when, for example, displayed on the screen. These additional bytes serve to complement a line, which is necessary for more efficient image processing and is caused by the specificity of the hardware used. For example, Cairo (a popular open source vector graphics software library) requires alignment of rows to multiple 4 bytes, which allows for more efficient image processing algorithms using vectorized processor operations and processing several image pixels simultaneously.
Introducing the term of line padding requires to introduce another closely coupled term — line stride.
Line stride (increment, pitch or step size) is the number of bytes that one needs to add to the address in the first pixel of a row in order to go to the address of the first pixel of the next row. It is important to note that an image width is measured in pixels and describes an image itself (and doesn’t depend on how an image is stored in a computer memory). In contrast, a line stride depends on how an image is represented in memory and is measured in bytes.
In program source code, an image is usually represented by a data structure containing metadata (image width and height, line stride, number of channels, encoding type, etc.), as well as a pointer to the address of the first image pixel in memory (further we will refer to this address as data_begin). This information allows us to unambiguously read and decode an image from memory, as well as to perform a series of fast image operations by changing only a metadata associated with an image.

An image representation in a computer memory. Lines of an image are stored one by one in one-dimensional array.
Image operations:
Let’s summarize all the terms which we introduced to this moment:
pixel_address — a pixel address in memory
pixel depth —the number of bits per pixel (containing valuable information)
pixel_stride — the number of bytes occupied in memory by a pixel of an image
data_begin — the address of the first image pixel in memory
channels — the number of image channels (3 for an RGB-image)
channel_address — the address of a particular pixel channel in memory
height — the image height in pixels
width — the image width in pixels
line_stride — the number of bytes occupied in memory by a line of an image
Operations:
1. Computing pixel address in memory
The equation relating pixel memory address to its coordinates [y, x] in the image coordinate system can be represented as:
pixel_address = data_begin + y * line_stride + x * pixel_stride, (1)
where data_begin — the address of the first image pixel in memory.
Equation (1) is used whenever you access an image in memory. In the rest of operations, presented in this post, we will only change a metadata associated with an image and assume, that the equation (1) is applied after in order to access image.
2. Pixel decoding (for RGB image with an equal amount of bits per channel):
channel_address = pixel_address + n * depth / channels, (2)
where n is a channel index: n = 0, 1, …, channels — 1. Thus, for instance, for the typical RGB-image with an equal amount of bits per channel, a channel address in memory can be computed as follows:
R = pixel_address,
G = pixel_address + depth / channels,
B = pixel_address + 2 * depth / channels.
It is important to note that these equations depend on the type of the image stored. There are formats in which different number of bytes is used to store different channels.
3. Image flip
3.1 Vertical flip
data_begin = data_begin + (height- 1) * line_stride ,
line_stride = -line_stride.

Pointer to the first image pixel for the vertical flip
The negative line stride being inserted into equation (1) allows us to move upwards reading (or visualizing) an image from the last row to the first, thus, realizing vertical flip.
3.2 Horizontal flip
data_begin = data_begin + (width — 1) * pixel_stride ,
pixel_stride = -pixel_stride.

Pointer to the first image pixel for the horizontal flip
In the same manner as with negative line stride in the previous example, the negative pixel stride here allows us to move from right to left and to read (or visualize) an image flipped horizontally.
3.3 Vertical and horizontal flip
The combination of previous two approaches allows to flip an image in both directions at once:
data_begin = data_begin + (height-1) * line_stride + (width-1) * pixel_stride,
line_stride = -line_stride,
pixel_stride = -pixel_stride.

Pointer to the first image pixel for the simultaneous vertical and horizontal flip
4. Extracting image subwindow
data_begin = new_data_begin,
width = new_width,
height = new_height.
With this approach we set a new origin of our image (inside a boundary of the original image) and set a width and height which basically tell us how many time we should apply an equation (1) to read all pixels (width x height) and after which amount of pixels read we should increase the y coordinate (to start reading pixels of the next row). Note that such parameters as line stride remain unchanged.
5. Extracting single image channel
To extract a single image channel we can use a combination of equations (1) and (2):
pixel_address = data_begin + y * line_stride + x * pixel_stride + n * depth / channels,
where n — channel index, n = 0, 1, …, channels — 1.
REFERENCES
1. A programmer’s view on digital images: the essentials: https://www.collabora.com/news-and-blog/blog/2016/02/16/a-programmers-view-on-digital-images-the-essentials/
2. Microsoft Media Foundation Programming Guide: Image Stride:Image Stride When a video image is stored in memory, the memory buffer might contain extra padding bytes after each row of pixels…docs.microsoft.com
3. Wikipedia: Stride of an array: https://en.wikipedia.org/wiki/Stride_of_an_array
4. Cairo library: https://cairographics.org/




A PDF describes the content and appearance of one or more pages. It also contains a definition of the physical size of those pages. That page size definition is not as straightforward as you might think. There can in fact be up to 5 different definitions in a PDF that relate to the size of its pages. These are called the boundary boxes or page boxes:
· The MediaBox is used to specify the width and height of the page. For the average user, this probably equals the actual page size. For prepress use, this is not the case as we prefer our pages to be defined slightly oversized so that we can see the bleed (Images or other elements touching an outer edge of a printed page need to extend beyond the edge of the paper to compensate for inaccuracies in trimming the page), the crop marks and useful information such as the file name or the date and time when the file was created. This means that PDF files used in graphic arts usually have a MediaBox which is larger than the trimmed page size.
· The CropBox defines the region that the PDF viewer application is expected to display or print. So if a PDF contains a CropBox definition, Acrobat uses it for screen display and printing. For prepress use, the CropBox is pretty irrelevant. The GWG industry association recommends not to use it at all.
· The TrimBox defines the intended dimensions of the finished page. Contrary to the CropBox, the TrimBox is very important because it defines the actual page size that gets printed. The imposition programs and workflows that I know all use the TrimBox as the basis for positioning pages on a press sheet. By default the TrimBox equals the CropBox.
· The BleedBox determines the region to which the page contents needs to be clipped when output in a production environment. Usually the BleedBox is 3 to 5 millimeters larger than the TrimBox. It is nice to know the size of the BleedBox but it isn’t that important in graphic arts. Most prepress systems allow you to define the amount of bleed yourself and ignore the BleedBox. By default the BleedBox equals the CropBox.
· The ArtBox is a bit of a special case. It was originally added to indicate the area covered by the artwork of the page. It is never used for that but can be handy in a few cases:
· On a PDF page that contains an advertisement, the ArtBox can be used to define the location of that ad. This allows you to place that PDF on another page but only use the area covered by the advert.
· A more common use of the ArtBox is as a means to indicate the safety zone. When creating a poster that will be placed in a lightbox, the designer must make sure text and logo’s aren’t positioned too close to the edge. If the poster is not mounted properly, this could cause that text or logo to disappear behind the frame of the lightbox. In book design, there is also a margin where you cannot put text because the binding might make it difficult to read text that is too close to the spine. The area where it is safe to place graphic elements is called the safety zone or text safe area. The ArtBox can be used to indicate the dimensions of this part of the page.

General rules regarding page boxes
· Each page in a PDF can have different sizes for the various page boxes.
· The page boxes are always rectangular. That may seem logical but artwork is not always rectangular: a PDF can represent an oval label or the foldout of a cardboard box.
· A PDF always has a MediaBox definition. All the other page boxes do not necessarily have to be present in regular PDF files.
· The above rule is not true for the PDF/X file formats:
· PDF/X-1a and PDF/X-3 compliant files need to include the MediaBox, TrimBox, and BleedBox.
· PDF/X-4 files need, next to the MediaBox, a TrimBox or an ArtBox, but not both. The ArtBox or TrimBox cannot be larger that the BleedBox. If a CropBox is present, the ArtBox, TrimBox, and BleedBox need to extend beyond its boundaries.
· The MediaBox is the largest page box in a PDF. The other page boxes can equal the size of the MediaBox but they are not expected to be larger (The latter is explicitly required in the PDF/X-4 requirements). If they are larger, the PDF viewer will use the values of the MediaBox.
BBox
Within PDF files there is another box, the bounding box or BBox, that is used. The bounding box is a rectangular frame that determines the dimensions of an object (such as a graphic, font or pattern) that is placed inside a PDF document. As such, this box has nothing to do with the page boxes.
Please send updates/corrections to predef-contribute.
| Type | Macro | Description |
|---|---|---|
| Identification | __alpha__ | Defined by GNU C |
| Version | __alpha_ev'V'__ | V = Version |
| Identification | __alpha | Defined by DEC C |
| Identification | _M_ALPHA | Defined by Visual Studio |
| CPU | Macro |
|---|---|
| Alpha EV4 | __alpha_ev4__ |
| Alpha EV5 | __alpha_ev5__ |
| Alpha EV6 | __alpha_ev6__ |
| Type | Macro | Description |
|---|---|---|
| Identification | __amd64____amd64__x86_64____x86_64 | Defined by GNU C and Sun Studio |
| Identification | _M_X64_M_AMD64 | Defined by Visual Studio |
Notice that x32 can be detected by checking if the CPU uses the ILP32 data model.
| Type | Macro | Description |
|---|---|---|
| Identification | __arm__ | Defined by GNU C and RealView |
| Identification | __thumb__ | Defined by GNU C and RealView in Thumb mode |
| Version | __ARM_ARCH_'V'__ | V = Version Defined by GNU C 1 |
| Identification | __TARGET_ARCH_ARM__TARGET_ARCH_THUMB | Defined by RealView |
| Version | __TARGET_ARCH_ARM = V__TARGET_ARCH_THUMB = V | V = Version |
| Version | __TARGET_ARCH_'VR' | VR = Version and Revision |
| Identification | _ARM | Defined by ImageCraft C |
| Identification | _M_ARM | Defined by Visual Studio |
| Identification | _M_ARMT | Defined by Visual Studio in Thumb mode |
| Version | _M_ARM = V | V = Version |
| Identification | __arm | Defined by Diab |
| CPU | Macro | _M_ARM |
|---|---|---|
| ARM 2 | __ARM_ARCH_2__ | |
| ARM 3 | __ARM_ARCH_3____ARM_ARCH_3M__ | |
| ARM 4T | __ARM_ARCH_4T____TARGET_ARM_4T | |
| ARM 5 | __ARM_ARCH_5____ARM_ARCH_5E__ | 5 |
| ARM 5T | __ARM_ARCH_5T____ARM_ARCH_5TE____ARM_ARCH_5TEJ__ | |
| ARM 6 | __ARM_ARCH_6____ARM_ARCH_6J____ARM_ARCH_6K____ARM_ARCH_6Z____ARM_ARCH_6ZK__ | 6 |
| ARM 6T2 | __ARM_ARCH_6T2__ | |
| ARM 7 | __ARM_ARCH_7____ARM_ARCH_7A____ARM_ARCH_7R____ARM_ARCH_7M____ARM_ARCH_7S__ | 7 |
| Type | Macro | Description |
|---|---|---|
| Identification | __aarch64__ | Defined by GNU C 1 |
| Type | Macro | Description |
|---|---|---|
| Identification | __bfin__BFIN__ | Defined by GNU C |
| Type | Macro | Description |
|---|---|---|
| Identification | __convex__ | Defined by GNU C |
| Version | __convex_'V'__ | V = Version |
| CPU | Macro |
|---|---|
| Convex C1 | __convex_c1__ |
| Convex C2 | __convex_c2__ |
| Convex C32xx series | __convex_c32__ |
| Convex C34xx series | __convex_c34__ |
| Convex C38xx series | __convex_c38__ |
| Type | Macro | |
|---|---|---|
| Identification | __epiphany__ |
| Type | Macro | Description |
|---|---|---|
| Identification | __hppa__ | Defined by GNU C |
| Identification | __HPPA__ | Defined by Stratus VOS C |
| Identification | __hppa | |
| Version | _PA_RISC'V'_'R' | V = Version R = Revision |
See also OpenPA.net.
| CPU | Macro |
|---|---|
| PA RISC 1.0 | _PA_RISC1_0 |
| PA RISC 1.1 | _PA_RISC1_1__HPPA11____PA7100__ |
| PA RISC 2.0 | _PA_RISC2_0__RISC2_0____HPPA20____PA8000__ |
| Type | Macro | Format | Description |
|---|---|---|---|
| Identification | i386__i386__i386__ | Defined by GNU C | |
| Version | __i386____i486____i586____i686__ | Defined by GNU C | |
| Identification | __i386 | Defined by Sun Studio | |
| Identification | __i386__IA32__ | Defined by Stratus VOS C | |
| Identification | _M_I86 | Only defined for 16-bits architectures Defined by Visual Studio, Digital Mars, and Watcom C/C++ (see note below) | |
| Identification | _M_IX86 | Only defined for 32-bits architectures Defined by Visual Studio, Intel C/C++, Digital Mars, and Watcom C/C++ | |
| Version | _M_IX86 | V00 | V = Version |
| Identification | __X86__ | Defined by Watcom C/C++ | |
| Identification | _X86_ | Defined by MinGW32 | |
| Identification | __THW_INTEL__ | Defined by XL C/C++ | |
| Identification | __I86__ | Defined by Digital Mars | |
| Version | __I86__ | V | V = Version |
| Identification | __INTEL__ | Defined by CodeWarrior | |
| Identification | __386 | Defined by Diab |
Notice that Watcom C/C++ defines _M_IX86 for both 16-bits and 32-bits architectures. Use __386__ or _M_I386 to detect 32-bits architectures in this case.
Notice that the Stratus VOS is big-endian on IA32, so these macros cannot be used to detect endianness if __VOS__ is set.
| CPU | _M_IX86 | __I86__ |
|---|---|---|
| 80386 | 300 | 3 |
| 80486 | 400 | 4 |
| Pentium | 500 | 5 |
| Pentium Pro/II | 600 | 6 |
| Type | Macro | Format | Description |
|---|---|---|---|
| Identification | __ia64___IA64__IA64__ | Defined by GNU C | |
| Identification | __ia64 | Defined by HP aCC | |
| Identification | _M_IA64 | Defined by Visual Studio | |
| Identification | _M_IA64 | Defined by Intel C/C++ | |
| Version | _M_IA64 | ? | |
| Identification | __itanium__ | Defined by Intel C/C++ |
| CPU | _M_IA64 (Intel C/C++) |
|---|---|
| 64100 |
| Type | Macro | Description |
|---|---|---|
| Identification | __m68k__ | Defined by GNU C |
| Version | __mc'V'____mc'V'mc'V' | V = Version |
| Identification | M68000 | Defined by SAS/C |
| Identification | __MC68K__ | Defined by Stratus VOS C |
| Version | __MC'V'__ | V = Version |
| CPU | Macro |
|---|---|
| 68000 | __mc68000____MC68000__ |
| 68010 | __mc68010__ |
| 68020 | __mc68020____MC68020__ |
| 68030 | __mc68030____MC68030__ |
| 68040 | __mc68040__ |
| 68060 | __mc68060__ |
| Type | Macro | Description |
|---|---|---|
| Identification | __mips__mips | Defined by GNU C |
| Version | _MIPS_ISA = _MIPS_ISA_MIPS'V' | V = MIPS ISA level |
| Version | _R3000_R4000_R5900 | |
| Identification | __mips | Defined by MIPSpro and GNU C |
| Version | __mips | The value indicates the MIPS ISA (Instruction Set Architecture) level |
| Version | __MIPS_ISA'V'__ | V = MIPS ISA level |
| Identification | __MIPS__ | Defined by Metrowerks |
| CPU | _MIPS_ISA | GNU C Macro | __mips | MIPSpro Macro |
|---|---|---|---|---|
| R2000 | _MIPS_ISA_MIPS1 | 1 | ||
| R3000 | _MIPS_ISA_MIPS1 | _R3000 | 1 | |
| R6000 | _MIPS_ISA_MIPS2 | 2 | __MIPS_ISA2__ | |
| R4000 | _R4000 | |||
| R4400 | _MIPS_ISA_MIPS3 | 3 | __MIPS_ISA3__ | |
| R8000 | _MIPS_ISA_MIPS4 | 4 | __MIPS_ISA4__ | |
| R10000 | _MIPS_ISA_MIPS4 | 4 | __MIPS_ISA4__ |
| Type | Macro | Description |
|---|---|---|
| Identification | __powerpc__powerpc____powerpc64____POWERPC____ppc____ppc64____PPC____PPC64___ARCH_PPC_ARCH_PPC64 | Defined by GNU C |
| Version | __ppc'V'__ | V = Version |
| Identification | _M_PPC | Defined by Visual Studio |
| Version | _M_PPC | ? |
| Identification | _ARCH_PPC_ARCH_PPC64 | Defined by XL C/C++ |
| Version | _ARCH_'V' | V = Version |
| Version | __PPCGECKO__ | Gekko Defined by CodeWarrior |
| Version | __PPCBROADWAY__ | Broadway Defined by CodeWarrior |
| Version | _XENON | Xenon |
| Identification | __ppc | Defined by Diab |
| CPU | _M_PPC | Macro | XL Macro |
|---|---|---|---|
| PowerPC 440 | _ARCH_440 | ||
| PowerPC 450 | _ARCH_450 | ||
| PowerPC 601 | 601 | __ppc601__ | _ARCH_601 |
| PowerPC 603 | 603 | __ppc603__ | _ARCH_603 |
| PowerPC 604 | 604 | __ppc604__ | _ARCH_604 |
| PowerPC 620 | 620 |
| Type | Macro |
|---|---|
| Identification | pyr |
| Type | Macro | Description |
|---|---|---|
| Identification | __THW_RS6000 | Defined by XL C/C++ |
| Identification | _IBMR2 | |
| Identification | _POWER | |
| Identification | _ARCH_PWR_ARCH_PWR2_ARCH_PWR3_ARCH_PWR4 |
| Type | Macro | Description |
|---|---|---|
| Identification | __sparc__ | Defined by GNU C |
| Identification | __sparc | Defined by Sun Studio |
| Version | __sparc_v8____sparc_v9__ | Defined by GNU C |
| Version | __sparcv8__sparcv9 | Defined by Sun Studio |
| CPU | Sun Studio Macro | GNU C Macro |
|---|---|---|
| SPARC v8 (SuperSPARC) | __sparcv8 | __sparc_v8__ |
| SPARC v9 (UltraSPARC) | __sparcv9 | __sparc_v9__ |
| Type | Macro | Description |
|---|---|---|
| Identification | __sh__ | Defined by GNU C |
| Version | __sh1____sh2____sh3____SH3____SH4____SH5__ |
| Type | Macro | Description |
|---|---|---|
| Identification | __370____THW_370__ | Identifies System/370 Defined by XL C/C++ |
| Identification | __s390__ | Identifies System/390 Defined by GNU C |
| Identification | __s390x__ | Identifies z/Architecture Defined by GNU C |
| Identification | __zarch__ | Identifies z/Architecture Defined by clang |
| Identification | __SYSC_ZARCH__ | Identifies z/Architecture Defined by Systems/C |
| Type | Macro | Description |
|---|---|---|
| Identification | _TMS320C2XX__TMS320C2000__ | C2000 series |
| Identification | _TMS320C5X__TMS320C55X__ | C5000 series |
| Identification | _TMS320C6X__TMS320C6X__ | C6000 series |
| DSP | Macro |
|---|---|
| C28xx | _TMS320C28X |
| C54x | _TMS320C5XX |
| C55x | __TMS320C55X__ |
| C6200 | _TMS320C6200 |
| C6400 | _TMS320C6400 |
| C6400+ | _TMS320C6400_PLUS |
| C6600 | _TMS320C6600 |
| C6700 | _TMS320C6700 |
| C6700+ | _TMS320C6700_PLUS |
| C6740 | _TMS320C6740 |
| Type | Macro |
|---|---|
| Identification | __TMS470__ |
浠婂ぉ鐪嬭佸鍐欑殑鏂囩珷鎻愬埌浜?/span>C#鍥介檯鏍囧噯…
浠涔堬紝C#榪樻湁鍥介檯鏍囧噯錛熶笉浼氬惂錛熻胺姝屼竴涓嬶紝鏋滅劧濡傛錛?/span>06騫村氨鏈変簡ISO鏍囧噯…灞呯劧榪樿兘浠?/span>ISO瀹樼綉涓嬭澆鍒扮數瀛愮増銆?/span>
鐪嬫潵閲戦挶灝辨槸濂戒笢瑗垮晩錛屾湁閽辮兘浣塊鎺ㄧ(閬撶悊鍦ㄥ湴鐞冧笂鍝噷閮藉ソ鐢?/span>…
緇х畫璋鋒瓕錛屽湪MSDN涓婂彂鐜頒簡涓嬮潰鐨勬枃瀛椼?/span>
榪炴帴錛?/span>http://msdn.microsoft.com/en-us/netframework/aa569283
In June 2005, the General Assembly of the international standardization organization Ecma approved edition 3 of the C# Language and the Common Language Infrastructure (CLI) specifications, as updated Ecma-334 and Ecma-335, respectively (see press release). The updated technical report on the CLI, Ecma TR-84, and a new technical report on the CLI, Ecma TR-89, were also ratified.
In July 2005, Ecma submitted the Standards and TRs to ISO/IEC JTC 1 via the ISO Fast-Track process. The Standards were adopted in April 2006 as ISO/IEC 23270:2006 (C#), ISO/IEC 23270:2006 (CLI), ISO/IEC TR 23272:2006 (CLI, XML Libraries) and ISO ISO/IEC TR 25438:2006 (CLI, Common Generics).
In July 2006 the General Assembly of Ecma approved edition 4 of the Standards which correspond to the ISO 2006 versions.
The following official Ecma documents are available for C# and the CLI (TR-84, TR-89). These links are direct from Ecma:
|
| File name |
| Size (Bytes) |
| Content |
|
|
| 2 614 003 |
| C# Language Specification | |
|
|
| 3 219 107 |
| Common Language Infrastructure | |
|
|
| 754 982 |
| XML-based Library Specification | |
|
|
| 187 450 |
| Information Derived from Partition IV XML File | |
|
|
| 19 329 610 |
| XML Tool, Libraries in Microsoft© Word and PDF | |
|
|
| 589 400 |
| Common Generics Library | |
|
|
| 461 074 |
| Common Generics Library Reference Implementation |
Reference implementation for TR-89
Reference implementation for the Parallel API
The official ISO/IEC documents are available from the ISO/IEC Freely Available Standards page. These links are direct from that page:
|
| File name |
| Content |
|
|
| Information technology -- Programming languages -- C# | |
|
|
| Information technology -- Common Language Infrastructure (CLI) | |
|
| ISO/IEC TR 23272:2006 |
| Information technology -- Common Language Infrastructure (CLI) |
|
|
| Information technology -- Common Language Infrastructure (CLI) |
Work on the 5th edition of Ecma-335 CLI standard began in mid-2009. The TC49-TG3 task group is working on extending both the virtual machine and class libraries of the CLI specification. In addition, improvements are being made to clarify existing elements of the specification. Many of these improvements are the result of feedback received from outside the task group, for which the task group is grateful.
Posted below is a snapshot of the committee's work as of 27 March 2010.
The participants in TC49/TG3 are providing these working documents to the public for informational purposes only. The contents are subject to change as often as once a month. To participate in the standardization process, contact your organization's Ecma representative. If your company does not currently participate in Ecma and wishes to do so, please contact ECMA directly.
The following organizations and contributors are actively participating in the work of TC49/TG3:
Eiffel Software, Microsoft Corporation, Novell Corporation, Kahu Research, and Twin Roots.
Many of the organizations that are currently participating in the TC49/TG3 work have volunteered to mirror this site. The URLs for the mirror sites are:
- Eiffel Software
- Microsoft Corporation
- Novell Corporation
- Kahu Research
- Twin Roots
Available Documents (Documents current as of 27 March 2010)
The following working draft documents are available:
- CLI Partition I - Architecture (word/pdf zip)
- CLI Partition II - Metadata and File Format (word/pdf zip)
- CLI Partition III - CIL (word/pdf zip)
- CLI Partition IV - Library (word/pdf zip)
- CLI Partition V - Binary Formats (word/pdf zip)
- CLI Partition VI - Annexes (word/pdf zip)
- Class Library XML (xml zip)
- Class Library Detailed Specifications (word/pdf zip)
Members of the Standard committees and others have combined to produce annotated versions of the Standards. These are:
The following documents are versions of the Standards with Microsoft implementation-specific notes added. These notes provide extra information about Microsoft's Common Language Runtime (CLR) implementation of the CLI.
|
| File name |
| Size (Bytes) |
| Content |
|
|
| 815 983 |
| Common Language Infrastructure, Partition I: Concepts and Architecture | |
|
|
| 1 758 195 |
| Common Language Infrastructure, Partition II: Metadata Definition and Semantics | |
|
|
| 661 414 |
| Common Language Infrastructure, Partition III: CIL Instruction Set | |
|
|
|
|
| Common Language Infrastructure, Partition IV: Profiles and Libraries | |
|
|
|
|
| Common Language Infrastructure, Partition V: Binary Formats | |
|
|
|
|
| Common Language Infrastructure, Partition VI: Annexes |
Aside from bug fixes, major enhancements from previous editions include:
In August, 2000, Microsoft Corporation, Hewlett-Packard and Intel Corporation co-sponsored the submission of specifications for the Common Language Infrastructure (CLI) and C# programming language to the international standardization organization Ecma. As a result, Ecma formed two task groups (TG3 and TG2, respectively) within TC39, its technical committee responsible for programming languages and application development.
During the next year, the co-sponsor companies, in conjunction with other Ecma members and guests (including IBM, Fujitsu Software, Plum Hall, Monash University and ISE), refined these specifications into standards. In December, 2001, the Ecma General Assembly ratified the 1st edition of the C# and CLI standards as Ecma-334 and Ecma-335, respectively. A technical report on the CLI, Ecma TR-84, was also ratified.
In late December, 2001, Ecma submitted the standards and TR to ISO/IEC JTC 1 via the latter's Fast-Track process. The subsequent 6-month evaluation and comment period resulted in two NO votes (Japan and UK) on the draft standards, and one NO vote (Japan) on the draft TR. All comments resulting from this review were considered at a ballot resolution meeting held in October, 2002. The two NO votes on the standards were resolved, making acceptance unanimous. However, Japan did not change its NO vote on the draft TR (Japan would like to see a formatted/readable rendering of the CLI class library as part of the standard, not as a TR; this will be considered for a future edition).
The ISO/IEC standards and TR were published in April, 2003, and are known formally as ISO/IEC 23270 (C#), ISO/IEC 23271 (CLI) and ISO/IEC 23272 (CLI TR). Equivalent specifications were adopted as 2nd edition standards and TR by Ecma at its December, 2002, General Assembly.
To participate in the standardization process, contact your organization’s Ecma representative. If your company does not currently participate in Ecma and wishes to do so, please contact Ecma directly.
The following organizations have participated in the work of Ecma TC39/TG2 and TC39/TG3 and their contributions are gratefully acknowledged: Borland, Fujitsu, Hewlett-Packard, Intel Corporation, International Business Machines, ISE, IT University Copenhagen, JSL (UK), Kahu Research (New Zealand), Microsoft Corporation, Monash University, Netscape, Novell Corporation, OpenWave, Plum Hall, Sun Microsystems.
Many of the organizations that have participated in the TC39/TG2 and TC39/TG3 work have volunteered to mirror this site. The links for the mirror sites are:
杞創錛屽凡緇忚涓嶆竻鍑哄錛屾姳姝夈?/p>
1銆佸効鏃訛紝灝忕敺瀛╁寰堢┓錛屽悆楗椂錛岄キ甯稿父涓嶅鍚冿紝姣嶄翰灝辨妸鑷繁紕楅噷鐨勯キ鍒嗙粰瀛╁瓙鍚冦傛瘝浜茶錛屽瀛愪滑錛屽揩鍚冨惂錛屾垜涓嶉タ錛?#8212;—姣嶄翰鎾掔殑絎竴涓皫
銆銆
2銆佺敺瀛╅暱韜綋鐨勬椂鍊欙紝鍕ゅ姵鐨勬瘝浜插父鐢ㄥ懆鏃ヤ紤鎭椂闂村幓鍘塊儕鍐滄潙娌蟲矡閲屾崬浜涢奔鏉ョ粰瀛╁瓙浠ˉ閽欍傞奔 寰堝ソ鍚冿紝楸兼堡涔熷緢椴溿傚瀛愪滑鍚冮奔鐨勬椂鍊欙紝姣嶄翰灝卞湪涓鏃佸晝楸奸澶達紝鐢ㄨ垖澶磋垟楸奸澶翠笂鐨勮倝娓嶃傜敺瀛╁績鐤鹼紝灝辨妸鑷繁紕楅噷鐨勯奔澶瑰埌姣嶄翰紕楅噷錛岃姣嶄翰鍚冮奔銆傛瘝浜蹭笉 鍚冿紝姣嶄翰鍙堢敤絳峰瓙鎶婇奔澶瑰洖鐢峰鐨勭閲屻傛瘝浜茶錛屽瀛愶紝蹇悆鍚э紝鎴戜笉鐖卞悆楸鹼紒——姣嶄翰鎾掔殑絎簩涓皫
銆銆
3銆佷笂鍒濅腑浜嗭紝涓轟簡緙村鐢峰鍜屽摜濮愮殑瀛﹁垂錛屽綋緙濈韓宸ョ殑姣嶄翰灝卞幓灞呭浼氶浜涚伀鏌寸洅鎷垮洖瀹舵潵錛屾櫄涓?緋婁簡鎸g偣鍒嗗垎閽辮ˉ鐐瑰鐢ㄣ傛湁涓啲澶╋紝鐢峰鍗婂閱掓潵錛岀湅鍒版瘝浜茶繕韜潃韜瓙鍦ㄦ補鐏笅緋婄伀鏌寸洅銆傜敺瀛╄錛屾瘝浜詫紝鐫′簡鍚э紝鏄庢棭鎮ㄨ繕瑕佷笂鐝憿銆傛瘝浜茬瑧絎戯紝璇達紝瀛╁瓙錛?蹇潯鍚э紝鎴戜笉鍥幫紒——姣嶄翰鎾掔殑絎笁涓皫
銆銆
4銆侀珮鑰冮偅騫達紝姣嶄翰璇蜂簡鍋囧ぉ澶╃珯鍦ㄨ冪偣闂ㄥ彛涓哄弬鍔犻珮鑰冪殑鐢峰鍔╅樀銆傛椂閫㈢洓澶忥紝鐑堟棩褰撳ご錛屽浐鎵х殑 姣嶄翰鍦ㄧ儓鏃ヤ笅涓绔欏氨鏄嚑涓皬鏃躲傝冭瘯緇撴潫鐨勯搩澹板搷浜嗭紝姣嶄翰榪庝笂鍘婚掕繃涓鏉敤緗愬ご鐡舵場濂界殑嫻撹尪鍙槺瀛╁瓙鍠濅簡錛岃尪浜︽祿錛屾儏鏇存祿銆傛湜鐫姣嶄翰騫茶鐨勫槾鍞囧拰婊″ご鐨勬睏 鐝狅紝鐢峰灝嗘墜涓殑緗愬ご鐡跺弽閫掕繃鍘昏姣嶄翰鍠濄傛瘝浜茶錛屽瀛愶紝蹇枬鍚э紝鎴戜笉娓達紒——姣嶄翰鎾掔殑鍥涗釜璋?
銆銆
5銆佺埗浜茬梾閫濅箣鍚庯紝姣嶄翰鍙堝綋鐖瑰張褰撳錛岄潬鐫鑷繁鍦ㄧ紳綰ぞ閲岄偅鐐瑰井钖勬敹鍏ュ惈杈涜尮鑻︽媺鎵潃鍑犱釜瀛?瀛愶紝渚涗粬浠康涔︼紝鏃ュ瓙榪囧緱鑻︿笉鍫█銆傝儭鍚岃礬鍙g數綰挎潌涓嬩慨琛ㄧ殑鏉庡彅鍙旂煡閬撳悗錛屽ぇ浜嬪皬浜嬪氨鎵懼矓榪囨潵鎵撲釜甯墜錛屾惉鎼叅錛屾寫鎸戞按錛岄佷簺閽辯伯鏉ュ府琛ョ敺瀛╃殑瀹墮噷銆備漢闈?鑽夋湪錛屽鑳芥棤鎯呫傚乏閭誨彸鑸嶅姝ょ湅鍦ㄧ溂閲岋紝璁板湪蹇冮噷錛岄兘鍔濇瘝浜插啀瀚侊紝浣曞繀鑻︿簡鑷繁銆傜劧鑰屾瘝浜插騫存潵鍗村畧韜鐜夛紝濮嬬粓涓嶅珌錛屽埆浜哄啀鍔濓紝姣嶄翰涔熸柇鐒朵笉鍚紝姣嶄翰 璇達紝鎴戜笉鐖憋紒——鎾掔殑浜斾釜璋?
銆銆
6銆佺敺瀛╁拰濂圭殑鍝ュ澶у姣曚笟鍙傚姞宸ヤ綔鍚庯紝涓嬩簡宀楃殑姣嶄翰灝卞湪闄勮繎鍐滆錘甯傚満鎽嗕簡涓皬鎽婄淮鎸佺敓媧匯傝韓鍦ㄥ鍦板伐浣滅殑瀛╁瓙浠煡閬撳悗灝卞父甯稿瘎閽卞洖鏉ヨˉ璐存瘝浜詫紝姣嶄翰鍧氬喅涓嶈錛屽茍灝嗛挶閫浜嗗洖鍘匯傛瘝浜茶錛屾垜鏈夐挶錛?#8212;—鎾掔殑鍏釜璋?
銆銆
7銆佺敺瀛╃暀鏍′換鏁欎袱騫達紝鍚庡張鑰冨彇浜嗙編鍥戒竴鎵鍚嶇墝澶у鐨勫崥澹敓錛屾瘯涓氬悗鐣欏湪緹庡浗涓瀹剁鐮旀満鏋勫伐浣滐紝寰呴亣鐩稿綋涓板帤錛屾潯浠跺ソ浜嗭紝韜湪寮傚浗鐨勭敺瀛╂兂鎶婃瘝浜叉帴鏉ヤ韓浜竻紱忓嵈琚佷漢鍥炵粷浜嗐傛瘝浜茶錛屾垜涓嶄範鎯紒——鎾掔殑涓冧釜璋?
銆銆
8銆佹櫄騫達紝姣嶄翰鎮d簡鑳冪檶錛屼綇榪涗簡鍖婚櫌錛岃繙鍦ㄥぇ瑗挎磱褰煎哺鐨勭敺瀛╀箻椋炴満璧跺洖鏉ユ椂錛屾湳鍚庣殑姣嶄翰宸叉槸濂勫涓鎭簡銆傛瘝浜茶佷簡錛屾湜鐫琚梾欖旀姌紓ㄥ緱姝誨幓媧繪潵鐨勬瘝浜詫紝鐢峰鎮茬棝嬈茬粷錛屾礁鐒舵唱涓嬨傛瘝浜插嵈璇達紝瀛╁瓙錛屽埆鍝紝鎴戜笉鐤箋?#8212;—鎾掔殑鏈鍚庝竴涓皫
鏈夋椂鍊欑敤鍒頒綅榪愮畻銆傞渶瑕佸揩閫熸壘鍒頒竴涓暣鏁扮殑浜岃繘鍒剁涓涓?/span>1鎴?/span>0鍦ㄥ摢涓綅(涓嬫爣)錛熶緥濡傦細鍗佽繘鍒舵暟100鐨勪簩榪涘埗鏄?/span>1100100錛岄偅涔堝畠鐨勭涓涓?/span>1鍦ㄤ笅鏍?/span> 涓?/span>2鐨勪綅緗?/span>(bsf, bit scan forward)鎴?/span>6鐨勪綅緗?/span>(bsr, bit scan in reverse order)錛岀敱浜庡彧鐢ㄤ簬瀛樺偍涓涓姸鎬侊紝鑷充簬鐢?/span>bsf榪樻槸bsr鍒欐棤鎵璋撱?/span>
瑙e喅榪欎釜闂鐨勭涓涓兂娉曞氨鏄敤鍐呰仈姹囩紪鐨勫仛娉曪紝浣跨敤鐗瑰埆鐨?/span>CPU鎸囦護鍘繪壘錛屼絾姹囩紪鐨勫彲縐繪鎬ф瘮杈冨樊錛屼笉鍚岀殑CPU鍨嬪彿浣跨敤鐨勬寚浠ゅ彲鑳戒笉涓鏍鳳紝鎵ц閫熷害涔熶笉涓鏍楓?/span>
鍋囪鎵句竴涓?/span>64浣嶆棤絎﹀彿鏁存暟浜岃繘鍒剁殑絎竴涓?/span>1錛岀敤bsf, AT& T姹囩紪(gcc姹囩紪)鍙互榪欐牱鍋氾細
1 // bit scan forward for 64 bit integral number
2 /* ============================================ */
3 inline int bsf_asm (uint64_t w)
4 {
5 int x1, x2;
6 asm ("bsf %0,%0\n" "jnz 1f\n" "bsf %1,%0\n" "jz 1f\n" "addl $32,%0\n"
7 "1:": "=&q" (x1), "=&q" (x2):"1" ((int) (w >> 32)),
8 "0" ((int) w));
9 return x1;
10 }
濡傛灉鐢?/span>C鏉ュ疄鐜扮殑璇濓紝閭e氨鏈夌偣楹葷儲浜嗭紝鍦ㄦ涓嶈澶嶆潅鐨勬暟瀛﹀師鐞嗭紝浠呬粎緇欏嚭浠g爜銆?/span>
1 // bit scan forward for 64 bit integral number
2 /* ============================================ */
3 inline int bsf_folded (uint64_t bb)
4 {
5 static const int lsb_64_table[64] =
6 {
7 63, 30, 3, 32, 59, 14, 11, 33,
8 60, 24, 50, 9, 55, 19, 21, 34,
9 61, 29, 2, 53, 51, 23, 41, 18,
10 56, 28, 1, 43, 46, 27, 0, 35,
11 62, 31, 58, 4, 5, 49, 54, 6,
12 15, 52, 12, 40, 7, 42, 45, 16,
13 25, 57, 48, 13, 10, 39, 8, 44,
14 20, 47, 38, 22, 17, 37, 36, 26
15 };
16 unsigned int folded;
17 bb ^= bb - 1;
18 folded = (int) bb ^ (bb >> 32);
19 return lsb_64_table[folded * 0x78291ACF >> 26];
20 }
濡傛灉鎯充粠鍚庡線鍓嶆悳绱竴涓暣鏁扮殑浜岃繘鍒剁涓涓?/span>1鐨勪笅鏍囷紝鐢ㄦ眹緙栧彲浠ヨ繖鏍峰仛銆?/span>
1 // bit scan in reverse order for 64 bit integral number
2 /* ============================================ */
3 inline int bsr_asm (uint64_t w)
4 {
5 int x1, x2;
6 asm ("bsr %1,%0\n" "jnz 1f\n" "bsr %0,%0\n" "subl $32,%0\n"
7 "1: addl $32,%0\n": "=&q" (x1), "=&q" (x2):"1" ((int) (w >> 32)),
8 "0" ((int) w));
9 return x1;
10 }
濡傛灉鐢?/span>C鏉ュ疄鐜扮殑璇濓紝涔熸瘮杈冪畝鍗曪紝鐢?/span>divide and conquer 鐨勫師鐞嗗氨涓嶄細澶參銆?/span>
1 // a logn (n == 32)algorithm for bit scan in reverse order
2 /* ============================================ */
3 inline int bsr32(uint32_t bb)
4 {
5 static const char msb_256_table[256] =
6 {
7 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
8 4, 4, 4, 4, 4, 4, 4, 4,4, 4, 4, 4,4, 4, 4, 4,
9 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
10 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
11 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
12 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
13 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
14 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
15 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
16 };
17 int result = 0;
18
19 if (bb > 0xFFFF)
20 {
21 bb >>= 16;
22 result += 16;
23 }
24 if (bb > 0xFF)
25 {
26 bb >>= 8;
27 result += 8;
28 }
29
30 return (result + msb_256_table[bb]);
31 }
32
33 /* ============================================ */
34 inline int bsr_in_C(uint64_t bb)
35 {
36 const uint32_t hb = bb >> 32;
37 return hb ? 32 + bsr32((uint32_t)hb) : bsr32((uint32_t)bb);
38
39 }
40
涓嬮潰榪欎釜浼間箮涔熷彲浠ワ紝澶辮觸鏃惰繑鍥?/span>-1023錛岃嚦浜庨熷害蹇參灝辮鐪嬬紪璇戝櫒鐨勫棞濂戒簡銆?/span>
1 // bit scan in reverse order for 64 bit integral number
2 /* ============================================ */
3 inline int bsr_double (uint64_t bb)
4 {
5 union
6 {
7 double d;
8 struct
9 {
10 unsigned int mantissal : 32;
11 unsigned int mantissah : 20;
12 unsigned int exponent : 11;
13 unsigned int sign : 1;
14 };
15 } ud;
16 ud.d = (double)(bb & ~(bb >> 32));
17 return ud.exponent - 1023;
18 }
19
2007騫村垵錛屽垰鍒氬嵏浠葷殑鑱斿悎鍥界涔﹂暱瀹夊崡錛屽湪寰峰厠钀ㄦ柉宸炵殑涓涓簞鍥噷涓捐浜嗕竴鍦烘厛鍠勬櫄瀹達紝鏃ㄥ湪涓洪潪媧茶傳鍥板効绔ュ嫙鎹愩傚簲閭鍙傚姞鏅氬鐨勯兘鏄瘜鍟嗗拰紺句細鍚嶆祦銆傚湪鏅氬灝嗚寮濮嬬殑鏃跺欙紝涓浣嶈佸浜洪鐫涓涓皬濂沖鏉ュ埌浜嗗簞鍥殑鍏ュ彛澶勶紝灝忓コ瀛╂墜閲屾崸鐫涓涓湅涓婂幓寰堢簿鑷寸殑鐡風綈銆?/span>
瀹堝湪搴勫洯鍏ュ彛澶勭殑淇濆畨瀹変笢灝兼嫤浣忎簡榪欎竴鑰佷竴灝忋?#8220;嬈㈣繋浣犱滑錛岃鍑虹ず璇鋒煬錛岃阿璋€?#8221;銆?/span>
“璇鋒煬錛屽涓嶈搗錛屾垜浠病鏈夋帴鍒伴個璇鳳紝鏄ス瑕佹潵錛屾垜闄ス鏉ョ殑銆?#8221;鑰佸浜烘姎鎽哥潃灝忓コ瀛╃殑澶淬?/span>
“寰堟姳姝夛紝闄や簡宸ヤ綔浜哄憳錛屾病鏈夎鏌殑浜轟笉鑳借繘鍘匯?#8221;瀹変笢灝艱銆?/span>
“涓轟粈涔堬紵榪欓噷涓嶆槸涓捐鎱堝杽鏅氬鍚楋紵鎴戜滑鏄潵琛ㄧず鎴戜滑鐨勫績鎰忕殑錛岄毦閬撲笉鍙互鍚楋紵”鑰佸浜虹殑琛ㄦ儏寰堜弗鑲冿紝“鍙埍鐨勫皬闇茶タ錛屼粠鐢佃涓婄煡閬撲簡榪欓噷瑕佷負闈炴床鐨勫瀛愪滑涓捐鎱堝杽媧誨姩錛屽ス寰堟兂涓洪偅浜涘彲鎬滅殑瀛╁瓙鍋氱偣浜嬶紝鍐沖畾鎶婅嚜宸卞偍閽辯綈閲屾墍鏈夌殑閽遍兘鎷垮嚭鏉ワ紝鎴戝彲浠ヤ笉榪涘幓錛岀湡鐨勪笉鑳借濂硅繘鍘誨悧錛?#8221;
“鏄殑錛岃繖閲屽皢瑕佷婦琛屼竴鍦烘厛鍠勬櫄瀹達紝搴旈個鍙傚姞鐨勯兘鏄緢閲嶈鐨勪漢澹紝浠栦滑灝嗕負闈炴床鐨勫瀛愭叿鎱ㄨВ鍥娿傚緢楂樺叴浣犱滑甯︾潃鐖卞績鏉ュ埌榪欓噷錛屼絾鏄紝鎴戞兂榪欏満鍚堜笉閫傚悎浣犱滑榪涘幓銆?#8221;瀹変笢灝艱В閲婅銆?/span>
“鍙斿彅錛屾厛鍠勭殑涓嶆槸閽憋紝鏄績錛屽鍚楋紵”涓鐩存病鏈夎璇濈殑灝忓コ瀛╅棶瀹変笢灝鹼紝濂圭殑璇濊瀹変笢灝兼劊浣忎簡銆?#8220;鎴戠煡閬撴敹鍒伴個璇風殑浜烘湁寰堝閽憋紝浠栦滑浼氭嬁鍑哄緢澶氶挶錛屾垜娌℃湁閭d箞澶氾紝浣嗚繖鏄垜鎵鏈夌殑閽卞晩錛屽鏋滄垜鐪熺殑涓嶈兘榪涘幓錛岃甯垜鎶婅繖涓甫榪涘幓鍚э紒”灝忓コ瀛╅湶瑗胯瀹岋紝灝嗘墜涓殑鍌ㄩ挶緗愰掔粰瀹変笢灝箋?/span>
瀹変笢灝間笉鐭ラ亾鏄帴榪樻槸涓嶆帴錛屾鍦ㄤ粬涓嶇煡鎵鎺殑鏃跺欙紝紿佺劧鏈変漢璇達細“涓嶇敤浜嗭紝瀛╁瓙錛屼綘璇村緱瀵癸紝鎱堝杽鐨勪笉鏄挶錛屾槸蹇冿紝浣犲彲浠ヨ繘鍘伙紝鎵鏈夋湁鐖卞績鐨勪漢閮藉彲浠ヨ繘鍘匯?#8221;璇磋瘽鐨勬槸涓浣嶈佸ご錛屼粬闈㈠甫寰瑧錛岀珯鍦ㄥ皬闇茶タ韜梺銆備粬韜韓鍜屽皬闇茶タ浜よ皥浜嗗嚑鍙ワ紝鐒跺悗鐩磋韓璧鋒潵錛屾嬁鍑轟竴浠借鏌掔粰瀹変笢灝鹼細“鎴戝彲浠ュ甫濂硅繘鍘誨悧錛?#8221;
瀹変笢灝兼帴榪囪鏌紝鎵撳紑涓鐪嬶紝蹇欏悜鑰佸ご鏁簡涓ぜ錛?#8220;褰撶劧鍙互浜嗭紝娌冧雞·宸磋彶鐗瑰厛鐢熴?#8221;
褰撳ぉ鎱堝杽鏅氬鐨勪富瑙掍笉鏄¤鑰呯殑瀹夊崡錛屼笉鏄崘鍑?00涓囩編鍏冪殑宸磋彶鐗癸紝涔熶笉鏄崘鍑?00涓囩編鍏冪殑姣斿皵·鐩栬尐錛岃屾槸浠呬粎鎹愬嚭30緹庡厓闆?5緹庡垎鐨勫皬闇茶タ錛屽ス璧㈠緱浜嗘渶澶氭渶鐑儓鐨勬帉澹般傝屾櫄瀹寸殑涓婚鏍囪涔熷彉鎴愪簡榪欐牱涓鍙ヨ瘽“鎱堝杽鐨勪笉鏄挶錛屾槸蹇冦?#8221;絎簩澶╋紝緹庡浗鍚勫ぇ濯掍綋綰風悍浠ヨ繖鍙ヨ瘽浣滀負鏍囬錛屾姤閬撲簡榪欐鎱堝杽鏅氬銆傜湅鍒版姤閬撳悗錛岃澶氭櫘鏅氶氱殑緹庡浗浜虹悍綰瘋〃紺鴻涓洪潪媧查偅浜涜傳絀風殑瀛╁瓙鎹愯禒銆?/span>
2006騫寸殑鑱屽満鍑哄鐨勫喎娓咃紝鐩告瘮鍓嶅嚑騫達紝綆鍘嗙殑鏁伴噺鍜岃川閲忛兘澶т負涓嶅錛屽緢闅懼緱鎵懼埌涓夊勾宸ヤ綔緇忛獙浠ヤ笂鐨勪漢錛屾湁涓涓?/span> 涓嶆槸鐗瑰埆絎紝灝辨槸鐗瑰埆鎬傚氨鏄箞錛屽共寰楀ソ璋佹病浜嬫崲宸ヤ綔鍟婏紒Simon鏄竴瀹跺浼佽蔣浠跺叕鍙哥殑鎬葷粡鐞嗭紝鏈榪戠粰榪欎釜闂鎰佸潖浜嗐傞」鐩竴涓帴涓涓殑鎺ヤ笅鏉ワ紝浜烘墜瓚?/span> 鏉ヨ秺绱у紶銆傝櫧鐒?/span>Simon鏄釜鏋侀檺緙栫▼鐨勭矇涓濓紝浣嗕篃涓嶅緱涓嶆壒鍑嗕簡涓浠藉張涓浠界殑鍔犵彮鐢寵銆?/span>HR緇忕悊鎶婅繖涓棶棰樺綊緇撳埌鎴夸環涓婏紝浠栫殑濡欒鏄?/span>“鎬曞け涓氫簡榪樹笉涓婃埧 嬈撅紝涓嶆暍璺蟲Ы”銆?/span>
榪欏ぉ錛?/span>K欏圭洰緇勯暱Allen緇堜簬蹇嶄笉浣忎簡錛屽甫浜嗕竴涓彧鏈変竴騫村伐浣滅粡楠岀殑灝忎紮瀛愯Simon闈㈣瘯錛?/span>“寰堣仾鏄庯紒緇忛獙灝戜簡鐐廣?/span>”
Simon鐨變簡鐨辯湁姣涳紝璇達細“浣犱笉鐭ラ亾榪欎釜鑱屼綅鏈浣庤姹傛槸涓夊勾宸ヤ綔緇忛獙鍚楋紵”
Allen璇達細“榪欏凡緇忔槸涓変釜鏈堥噷閫氳繃鎶鏈冭瘯涓渶濂界殑涓涓簡錛岃佸ぇ錛岃瘯璇曞惂銆?/span>”Allen鏄?/span>Simon澶氬勾鐨勫摜浠紝姣旇緝闅忎究銆?/span>
鎶靛埌闈㈠瓙涓婃潵錛?/span>Simon鍙ソ璁?/span>Allen鎶婂皬浼欏瓙甯﹁繘鏉ャ?/span>
Simon鐨勯潰璇曢氬父鏄笁姝ユ洸錛?/span>
闂涓錛氫綘鑳借璇存瘯涓氬悗鐨勪富瑕佸伐浣滅粡鍘嗗悧錛?/span>
闂浜岋細鍐嶈璇翠綘鍦ㄥ叕鍙哥殑鍦頒綅錛?/span>
闂涓夛細浣犵殑鍙戝睍鐩爣鏄粈涔堬紵絳夊洖絳斿悗錛屾瘮濡傝鏋舵瀯甯堬紝浠栧氨璺熺潃闂細鎯寵薄涓涓嬩綘褰撴灦鏋勫笀鐨勪竴澶╋紝璇寸粰鎴戝惉鍚紵
灝忎紮瀛愬洖絳旂涓闂寰堝揩寰堟竻妤氾紝涓騫村伐浣滃綋鐒舵病浠涔堜笢瑗褲?/span>Simon瑙夊緱灝忎紮瀛愭尯鑱槑銆傛墍浠ュ湪灝忎紮瀛愬洖絳斾簡絎簩涓棶棰樺悗錛岄棶浜嗕竴涓彂鏁fх殑闂錛?/span>“浣犲垰鎵嶈浣犲湪鍏徃閲屽浜庝腑絳夋按騫籌紝閭f瘮浣犲樊鐨勪漢涓轟粈涔堜細姣斾綘宸憿錛?/span>”
榪欎釜闂鏄釜闄烽槺銆?/span>
灝忎紮瀛愬啋鍐掑け澶卞洖絳旇錛?/span>“鎴戣寰椾粬浠瘡澶╁伐浣滄槸涓哄伐浣滆屽伐浣滐紝宸ヤ綔娌℃湁璐d換鎰熴?/span>”
Simon鐐圭偣澶磋錛?/span>“鏄悧錛熼偅鐪熸槸緋熺硶鐨勫憳宸ャ傞偅浣犲垰濂芥瘮緋熺硶鐨勫憳宸ュソ涓鐐逛簡錛?/span>”
灝忎紮瀛愮殑鑴鎬竴涓嬪瓙綰簡錛?/span>“鎴戜笉鏄繖涓剰鎬?/span>……”
“濂戒簡錛岄偅浣犺璇存瘮浣犲ソ鐨勪漢涓轟粈涔堟瘮浣犲己錛?/span>”
“鎴戣寰椾粬闈炲父鍔姏錛屽伐浣滃緢澶氬勾浜嗚繕鍦ㄥ涔犲悇縐嶆瀯鏋訛紝姘村鉤寰堥珮銆?/span>”浜庢槸Simon灝遍棶閭f渶鍚庝竴涓棶棰樸傛灉鐒訛紝灝忎紮瀛愬洖絳旂殑鏄鎴愪負鏋舵瀯甯堛傚ぇ姒?/span>70錛呯殑浜烘兂鎴愪負鏋舵瀯甯堛備絾鏄灦鏋勫笀鏄粈涔堝憿錛?/span>
Simon闂亾錛?/span>“閭d綘涓轟粈涔堣鎴愪負鏋舵瀯甯堝憿錛?/span>”
灝忎紮瀛愪竴鎰o紝澶ф榪樻病鏈変漢榪欎箞緗枒榪囦粬銆?/span>“騫寸邯澶т簡錛屼笉鑳借佸啓紼嬪簭鍚с?/span>”榪欎釜鍥炵瓟錛岃Simon鎯寵搗鍏充簬浠栧浠涔堟槸鑰佺殑瀹氫箟錛氬綋浣犲笇鏈涘仛騫磋交浜哄仛鐨勪簨鎯呮椂錛屼綘灝辮繕騫磋交錛涘鏋滀綘甯屾湜鍋氳佸勾浜哄仛鐨勪簨鎯咃紝浣犲氨鑰佷簡銆傝繖鍜屼綘鍑虹敓浜嗗闀挎椂闂存槸娌℃湁鍏崇郴鐨勩?/span>
Simon鎺ョ潃闂細“濂藉惂錛岄偅浣犺璇翠綘鎴愪負鏋舵瀯甯堜互鍚庯紝姣忓ぉ閮戒細鍋氫粈涔堬紵”
灝忎紮瀛愯錛?/span>“鎴戣繕娌℃兂榪囷紝涓嶈繃錛屾垜鎯沖簲璇ヤ富瑕佹槸闇姹傚垎鏋愶紝璁捐鏋勬灦鍚?/span>……”榪欏ぇ姒傛槸鐜板湪騫磋交浜虹殑閫氱梾錛屽勾杞諱漢寰堝鏄撹拷閫愪竴浜涜嚜宸變篃涓嶆竻妤氱殑鐩爣銆?/span>
Simon闂細“閭h璁℃瀯鏋跺叿浣撻兘鍋氫簺浠涔堝憿錛?/span>”
灝忎紮瀛愯繖嬈$殑鍥炵瓟鏄細“姣斿錛岄夋嫨紼嬪簭妗嗘灦錛屽喅瀹氱敤Spring鎴?/span>Struts絳夌瓑銆?/span>”
“鍝︼紝閭f垜闂綘錛屼綘鎬庝箞璇存湇鍒漢鏄敤Spring榪樻槸Struts鍛紵”
“濡傛灉鎴戞湁緇忛獙錛屾垜浼氱煡閬撳摢涓洿濂?/span>……”
“鏄悧錛屼絾鍏充簬Spring鎴?/span>Struts鐨勭煡璇嗕換璋侀兘鍙互寰堝鏄撳緱鍒般傚鏋滃埆浜轟笉鍚屾剰浣犵殑寤鴻錛屼綘鎬庝箞璇存湇浠栵紵濡傛灉鍚屾剰浣犵殑寤鴻錛岄偅浣犱笉榪囨槸浣滃嚭浜嗗拰鍒漢涓鏍風殑璁よ瘑錛屽埆浜哄張鍑粈涔堣鍙綘鍛紵”
灝忎紮瀛愭病鎯寵繃鏋舵瀯甯堟棩瀛愰噷榪樻湁涓涓鏈嶄漢鐨勫伐浣滐紝璇達細“鎴戞槸鏋舵瀯甯堬紝鎴戝簲璇ユ湁鏉冨姏鍋氬喅瀹氬惂錛?/span>”
Simon鎯寵搗鏉冨姏鐨勪笁縐嶅眰嬈★紝絎竴灞傦紝浠誨懡錛涚浜屽眰錛屼笓涓氾紱絎笁灞傦紝鍝佸痙銆?/span>
Simon闂細“濡傛灉鍦ㄤ竴涓垚鐔熺殑杞歡浼佷笟閲屾病鏈変綘鎵鎯寵薄鐨勬灦鏋勫笀鍛紵鎴栬呰錛屾灦鏋勫笀榪欑鑱屼笟宸茬粡姝諱骸鎴栨秷澶變簡鍛紵浣犱細鎬庝箞瀹氫綅浣犵殑鑱屼笟錛?/span>”
灝忎紮瀛愭樉寰楀緢闇囨儕銆?/span>
Simon鐢諱簡涓涓郴緇熸瀯鏋訛紝鐒跺悗鍙堢粰灝忎紮瀛愮湅浜嗕竴孌典唬鐮併?/span>
“閭d竴涓洿闅炬噦錛?/span>”Simon闂?/span>
灝忎紮瀛愭寚鐫浠g爜璇達細“浠g爜闅炬噦銆?/span>”
Simon鐨勮В閲婃槸錛?/span>“榪欏氨鏄負浠涔堝疄闄呬笂鎵璋撶殑鏋舵瀯甯堜笉瀛樺湪鐨勫師鍥犮備竴涓洿綆鍗曠殑涓滆タ鎬庝箞浼氭洿鏈変環鍊煎憿錛熸瘡涓漢閮借兘澶熺敾鍑鴻繖縐嶆瀯鏋跺浘錛屼絾涓嶆槸姣忎釜浜洪兘鑳藉啓鍑哄ソ鐨勪唬鐮併?/span>”
閫佽蛋浜嗗皬浼欏瓙錛?/span>Simon鏈夌偣闅懼彈銆備粬鏈夌偣鍠滄榪欎釜灝忎紮瀛愶紝浣嗘槸錛岃繖鍙堟槸涓涓鎰氳牏鐨勬暀鑲插拰璇漢瀛愬紵鐨勬妧鏈潅蹇楁薄鏌撶殑瀹朵紮銆?/span>Simon鍦ㄨ嚜宸辯殑絎旇鏈腑鍔犱簡涓鍙ヨ瘽錛氫腑鍥界▼搴忓憳鏈鎰氳牏鐨勮璇嗕箣涓夛細鎴戞兂褰撴灦鏋勫笀銆傚墠闈袱涓但鐒舵槸錛?/span>
35宀佸悗鍐欎笉鍔ㄧ▼搴忎簡錛?/span>
鎴戝彧瑕佸仛Java錛?/span>C錛嬶紜錛夛紱
|
嫻嬭瘯鍚嶇О |
緙栬瘧鍣?/span>/瑙h瘧鍣?/span> |
緙栬瘧/榪愯閫夐」 |
|
VC++ |
Visual C++ 2008 (32-bit) |
/Ox /Ob2 /Oi /Ot /GL /FD /MD /GS- /Gy /arch:SSE /fp:fast |
|
VC++_OpenMP |
Visual C++ 2008 (32-bit) |
/Ox /Ob2 /Oi /Ot /GL /FD /MD /GS- /Gy /arch:SSE /fp:fast /openmp |
|
IC++ |
Intel C++ Compiler (32-bit) |
/Ox /Og /Ob2 /Oi /Ot /Qipo /GA /MD /GS- /Gy /arch:SSE2 /fp:fast /Zi /QxHost |
|
IC++_OpenMP |
Intel C++ Compiler (32-bit) |
/Ox /Og /Ob2 /Oi /Ot /Qipo /GA /MD /GS- /Gy /arch:SSE2 /fp:fast /Zi /QxHost /Qopenmp |
|
GCC |
GCC 4.3.4 in Cygwin (32-bit) |
-O3 -march=native -ffast-math |
|
GCC_OpenMP |
GCC 4.3.4 in Cygwin (32-bit) |
-O3 -march=native -ffast-math -fopenmp |
|
C++/CLI |
Visual C++ 2008 (32-bit), .Net Framework 3.5 |
/Ox /Ob2 /Oi /Ot /GL /FD /MD /GS- /fp:fast /Zi /clr /TP |
|
C++/CLI_OpenMP |
Visual C++ 2008 (32-bit), .Net Framework 3.5 |
/Ox /Ob2 /Oi /Ot /GL /FD /MD /GS- /fp:fast /Zi /clr /TP /openmp |
|
C# |
Visual C# 2008 (32-bit), .Net Framework 3.5 |
|
|
*C#_outref |
Visual C# 2008 (32-bit), .Net Framework 3.5 |
|
|
F# |
F# 2.0 (32-bit), .Net Framework 3.5 |
|
|
Java |
Java SE 1.6.0_17 |
-server |
|
JsChrome |
Chrome 5.0.375.86 |
|
|
JsFirefox |
Firefox 3.6 |
|
|
LuaJIT |
LuaJIT 2.0.0-beta4 (32-bit) |
|
|
Lua |
LuaJIT (32-bit) |
-joff |
|
Python |
Python 3.1.2 (32-bit) |
|
|
*IronPython |
IronPython 2.6 for .Net 4 |
|
|
*Jython |
Jython 2.5.1 |
|
|
Ruby |
Ruby 1.9.1p378 |
|
娓叉煋鐨勮В鍍忓害涓?/span>256x256錛屾瘡璞$礌浣?/span>100嬈¢噰鏍楓?/span>
涓嬭〃涓璁劇殑鐩稿鏃墮棿浠ユ渶蹇殑鍗曠嚎紼嬫祴璇?/span>(IC++)浣滃熀鍑嗭紝鐢ㄩ紶鏍囨寜鍒楀彲鏀瑰彉鍩哄噯銆傜敱浜?/span>Ruby榪愯鏃墮棿澶暱錛屽彧姣忚薄绱犱綔4嬈¢噰鏍鳳紝鎶婃椂闂翠箻涓?/span>25銆傚彟 澶栵紝鍥犱負鍚勬祴璇曠殑娓叉煋鏃墮棿鐩稿樊寰堣繙錛屾墍浠ョ敤浜嗕袱涓褰㈠浘鍘繪樉紺烘暟鎹紝鍒嗗埆鏄劇ず鏃墮棿灝戜簬4000縐掑拰灝戜簬60縐掔殑嫻嬭瘯(Ruby鏄?/span>4000縐掍互澶栵紝涓嶄簣鏄?/span> 紺?/span>)銆?/span>
|
Test |
Time(sec) |
Relative time |
|
IC++_OpenMP |
2.861 |
0.19x |
|
VC++_OpenMP |
3.140 |
0.21x |
|
GCC_OpenMP |
3.359 |
0.23x |
|
C++/CLI_OpenMP |
5.147 |
0.35x |
|
IC++ |
14.761 |
1.00x |
|
VC++ |
17.632 |
1.19x |
|
GCC |
19.500 |
1.32x |
|
C++/CLI |
27.634 |
1.87x |
|
Java |
30.527 |
2.07x |
|
C#_outref |
44.220 |
3.00x |
|
F# |
47.172 |
3.20x |
|
C# |
48.194 |
3.26x |
|
JsChrome |
237.880 |
16.12x |
|
LuaJIT |
829.777 |
56.21x |
|
Lua |
1,227.656 |
83.17x |
|
IronPython |
2,921.573 |
197.93x |
|
JsFirefox |
3,588.778 |
243.13x |
|
Python |
3,920.556 |
265.60x |
|
Jython |
6,211.550 |
420.81x |
|
Ruby |
77,859.653 |
5,274.69x |
闈欐佽璦鍜屽姩鎬佽璦鍦ㄦ嫻嬭瘯涓嬬殑鎬ц兘涓嶅湪鍚屼竴鏁伴噺綰с傚厛姣旇緝闈欐佽璦銆?/span>
C++鍜?/span>.Net鐨勬祴璇曠粨鏋滃拰涓婁竴綃囧崥鏂囩浉鑻ワ紝鑰?/span>C#鍜?/span>F#鏃犳樉钁楀尯鍒備絾鏄紝C++/CLI铏界劧鍚屾牱浜х敓IL錛屼簬鎷鐨?/span>.Net騫沖彴涓婃墽琛岋紝鍏舵覆鏌撴椂闂?/span> 鍗村彧鏄?/span>C#/F#鐨?/span>55%宸﹀彸銆備負浠涔堝憿錛熶嬌鐢?/span>ildasm鍘誨弽姹囩紪C++/CLI鍜?/span>C#鐨勫彲鎵ц鏂囦歡鍚庯紝鍙互鍙戠幇錛岀▼搴忕殑鐑偣鍑芥暟 Sphere.Intersect()鍦ㄤ袱涓増鏈腑錛?/span>C++/CLI鐗堟湰鐨勪唬鐮佸ぇ灝?/span>(code size)涓?/span>201瀛楄妭錛?/span> C#鍒欎負125瀛楄妭錛?/span> C++/CLI鐗堟湰鍦ㄧ紪璇戞椂錛屽凡鎶婂嚱鏁板唴鎵鏈?/span>Vec綾葷殑鏂規硶璋冪敤鍏ㄩ儴鍐呰仈錛岃?/span>C#鐗堟湰鍒欎嬌鐢?/span>callvirt璋冪敤Vec鐨勬柟娉曘備及璁?/span>JIT娌℃湁鎶婅繖鍑芥暟榪?/span> 琛屽唴鑱旓紝鍋氭垚榪欎釜鎬ц兘宸紓銆傚彟澶栵紝C++/CLI鐗堟湰浣跨敤浜嗗肩被鍨嬶紝騫朵嬌鐢ㄦ寚閽?/span>(浠g爜涓負寮曠敤)鎵樼浠g爜(C++/CLI)鐨勬覆鏌撴椂闂達紝浠呬負鍘熺敓闈炴嫭綆′唬鐮?/span>(IC++)鐨?/span>1.91鍊嶏紝涓漢瑙夊緱.Net鐨?/span>JIT宸茬粡闈炲父涓嶉敊銆?/span>
鍙︿竴鏂歸潰錛?/span>Java鐨勬ц兘琛ㄧ幇闈炲父紿佸嚭錛屽彧姣?/span>C++/CLI紼嶆參涓鐐癸紝Java鐗堟湰鐨勬覆鏌撴椂闂翠負C#/F#鐨?/span>65%宸﹀彸銆備互鍓嶄竴鐩磋涓猴紝C#涓嶅皯璁捐浼氫嬌鍏舵ц兘楂樹簬Java錛屼緥濡?/span>C#鐨勬柟娉曢璁句負闈炶櫄錛?/span>Java鍒欓璁句負铏氾紱鍙堜緥濡?/span>C#鏀寔struct浣滃肩被鍨?/span>(value type)錛?/span>Java鍒欏彧鏈?/span>class寮曠敤綾誨瀷(reference type)錛屽悗鑰呭繀欏諱嬌鐢?/span>GC銆備絾鏄紝榪欎釜嫻嬭瘯鏄劇ず錛?/span>Java VM搴旇鍦?/span>JIT涓仛浜嗗ぇ閲忎紭鍖栵紝浼拌涔熷簲鐢ㄤ簡鍐呰仈錛屾墠鑳戒嬌鍏舵ц兘閫艱繎C++/CLI銆?/span>
綰?/span>C++鏂歸潰錛?/span>Intel C++緙栬瘧鍣ㄦ渶蹇紝Visual C++鎱竴鐐圭偣(1.19x)錛?/span>GCC鍐嶆參涓鐐圭偣(1.32x)銆傝繖緇撴灉絎﹀悎鏈漢棰勬湡銆?/span> Intel C++鐨?/span>OpenMP鐗堟湰鍜屽崟綰跨▼姣旇緝錛岃揪5.16鍔犻熸瘮(speedup)錛屽浜?/span>4鏍?/span>Hyper Threading鏉ヨ綆楁槸涓嶉敊鐨勭粨鏋溿傝鑰呰嫢鏈夊叴瓚o紝涔熷彲浠ヨ嚜琛屾祴璇?/span>C# 4.0鐨勫茍琛屾柊鐗規с?/span>
棣栧厛錛岃璇翠竴鍙ワ紝Google澶己浜嗭紝闅句互鎯沖儚JsChome鐨勬覆鏌撴椂闂翠粎鏄?/span>IC++鐨?/span>16.12鍊嶏紝C#鐨?/span>4.94鍊嶃?/span>
浠ヤ笅姣旇緝鍚勫姩鎬佽璦鐨勭浉瀵規椂闂達紝浠?/span>JsChrome涓哄熀鍑嗐?/span> Chrome鐨?/span>V8 JavaScript寮曟搸(1.00x)澶у箙鎶涚Firefox鐨?/span>SpiderMonkey寮曟搸(15.09x)銆傝?/span>LuaJIT(3.49x)鍜?/span>Lua(5.16x)鍒欐帓絎簩鍜岀涓夊悕銆?/span> Lua鐨?/span>JIT鐗堟湰鏄病鏈?/span>JIT鐨?/span>68%錛屽茍娌℃湁鎯沖儚涓殑蹇紝浣嗘槸涔熸瘮Python(16.48x)蹇緱澶氥傛浘鍚榪?/span>Ruby鏈夋晥鑳介棶棰橈紝娌℃兂鍒伴棶棰樼珶鐒跺姝や弗閲?/span>(327.31x)錛屽叾娓叉煋鏃墮棿宸笉澶氭槸Python鐨?/span>20鍊?

B鏍?/span>
鍗充簩鍙夋悳绱㈡爲錛?/span>
1.鎵鏈夐潪鍙跺瓙緇撶偣鑷沖鎷ユ湁涓や釜鍎垮瓙錛?/span>Left鍜?/span>Right錛夛紱
2.鎵鏈夌粨鐐瑰瓨鍌ㄤ竴涓叧閿瓧錛?/span>
3.闈炲彾瀛愮粨鐐圭殑宸︽寚閽堟寚鍚戝皬浜庡叾鍏抽敭瀛楃殑瀛愭爲錛屽彸鎸囬拡鎸囧悜澶т簬鍏跺叧閿瓧鐨勫瓙鏍戯紱
濡傦細
B鏍戠殑鎼滅儲錛屼粠鏍圭粨鐐瑰紑濮嬶紝濡傛灉鏌ヨ鐨勫叧閿瓧涓庣粨鐐圭殑鍏抽敭瀛楃浉絳夛紝閭d箞灝卞懡涓紱鍚﹀垯錛屽鏋滄煡璇㈠叧閿瓧姣旂粨鐐瑰叧閿瓧灝忥紝灝辮繘鍏ュ乏鍎垮瓙錛涘鏋滄瘮緇撶偣鍏抽敭瀛楀ぇ錛屽氨榪涘叆鍙沖効瀛愶紱濡傛灉宸﹀効瀛愭垨鍙沖効瀛愮殑鎸囬拡涓虹┖錛屽垯鎶ュ憡鎵句笉鍒扮浉搴旂殑鍏抽敭瀛楋紱
濡傛灉B鏍戠殑鎵鏈夐潪鍙跺瓙緇撶偣鐨勫乏鍙沖瓙鏍戠殑緇撶偣鏁扮洰鍧囦繚鎸佸樊涓嶅錛堝鉤琛★級錛岄偅涔?/span>B鏍戠殑鎼滅儲鎬ц兘閫艱繎浜屽垎鏌ユ壘錛涗絾瀹冩瘮榪炵畫鍐呭瓨絀洪棿鐨勪簩鍒嗘煡鎵劇殑浼樼偣鏄紝鏀瑰彉B鏍戠粨鏋勶紙鎻掑叆涓庡垹闄ょ粨鐐癸級涓嶉渶瑕佺Щ鍔ㄥぇ孌電殑鍐呭瓨鏁版嵁錛岀敋鑷抽氬父鏄父鏁板紑閿錛?/span>
浣?/span>B鏍戝湪緇忚繃澶氭鎻掑叆涓庡垹闄ゅ悗錛屾湁鍙兘瀵艱嚧涓嶅悓鐨勭粨鏋勶細

鍙寵竟涔熸槸涓涓?/span>B鏍戯紝浣嗗畠鐨勬悳绱㈡ц兘宸茬粡鏄嚎鎬х殑浜嗭紱鍚屾牱鐨勫叧閿瓧闆嗗悎鏈夊彲鑳藉鑷翠笉鍚岀殑鏍戠粨鏋勭儲寮曪紱鎵浠ワ紝浣跨敤B鏍戣繕瑕佽冭檻灝藉彲鑳借B鏍戜繚鎸佸乏鍥劇殑緇撴瀯錛屽拰閬垮厤鍙沖浘鐨勭粨鏋勶紝涔熷氨鏄墍璋撶殑“騫寵 ”闂錛?/span>
瀹為檯浣跨敤鐨?/span>B鏍戦兘鏄湪鍘?/span>B鏍戠殑鍩虹涓婂姞涓婂鉤琛$畻娉曪紝鍗?#8220;騫寵 浜屽弶鏍?#8221;錛涘浣曚繚鎸?/span>B鏍戠粨鐐瑰垎甯冨潎鍖鐨勫鉤琛$畻娉曟槸騫寵 浜屽弶鏍戠殑鍏抽敭錛涘鉤琛$畻娉曟槸涓縐嶅湪B鏍戜腑鎻掑叆鍜屽垹闄ょ粨鐐圭殑絳栫暐錛?/span>
B-鏍?/span>
鏄竴縐嶅璺悳绱㈡爲錛堝茍涓嶆槸浜屽弶鐨勶級錛?/span>
1.瀹氫箟浠繪剰闈炲彾瀛愮粨鐐規渶澶氬彧鏈?/span>M涓効瀛愶紱涓?/span>M>2錛?/span>
2.鏍圭粨鐐圭殑鍎垮瓙鏁頒負[2, M]錛?/span>
3.闄ゆ牴緇撶偣浠ュ鐨勯潪鍙跺瓙緇撶偣鐨勫効瀛愭暟涓?/span>[M/2, M]錛?/span>
4.姣忎釜緇撶偣瀛樻斁鑷沖皯M/2-1錛堝彇涓婃暣錛夊拰鑷沖M-1涓叧閿瓧錛涳紙鑷沖皯2涓叧閿瓧錛?/span>
5.闈炲彾瀛愮粨鐐圭殑鍏抽敭瀛椾釜鏁?/span>=鎸囧悜鍎垮瓙鐨勬寚閽堜釜鏁?/span>-1錛?/span>
6.闈炲彾瀛愮粨鐐圭殑鍏抽敭瀛楋細K[1], K[2], …, K[M-1]錛涗笖K[i] < K[i+1]錛?/span>
7.闈炲彾瀛愮粨鐐圭殑鎸囬拡錛?/span>P[1], P[2], …, P[M]錛涘叾涓?/span>P[1]鎸囧悜鍏抽敭瀛楀皬浜?/span>K[1]鐨勫瓙鏍戯紝P[M]鎸囧悜鍏抽敭瀛楀ぇ浜?/span>K[M-1]鐨勫瓙鏍戯紝鍏跺畠P[i]鎸囧悜鍏抽敭瀛楀睘浜?/span>(K[i-1], K[i])鐨勫瓙鏍戯紱
8.鎵鏈夊彾瀛愮粨鐐逛綅浜庡悓涓灞傦紱
濡傦細錛?/span>M=3錛?/span>
B-鏍戠殑鎼滅儲錛屼粠鏍圭粨鐐瑰紑濮嬶紝瀵圭粨鐐瑰唴鐨勫叧閿瓧錛堟湁搴忥級搴忓垪榪涜浜屽垎鏌ユ壘錛屽鏋滃懡涓垯緇撴潫錛屽惁鍒欒繘鍏ユ煡璇㈠叧閿瓧鎵灞炶寖鍥寸殑鍎垮瓙緇撶偣錛涢噸澶嶏紝鐩村埌鎵瀵瑰簲鐨勫効瀛愭寚閽堜負絀猴紝鎴栧凡緇忔槸鍙跺瓙緇撶偣錛?/span>
B-鏍戠殑鐗規э細
1.鍏抽敭瀛楅泦鍚堝垎甯冨湪鏁撮鏍戜腑錛?/span>
2.浠諱綍涓涓叧閿瓧鍑虹幇涓斿彧鍑虹幇鍦ㄤ竴涓粨鐐逛腑錛?/span>
3.鎼滅儲鏈夊彲鑳藉湪闈炲彾瀛愮粨鐐圭粨鏉燂紱
4.鍏舵悳绱㈡ц兘絳変環浜庡湪鍏抽敭瀛楀叏闆嗗唴鍋氫竴嬈′簩鍒嗘煡鎵撅紱
5.鑷姩灞傛鎺у埗錛?/span>
鐢變簬闄愬埗浜嗛櫎鏍圭粨鐐逛互澶栫殑闈炲彾瀛愮粨鐐癸紝鑷沖皯鍚湁M/2涓効瀛愶紝紜繚浜嗙粨鐐圭殑鑷沖皯鍒╃敤鐜囷紝鍏舵渶搴曟悳绱㈡ц兘涓猴細
鍏朵腑錛?/span>M涓鴻瀹氱殑闈炲彾瀛愮粨鐐規渶澶氬瓙鏍戜釜鏁幫紝N涓哄叧閿瓧鎬繪暟錛?/span>
鎵浠?/span>B-鏍戠殑鎬ц兘鎬繪槸絳変環浜庝簩鍒嗘煡鎵撅紙涓?/span>M鍊兼棤鍏籌級錛屼篃灝辨病鏈?/span>B鏍戝鉤琛$殑闂錛?/span>
鐢變簬M/2鐨勯檺鍒訛紝鍦ㄦ彃鍏ョ粨鐐規椂錛屽鏋滅粨鐐瑰凡婊★紝闇瑕佸皢緇撶偣鍒嗚涓轟袱涓悇鍗?/span>M/2鐨勭粨鐐癸紱鍒犻櫎緇撶偣鏃訛紝闇灝嗕袱涓笉瓚?/span>M/2鐨勫厔寮熺粨鐐瑰悎騫訛紱
B+鏍?/span>
B+鏍戞槸B-鏍戠殑鍙樹綋錛屼篃鏄竴縐嶅璺悳绱㈡爲錛?/span>
1.鍏跺畾涔夊熀鏈笌B-鏍戝悓錛岄櫎浜嗭細
2.闈炲彾瀛愮粨鐐圭殑瀛愭爲鎸囬拡涓庡叧閿瓧涓暟鐩稿悓錛?/span>
3.闈炲彾瀛愮粨鐐圭殑瀛愭爲鎸囬拡P[i]錛屾寚鍚戝叧閿瓧鍊煎睘浜?/span>[K[i], K[i+1])鐨勫瓙鏍戯紙B-鏍戞槸寮鍖洪棿錛夛紱
5.涓烘墍鏈夊彾瀛愮粨鐐瑰鍔犱竴涓摼鎸囬拡錛?/span>
6.鎵鏈夊叧閿瓧閮藉湪鍙跺瓙緇撶偣鍑虹幇錛?/span>
濡傦細錛?/span>M=3錛?/span>
B+鐨勬悳绱笌B-鏍戜篃鍩烘湰鐩稿悓錛屽尯鍒槸B+鏍戝彧鏈夎揪鍒板彾瀛愮粨鐐規墠鍛戒腑錛?/span>B-鏍戝彲浠ュ湪闈炲彾瀛愮粨鐐瑰懡涓級錛屽叾鎬ц兘涔熺瓑浠蜂簬鍦ㄥ叧閿瓧鍏ㄩ泦鍋氫竴嬈′簩鍒嗘煡鎵撅紱
B+鐨勭壒鎬э細
1.鎵鏈夊叧閿瓧閮藉嚭鐜板湪鍙跺瓙緇撶偣鐨勯摼琛ㄤ腑錛堢瀵嗙儲寮曪級錛屼笖閾捐〃涓殑鍏抽敭瀛楁伆濂芥槸鏈夊簭鐨勶紱
2.涓嶅彲鑳藉湪闈炲彾瀛愮粨鐐瑰懡涓紱
3.闈炲彾瀛愮粨鐐圭浉褰撲簬鏄彾瀛愮粨鐐圭殑绱㈠紩錛堢█鐤忕儲寮曪級錛屽彾瀛愮粨鐐圭浉褰撲簬鏄瓨鍌紙鍏抽敭瀛楋級鏁版嵁鐨勬暟鎹眰錛?/span>
4.鏇撮傚悎鏂囦歡绱㈠紩緋葷粺錛?/span>
B*鏍?/span>
鏄?/span>B+鏍戠殑鍙樹綋錛屽湪B+鏍戠殑闈炴牴鍜岄潪鍙跺瓙緇撶偣鍐嶅鍔犳寚鍚戝厔寮熺殑鎸囬拡錛?/span>
B*鏍戝畾涔変簡闈炲彾瀛愮粨鐐瑰叧閿瓧涓暟鑷沖皯涓?/span>(2/3)*M錛屽嵆鍧楃殑鏈浣庝嬌鐢ㄧ巼涓?/span>2/3錛堜唬鏇?/span>B+鏍戠殑1/2錛夛紱
B+鏍戠殑鍒嗚錛氬綋涓涓粨鐐規弧鏃訛紝鍒嗛厤涓涓柊鐨勭粨鐐癸紝騫跺皢鍘熺粨鐐逛腑1/2鐨勬暟鎹鍒跺埌鏂扮粨鐐癸紝鏈鍚庡湪鐖剁粨鐐逛腑澧炲姞鏂扮粨鐐圭殑鎸囬拡錛?/span>B+鏍戠殑鍒嗚鍙獎鍝嶅師緇撶偣鍜岀埗緇撶偣錛岃屼笉浼氬獎鍝嶅厔寮熺粨鐐癸紝鎵浠ュ畠涓嶉渶瑕佹寚鍚戝厔寮熺殑鎸囬拡錛?/span>
B*鏍戠殑鍒嗚錛氬綋涓涓粨鐐規弧鏃訛紝濡傛灉瀹冪殑涓嬩竴涓厔寮熺粨鐐規湭婊★紝閭d箞灝嗕竴閮ㄥ垎鏁版嵁縐誨埌鍏勫紵緇撶偣涓紝鍐嶅湪鍘熺粨鐐規彃鍏ュ叧閿瓧錛屾渶鍚庝慨鏀圭埗緇撶偣涓厔寮熺粨鐐圭殑鍏抽敭瀛楋紙鍥犱負鍏勫紵緇撶偣鐨勫叧閿瓧鑼冨洿鏀瑰彉浜嗭級錛涘鏋滃厔寮熶篃婊′簡錛屽垯鍦ㄥ師緇撶偣涓庡厔寮熺粨鐐逛箣闂村鍔犳柊緇撶偣錛屽茍鍚勫鍒?/span>1/3鐨勬暟鎹埌鏂扮粨鐐癸紝鏈鍚庡湪鐖剁粨鐐瑰鍔犳柊緇撶偣鐨勬寚閽堬紱
鎵浠ワ紝B*鏍戝垎閰嶆柊緇撶偣鐨勬鐜囨瘮B+鏍戣浣庯紝絀洪棿浣跨敤鐜囨洿楂橈紱
灝忕粨
B鏍戯細浜屽弶鏍戯紝姣忎釜緇撶偣鍙瓨鍌ㄤ竴涓叧閿瓧錛岀瓑浜庡垯鍛戒腑錛屽皬浜庤蛋宸︾粨鐐癸紝澶т簬璧板彸緇撶偣錛?/span>
B-鏍戯細澶氳礬鎼滅儲鏍戯紝姣忎釜緇撶偣瀛樺偍M/2鍒?/span>M涓叧閿瓧錛岄潪鍙跺瓙緇撶偣瀛樺偍鎸囧悜鍏抽敭瀛楄寖鍥寸殑瀛愮粨鐐癸紱
鎵鏈夊叧閿瓧鍦ㄦ暣棰楁爲涓嚭鐜幫紝涓斿彧鍑虹幇涓嬈★紝闈炲彾瀛愮粨鐐瑰彲浠ュ懡涓紱
B+鏍戯細鍦?/span>B-鏍戝熀紜涓婏紝涓哄彾瀛愮粨鐐瑰鍔犻摼琛ㄦ寚閽堬紝鎵鏈夊叧閿瓧閮藉湪鍙跺瓙緇撶偣涓嚭鐜幫紝闈炲彾瀛愮粨鐐逛綔涓哄彾瀛愮粨鐐圭殑绱㈠紩錛?/span>B+鏍戞繪槸鍒板彾瀛愮粨鐐規墠鍛戒腑錛?/span>
B*鏍戯細鍦?/span>B+鏍戝熀紜涓婏紝涓洪潪鍙跺瓙緇撶偣涔熷鍔犻摼琛ㄦ寚閽堬紝灝嗙粨鐐圭殑鏈浣庡埄鐢ㄧ巼浠?/span>1/2鎻愰珮鍒?/span>2/3銆?/span>
杞嚜: http://blog.csdn.net/manesking/archive/2007/02/09/1505979.aspx