llvm.org GIT mirror llvm / a73afe0
make langref more precise, wave 1, from Jon Sargeant git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49044 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 13 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
14641464
14651465
Floating point constants use standard decimal notation (e.g. 123.421),
14661466 exponential notation (e.g. 1.23421e+2), or a more precise hexadecimal
1467 notation (see below). Floating point constants must have a
1468 href="#t_floating">floating point type.
1467 notation (see below). The assembler requires the exact decimal value of
1468 a floating-point constant. For example, the assembler accepts 1.25 but
1469 rejects 1.3 because 1.3 is a repeating decimal in binary. Floating point
1470 constants must have a floating point type.
14691471
14701472
Null pointer constants
14711473
21892191 types. This instruction can also take vector versions
21902192 of the values in which case the elements must be integers.

21912193
Semantics:
2192

The value produced is the signed integer quotient of the two operands.

2194

The value produced is the signed integer quotient of the two operands rounded towards zero.

21932195

Note that signed integer division and unsigned integer division are distinct

21942196 operations; for unsigned integer division, use 'udiv'.

21952197

Division by zero leads to undefined behavior. Overflow also leads to

22372239 of the values in which case the elements must be integers.

22382240
Semantics:
22392241

This instruction returns the unsigned integer remainder of a division.

2240 This instruction always performs an unsigned division to get the remainder,
2241 regardless of whether the arguments are unsigned or not.

2242 This instruction always performs an unsigned division to get the remainder.

22422243

Note that unsigned integer remainder and signed integer remainder are

22432244 distinct operations; for signed integer remainder, use 'srem'.

22442245

Taking the remainder of a division by zero leads to undefined behavior.

23022303 identical types. This instruction can also take vector
23032304 versions of floating point values.

23042305
Semantics:
2305

This instruction returns the remainder of a division.

2306

This instruction returns the remainder of a division.

2307 The remainder has the same sign as the dividend.

23062308
Example:
23072309
  <result> = frem float 4.0, %var          ; yields {float}:result = 4.0 % %var

                  
                
23082310
23152317

Bitwise binary operators are used to do various forms of

23162318 bit-twiddling in a program. They are generally very efficient
23172319 instructions and can commonly be strength reduced from other
2318 instructions. They require two operands, execute an operation on them,
2319 and produce a single value. The resulting value of the bitwise binary
2320 operators is always the same type as its first operand.

2320 instructions. They require two operands of the same type, execute an operation on them,
2321 and produce a single value. The resulting value is the same type as its operands.

23212322
23222323
23232324
23402341
23412342
Semantics:
23422343
2343

The value produced is var1 * 2var2. If

2344 var2 is (statically or dynamically) equal to or larger than the number
2345 of bits in var1, the result is undefined.

2344

The value produced is var1 * 2var2 mod 2n,

2345 where n is the width of the result. If var2 is (statically or dynamically) negative or
2346 equal to or larger than the number of bits in var1, the result is undefined.

23462347
23472348
Example:

                  
                
23482349 <result> = shl i32 4, %var ; yields {i32}: 4 << %var