Lines Matching full:value
31 static int encodeImmSingle(int value)
34 int bitA = (value & 0x80000000) >> 31;
35 int notBitB = (value & 0x40000000) >> 30;
36 int bitB = (value & 0x20000000) >> 29;
37 int bSmear = (value & 0x3e000000) >> 25;
38 int slice = (value & 0x01f80000) >> 19;
39 int zeroes = (value & 0x0007ffff);
54 int value)
56 int encodedImm = encodeImmSingle(value);
61 ArmLIR *dataTarget = scanLiteralPool(cUnit, value, 0);
63 dataTarget = addWordData(cUnit, value, false);
99 * Determine whether value can be encoded as a Thumb2 modified
102 static int modifiedImmediate(u4 value)
106 u4 b0 = value & 0xff;
108 /* Note: case of value==0 must use 0:000:0:0000000 encoding */
109 if (value <= 0xFF)
111 if (value == ((b0 << 16) | b0))
113 if (value == ((b0 << 24) | (b0 << 16) | (b0 << 8) | b0))
115 b0 = (value >> 8) & 0xff;
116 if (value == ((b0 << 24) | (b0 << 8)))
119 zLeading = leadingZeros(value);
120 zTrailing = 32 - leadingZeros(~value & (value - 1));
125 value <<= zLeading + 1;
127 value >>= 25;
129 return value | ((0x8 + zLeading) << 7); /* [01000..11111]:bcdefgh */
141 int value)
147 return loadFPConstantValue(cUnit, rDest, value);
150 /* See if the value can be constructed cheaply */
151 if (LOWREG(rDest) && (value >= 0) && (value <= 255)) {
152 return newLIR2(cUnit, kThumbMovImm, rDest, value);
155 modImm = modifiedImmediate(value);
160 modImm = modifiedImmediate(~value);
166 if ((value & 0xffff) == value) {
167 res = newLIR2(cUnit, kThumb2MovImm16, rDest, value);
171 ArmLIR *dataTarget = scanLiteralPool(cUnit, value, 0);
173 dataTarget = addWordData(cUnit, value, false);
196 * add up to 255 to an existing constant value.
198 if (dataTarget->operands[0] != value) {
199 opRegImm(cUnit, kOpAdd, rDest, value - dataTarget->operands[0]);
205 * Load an immediate value into a fixed or temp register. Target
208 static ArmLIR *loadConstant(CompilationUnit *cUnit, int rDest, int value)
214 return loadConstantNoClobber(cUnit, rDest, value);
235 static ArmLIR *opImm(CompilationUnit *cUnit, OpKind op, int value)
240 opCode = ((value & 0xff00) != 0) ? kThumb2Push : kThumbPush;
243 opCode = ((value & 0xff00) != 0) ? kThumb2Pop : kThumbPop;
248 return newLIR1(cUnit, opCode, value);
457 int rSrc1, int value)
460 bool neg = (value < 0);
461 int absValue = (neg) ? -value : value;
465 int modImm = modifiedImmediate(value);
466 int modImmNeg = modifiedImmediate(-value);
471 return newLIR3(cUnit, kThumbLslRRI5, rDest, rSrc1, value);
473 return newLIR3(cUnit, kThumb2LslRRI5, rDest, rSrc1, value);
476 return newLIR3(cUnit, kThumbLsrRRI5, rDest, rSrc1, value);
478 return newLIR3(cUnit, kThumb2LsrRRI5, rDest, rSrc1, value);
481 return newLIR3(cUnit, kThumbAsrRRI5, rDest, rSrc1, value);
483 return newLIR3(cUnit, kThumb2AsrRRI5, rDest, rSrc1, value);
485 return newLIR3(cUnit, kThumb2RorRRI5, rDest, rSrc1, value);
488 (value <= 1020) && ((value & 0x3)==0)) {
490 value >> 2);
492 (value <= 1020) && ((value & 0x3)==0)) {
494 value >> 2);
548 int modImm = modifiedImmediate(value);
554 res = loadConstant(cUnit, rTmp, value);
568 loadConstant(cUnit, rScratch, value);
580 int value)
583 bool neg = (value < 0);
584 int absValue = (neg) ? -value : value;
589 if ( !neg && (rDestSrc1 == 13) && (value <= 508)) { /* sp */
590 assert((value & 0x3) == 0);
591 return newLIR1(cUnit, kThumbAddSpI7, value >> 2);
597 if (!neg && (rDestSrc1 == 13) && (value <= 508)) { /* sp */
598 assert((value & 0x3) == 0);
599 return newLIR1(cUnit, kThumbSubSpI7, value >> 2);
622 return opRegRegImm(cUnit, op, rDestSrc1, rDestSrc1, value);
627 * Determine whether value can be encoded as a Thumb2 floating point
628 * immediate. If not, return -1. If so return encoded 8-bit value.
630 static int encodeImmDoubleHigh(int value)
633 int bitA = (value & 0x80000000) >> 31;
634 int notBitB = (value & 0x40000000) >> 30;
635 int bitB = (value & 0x20000000) >> 29;
636 int bSmear = (value & 0x3fc00000) >> 22;
637 int slice = (value & 0x003f0000) >> 16;
638 int zeroes = (value & 0x0000ffff);
755 /* Move float value into core register */
810 * Load value from base + displacement. Optionally perform null check