Lines Matching refs:Value
37 static void signed_width(unsigned Width, uint64_t Value, in signed_width() argument
40 if (!isIntN(Width, Value)) { in signed_width()
57 static void unsigned_width(unsigned Width, uint64_t Value, in unsigned_width() argument
60 if (!isUIntN(Width, Value)) { in unsigned_width()
77 static void adjustBranch(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in adjustBranch() argument
81 unsigned_width(Size + 1, Value, std::string("branch target"), Fixup, Ctx); in adjustBranch()
84 AVR::fixups::adjustBranchTarget(Value); in adjustBranch()
89 uint64_t &Value, MCContext *Ctx = nullptr) { in adjustRelativeBranch() argument
92 signed_width(Size + 1, Value, std::string("branch target"), Fixup, Ctx); in adjustRelativeBranch()
95 AVR::fixups::adjustBranchTarget(Value); in adjustRelativeBranch()
104 static void fixup_call(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup_call() argument
106 adjustBranch(Size, Fixup, Value, Ctx); in fixup_call()
108 auto top = Value & (0xf00000 << 6); // the top four bits in fixup_call()
109 auto middle = Value & (0x1ffff << 5); // the middle 13 bits in fixup_call()
110 auto bottom = Value & 0x1f; // end bottom 5 bits in fixup_call()
112 Value = (top << 6) | (middle << 3) | (bottom << 0); in fixup_call()
120 static void fixup_7_pcrel(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup_7_pcrel() argument
122 adjustRelativeBranch(Size, Fixup, Value, Ctx); in fixup_7_pcrel()
125 Value &= 0x7f; in fixup_7_pcrel()
134 static void fixup_13_pcrel(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup_13_pcrel() argument
136 adjustRelativeBranch(Size, Fixup, Value, Ctx); in fixup_13_pcrel()
139 Value &= 0xfff; in fixup_13_pcrel()
147 static void fixup_6(const MCFixup &Fixup, uint64_t &Value, in fixup_6() argument
149 unsigned_width(6, Value, std::string("immediate"), Fixup, Ctx); in fixup_6()
151 Value = ((Value & 0x20) << 8) | ((Value & 0x18) << 7) | (Value & 0x07); in fixup_6()
159 static void fixup_6_adiw(const MCFixup &Fixup, uint64_t &Value, in fixup_6_adiw() argument
161 unsigned_width(6, Value, std::string("immediate"), Fixup, Ctx); in fixup_6_adiw()
163 Value = ((Value & 0x30) << 2) | (Value & 0x0f); in fixup_6_adiw()
170 static void fixup_port5(const MCFixup &Fixup, uint64_t &Value, in fixup_port5() argument
172 unsigned_width(5, Value, std::string("port number"), Fixup, Ctx); in fixup_port5()
174 Value &= 0x1f; in fixup_port5()
176 Value <<= 3; in fixup_port5()
183 static void fixup_port6(const MCFixup &Fixup, uint64_t &Value, in fixup_port6() argument
185 unsigned_width(6, Value, std::string("port number"), Fixup, Ctx); in fixup_port6()
187 Value = ((Value & 0x30) << 5) | (Value & 0x0f); in fixup_port6()
194 static void fixup_lds_sts_16(const MCFixup &Fixup, uint64_t &Value, in fixup_lds_sts_16() argument
196 unsigned_width(7, Value, std::string("immediate"), Fixup, Ctx); in fixup_lds_sts_16()
197 Value = ((Value & 0x70) << 8) | (Value & 0x0f); in fixup_lds_sts_16()
202 static void pm(uint64_t &Value) { Value >>= 1; } in pm() argument
212 static void fixup(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in fixup() argument
214 uint64_t upper = Value & 0xf0; in fixup()
215 uint64_t lower = Value & 0x0f; in fixup()
217 Value = (upper << 4) | lower; in fixup()
220 static void neg(uint64_t &Value) { Value *= -1; } in neg() argument
222 static void lo8(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in lo8() argument
224 Value &= 0xff; in lo8()
225 ldi::fixup(Size, Fixup, Value, Ctx); in lo8()
228 static void hi8(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in hi8() argument
230 Value = (Value & 0xff00) >> 8; in hi8()
231 ldi::fixup(Size, Fixup, Value, Ctx); in hi8()
234 static void hh8(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in hh8() argument
236 Value = (Value & 0xff0000) >> 16; in hh8()
237 ldi::fixup(Size, Fixup, Value, Ctx); in hh8()
240 static void ms8(unsigned Size, const MCFixup &Fixup, uint64_t &Value, in ms8() argument
242 Value = (Value & 0xff000000) >> 24; in ms8()
243 ldi::fixup(Size, Fixup, Value, Ctx); in ms8()
253 const MCValue &Target, uint64_t &Value, in adjustFixupValue() argument
263 adjust::fixup_7_pcrel(Size, Fixup, Value, Ctx); in adjustFixupValue()
266 adjust::fixup_13_pcrel(Size, Fixup, Value, Ctx); in adjustFixupValue()
269 adjust::fixup_call(Size, Fixup, Value, Ctx); in adjustFixupValue()
272 adjust::ldi::fixup(Size, Fixup, Value, Ctx); in adjustFixupValue()
275 adjust::ldi::lo8(Size, Fixup, Value, Ctx); in adjustFixupValue()
279 adjust::pm(Value); in adjustFixupValue()
280 adjust::ldi::lo8(Size, Fixup, Value, Ctx); in adjustFixupValue()
283 adjust::ldi::hi8(Size, Fixup, Value, Ctx); in adjustFixupValue()
287 adjust::pm(Value); in adjustFixupValue()
288 adjust::ldi::hi8(Size, Fixup, Value, Ctx); in adjustFixupValue()
293 adjust::pm(Value); in adjustFixupValue()
295 adjust::ldi::hh8(Size, Fixup, Value, Ctx); in adjustFixupValue()
298 adjust::ldi::ms8(Size, Fixup, Value, Ctx); in adjustFixupValue()
304 adjust::pm(Value); in adjustFixupValue()
306 adjust::ldi::neg(Value); in adjustFixupValue()
307 adjust::ldi::lo8(Size, Fixup, Value, Ctx); in adjustFixupValue()
312 adjust::pm(Value); in adjustFixupValue()
314 adjust::ldi::neg(Value); in adjustFixupValue()
315 adjust::ldi::hi8(Size, Fixup, Value, Ctx); in adjustFixupValue()
320 adjust::pm(Value); in adjustFixupValue()
322 adjust::ldi::neg(Value); in adjustFixupValue()
323 adjust::ldi::hh8(Size, Fixup, Value, Ctx); in adjustFixupValue()
326 adjust::ldi::neg(Value); in adjustFixupValue()
327 adjust::ldi::ms8(Size, Fixup, Value, Ctx); in adjustFixupValue()
330 adjust::unsigned_width(16, Value, std::string("port number"), Fixup, Ctx); in adjustFixupValue()
332 Value &= 0xffff; in adjustFixupValue()
335 Value >>= 1; // Flash addresses are always shifted. in adjustFixupValue()
336 adjust::unsigned_width(16, Value, std::string("port number"), Fixup, Ctx); in adjustFixupValue()
338 Value &= 0xffff; in adjustFixupValue()
342 adjust::fixup_6(Fixup, Value, Ctx); in adjustFixupValue()
345 adjust::fixup_6_adiw(Fixup, Value, Ctx); in adjustFixupValue()
349 adjust::fixup_port5(Fixup, Value, Ctx); in adjustFixupValue()
353 adjust::fixup_port6(Fixup, Value, Ctx); in adjustFixupValue()
357 adjust::fixup_lds_sts_16(Fixup, Value, Ctx); in adjustFixupValue()
380 MutableArrayRef<char> Data, uint64_t Value, in applyFixup() argument
385 adjustFixupValue(Fixup, Target, Value, &Asm.getContext()); in applyFixup()
386 if (Value == 0) in applyFixup()
396 Value <<= Info.TargetOffset; in applyFixup()
404 uint8_t mask = (((Value >> (i * 8)) & 0xff)); in applyFixup()