llvm.org GIT mirror llvm / 8cb89db
[mips] Add support for unaligned load/store macros. Add missing unaligned store macros (ush/usw) and fix the exisiting implementation of the unaligned load macros in order to generate identical expansions with the GNU assembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287646 91177308-0d34-0410-b5e6-96231b3b80d8 Vasileios Kalintiris 2 years ago
3 changed file(s) with 773 addition(s) and 106 deletion(s). Raw diff Collapse all Expand all
233233 bool expandUlh(MCInst &Inst, bool Signed, SMLoc IDLoc, MCStreamer &Out,
234234 const MCSubtargetInfo *STI);
235235
236 bool expandUlw(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
236 bool expandUsh(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
237 const MCSubtargetInfo *STI);
238
239 bool expandUxw(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
237240 const MCSubtargetInfo *STI);
238241
239242 bool expandRotation(MCInst &Inst, SMLoc IDLoc,
21792182 return expandUlh(Inst, true, IDLoc, Out, STI) ? MER_Fail : MER_Success;
21802183 case Mips::Ulhu:
21812184 return expandUlh(Inst, false, IDLoc, Out, STI) ? MER_Fail : MER_Success;
2185 case Mips::Ush:
2186 return expandUsh(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success;
21822187 case Mips::Ulw:
2183 return expandUlw(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success;
2188 case Mips::Usw:
2189 return expandUxw(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success;
21842190 case Mips::NORImm:
21852191 return expandAliasImmediate(Inst, IDLoc, Out, STI) ? MER_Fail : MER_Success;
21862192 case Mips::ADDi:
33243330
33253331 bool MipsAsmParser::expandUlh(MCInst &Inst, bool Signed, SMLoc IDLoc,
33263332 MCStreamer &Out, const MCSubtargetInfo *STI) {
3327 MipsTargetStreamer &TOut = getTargetStreamer();
3328
33293333 if (hasMips32r6() || hasMips64r6()) {
33303334 return Error(IDLoc, "instruction not supported on mips32r6 or mips64r6");
33313335 }
33323336
3333 warnIfNoMacro(IDLoc);
3334
33353337 const MCOperand &DstRegOp = Inst.getOperand(0);
33363338 assert(DstRegOp.isReg() && "expected register operand kind");
3337
33383339 const MCOperand &SrcRegOp = Inst.getOperand(1);
33393340 assert(SrcRegOp.isReg() && "expected register operand kind");
3340
33413341 const MCOperand &OffsetImmOp = Inst.getOperand(2);
33423342 assert(OffsetImmOp.isImm() && "expected immediate operand kind");
33433343
3344 MipsTargetStreamer &TOut = getTargetStreamer();
33443345 unsigned DstReg = DstRegOp.getReg();
33453346 unsigned SrcReg = SrcRegOp.getReg();
33463347 int64_t OffsetValue = OffsetImmOp.getImm();
33473348
33483349 // NOTE: We always need AT for ULHU, as it is always used as the source
33493350 // register for one of the LBu's.
3351 warnIfNoMacro(IDLoc);
33503352 unsigned ATReg = getATReg(IDLoc);
33513353 if (!ATReg)
33523354 return true;
33533355
3354 // When the value of offset+1 does not fit in 16 bits, we have to load the
3355 // offset in AT, (D)ADDu the original source register (if there was one), and
3356 // then use AT as the source register for the 2 generated LBu's.
3357 bool LoadedOffsetInAT = false;
3358 if (!isInt<16>(OffsetValue + 1) || !isInt<16>(OffsetValue)) {
3359 LoadedOffsetInAT = true;
3360
3361 if (loadImmediate(OffsetValue, ATReg, Mips::NoRegister, !ABI.ArePtrs64bit(),
3362 true, IDLoc, Out, STI))
3356 bool IsLargeOffset = !(isInt<16>(OffsetValue + 1) && isInt<16>(OffsetValue));
3357 if (IsLargeOffset) {
3358 if (loadImmediate(OffsetValue, ATReg, SrcReg, !ABI.ArePtrs64bit(), true,
3359 IDLoc, Out, STI))
33633360 return true;
3364
3365 // NOTE: We do this (D)ADDu here instead of doing it in loadImmediate()
3366 // because it will make our output more similar to GAS'. For example,
3367 // generating an "ori $1, $zero, 32768" followed by an "addu $1, $1, $9",
3368 // instead of just an "ori $1, $9, 32768".
3369 // NOTE: If there is no source register specified in the ULHU, the parser
3370 // will interpret it as $0.
3371 if (SrcReg != Mips::ZERO && SrcReg != Mips::ZERO_64)
3372 TOut.emitAddu(ATReg, ATReg, SrcReg, ABI.ArePtrs64bit(), STI);
3373 }
3374
3375 unsigned FirstLbuDstReg = LoadedOffsetInAT ? DstReg : ATReg;
3376 unsigned SecondLbuDstReg = LoadedOffsetInAT ? ATReg : DstReg;
3377 unsigned LbuSrcReg = LoadedOffsetInAT ? ATReg : SrcReg;
3378
3379 int64_t FirstLbuOffset = 0, SecondLbuOffset = 0;
3380 if (isLittle()) {
3381 FirstLbuOffset = LoadedOffsetInAT ? 1 : (OffsetValue + 1);
3382 SecondLbuOffset = LoadedOffsetInAT ? 0 : OffsetValue;
3383 } else {
3384 FirstLbuOffset = LoadedOffsetInAT ? 0 : OffsetValue;
3385 SecondLbuOffset = LoadedOffsetInAT ? 1 : (OffsetValue + 1);
3386 }
3387
3388 unsigned SllReg = LoadedOffsetInAT ? DstReg : ATReg;
3361 }
3362
3363 int64_t FirstOffset = IsLargeOffset ? 0 : OffsetValue;
3364 int64_t SecondOffset = IsLargeOffset ? 1 : (OffsetValue + 1);
3365 if (isLittle())
3366 std::swap(FirstOffset, SecondOffset);
3367
3368 unsigned FirstLbuDstReg = IsLargeOffset ? DstReg : ATReg;
3369 unsigned SecondLbuDstReg = IsLargeOffset ? ATReg : DstReg;
3370
3371 unsigned LbuSrcReg = IsLargeOffset ? ATReg : SrcReg;
3372 unsigned SllReg = IsLargeOffset ? DstReg : ATReg;
33893373
33903374 TOut.emitRRI(Signed ? Mips::LB : Mips::LBu, FirstLbuDstReg, LbuSrcReg,
3391 FirstLbuOffset, IDLoc, STI);
3392
3393 TOut.emitRRI(Mips::LBu, SecondLbuDstReg, LbuSrcReg, SecondLbuOffset, IDLoc,
3394 STI);
3395
3375 FirstOffset, IDLoc, STI);
3376 TOut.emitRRI(Mips::LBu, SecondLbuDstReg, LbuSrcReg, SecondOffset, IDLoc, STI);
33963377 TOut.emitRRI(Mips::SLL, SllReg, SllReg, 8, IDLoc, STI);
3397
33983378 TOut.emitRRR(Mips::OR, DstReg, DstReg, ATReg, IDLoc, STI);
33993379
34003380 return false;
34013381 }
34023382
3403 bool MipsAsmParser::expandUlw(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
3383 bool MipsAsmParser::expandUsh(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
34043384 const MCSubtargetInfo *STI) {
3405 MipsTargetStreamer &TOut = getTargetStreamer();
3406
3407 if (hasMips32r6() || hasMips64r6())
3385 if (hasMips32r6() || hasMips64r6()) {
34083386 return Error(IDLoc, "instruction not supported on mips32r6 or mips64r6");
3387 }
34093388
34103389 const MCOperand &DstRegOp = Inst.getOperand(0);
34113390 assert(DstRegOp.isReg() && "expected register operand kind");
3412
34133391 const MCOperand &SrcRegOp = Inst.getOperand(1);
34143392 assert(SrcRegOp.isReg() && "expected register operand kind");
3415
34163393 const MCOperand &OffsetImmOp = Inst.getOperand(2);
34173394 assert(OffsetImmOp.isImm() && "expected immediate operand kind");
34183395
3396 MipsTargetStreamer &TOut = getTargetStreamer();
3397 unsigned DstReg = DstRegOp.getReg();
34193398 unsigned SrcReg = SrcRegOp.getReg();
34203399 int64_t OffsetValue = OffsetImmOp.getImm();
3421 unsigned ATReg = 0;
3422
3423 // When the value of offset+3 does not fit in 16 bits, we have to load the
3424 // offset in AT, (D)ADDu the original source register (if there was one), and
3425 // then use AT as the source register for the generated LWL and LWR.
3426 bool LoadedOffsetInAT = false;
3427 if (!isInt<16>(OffsetValue + 3) || !isInt<16>(OffsetValue)) {
3428 ATReg = getATReg(IDLoc);
3429 if (!ATReg)
3400
3401 warnIfNoMacro(IDLoc);
3402 unsigned ATReg = getATReg(IDLoc);
3403 if (!ATReg)
3404 return true;
3405
3406 bool IsLargeOffset = !(isInt<16>(OffsetValue + 1) && isInt<16>(OffsetValue));
3407 if (IsLargeOffset) {
3408 if (loadImmediate(OffsetValue, ATReg, SrcReg, !ABI.ArePtrs64bit(), true,
3409 IDLoc, Out, STI))
34303410 return true;
3431 LoadedOffsetInAT = true;
3432
3411 }
3412
3413 int64_t FirstOffset = IsLargeOffset ? 1 : (OffsetValue + 1);
3414 int64_t SecondOffset = IsLargeOffset ? 0 : OffsetValue;
3415 if (isLittle())
3416 std::swap(FirstOffset, SecondOffset);
3417
3418 if (IsLargeOffset) {
3419 TOut.emitRRI(Mips::SB, DstReg, ATReg, FirstOffset, IDLoc, STI);
3420 TOut.emitRRI(Mips::SRL, DstReg, DstReg, 8, IDLoc, STI);
3421 TOut.emitRRI(Mips::SB, DstReg, ATReg, SecondOffset, IDLoc, STI);
3422 TOut.emitRRI(Mips::LBu, ATReg, ATReg, 0, IDLoc, STI);
3423 TOut.emitRRI(Mips::SLL, DstReg, DstReg, 8, IDLoc, STI);
3424 TOut.emitRRR(Mips::OR, DstReg, DstReg, ATReg, IDLoc, STI);
3425 } else {
3426 TOut.emitRRI(Mips::SB, DstReg, SrcReg, FirstOffset, IDLoc, STI);
3427 TOut.emitRRI(Mips::SRL, ATReg, DstReg, 8, IDLoc, STI);
3428 TOut.emitRRI(Mips::SB, ATReg, SrcReg, SecondOffset, IDLoc, STI);
3429 }
3430
3431 return false;
3432 }
3433
3434 bool MipsAsmParser::expandUxw(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
3435 const MCSubtargetInfo *STI) {
3436 if (hasMips32r6() || hasMips64r6()) {
3437 return Error(IDLoc, "instruction not supported on mips32r6 or mips64r6");
3438 }
3439
3440 const MCOperand &DstRegOp = Inst.getOperand(0);
3441 assert(DstRegOp.isReg() && "expected register operand kind");
3442 const MCOperand &SrcRegOp = Inst.getOperand(1);
3443 assert(SrcRegOp.isReg() && "expected register operand kind");
3444 const MCOperand &OffsetImmOp = Inst.getOperand(2);
3445 assert(OffsetImmOp.isImm() && "expected immediate operand kind");
3446
3447 MipsTargetStreamer &TOut = getTargetStreamer();
3448 unsigned DstReg = DstRegOp.getReg();
3449 unsigned SrcReg = SrcRegOp.getReg();
3450 int64_t OffsetValue = OffsetImmOp.getImm();
3451
3452 // Compute left/right load/store offsets.
3453 bool IsLargeOffset = !(isInt<16>(OffsetValue + 3) && isInt<16>(OffsetValue));
3454 int64_t LxlOffset = IsLargeOffset ? 0 : OffsetValue;
3455 int64_t LxrOffset = IsLargeOffset ? 3 : (OffsetValue + 3);
3456 if (isLittle())
3457 std::swap(LxlOffset, LxrOffset);
3458
3459 bool IsLoadInst = (Inst.getOpcode() == Mips::Ulw);
3460 bool DoMove = IsLoadInst && (SrcReg == DstReg) && !IsLargeOffset;
3461 unsigned TmpReg = SrcReg;
3462 if (IsLargeOffset || DoMove) {
34333463 warnIfNoMacro(IDLoc);
3434
3435 if (loadImmediate(OffsetValue, ATReg, Mips::NoRegister, !ABI.ArePtrs64bit(),
3436 true, IDLoc, Out, STI))
3464 TmpReg = getATReg(IDLoc);
3465 if (!TmpReg)
34373466 return true;
3438
3439 // NOTE: We do this (D)ADDu here instead of doing it in loadImmediate()
3440 // because it will make our output more similar to GAS'. For example,
3441 // generating an "ori $1, $zero, 32768" followed by an "addu $1, $1, $9",
3442 // instead of just an "ori $1, $9, 32768".
3443 // NOTE: If there is no source register specified in the ULW, the parser
3444 // will interpret it as $0.
3445 if (SrcReg != Mips::ZERO && SrcReg != Mips::ZERO_64)
3446 TOut.emitAddu(ATReg, ATReg, SrcReg, ABI.ArePtrs64bit(), STI);
3447 }
3448
3449 unsigned FinalSrcReg = LoadedOffsetInAT ? ATReg : SrcReg;
3450 int64_t LeftLoadOffset = 0, RightLoadOffset = 0;
3451 if (isLittle()) {
3452 LeftLoadOffset = LoadedOffsetInAT ? 3 : (OffsetValue + 3);
3453 RightLoadOffset = LoadedOffsetInAT ? 0 : OffsetValue;
3454 } else {
3455 LeftLoadOffset = LoadedOffsetInAT ? 0 : OffsetValue;
3456 RightLoadOffset = LoadedOffsetInAT ? 3 : (OffsetValue + 3);
3457 }
3458
3459 TOut.emitRRI(Mips::LWL, DstRegOp.getReg(), FinalSrcReg, LeftLoadOffset, IDLoc,
3460 STI);
3461
3462 TOut.emitRRI(Mips::LWR, DstRegOp.getReg(), FinalSrcReg, RightLoadOffset,
3463 IDLoc, STI);
3467 }
3468
3469 if (IsLargeOffset) {
3470 if (loadImmediate(OffsetValue, TmpReg, SrcReg, !ABI.ArePtrs64bit(), true,
3471 IDLoc, Out, STI))
3472 return true;
3473 }
3474
3475 if (DoMove)
3476 std::swap(DstReg, TmpReg);
3477
3478 unsigned XWL = IsLoadInst ? Mips::LWL : Mips::SWL;
3479 unsigned XWR = IsLoadInst ? Mips::LWR : Mips::SWR;
3480 TOut.emitRRI(XWL, DstReg, TmpReg, LxlOffset, IDLoc, STI);
3481 TOut.emitRRI(XWR, DstReg, TmpReg, LxrOffset, IDLoc, STI);
3482
3483 if (DoMove)
3484 TOut.emitRRR(Mips::OR, TmpReg, DstReg, Mips::ZERO, IDLoc, STI);
34643485
34653486 return false;
34663487 }
25682568 def Ulw : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins mem:$addr),
25692569 "ulw\t$rt, $addr">; //, ISA_MIPS1_NOT_32R6_64R6;
25702570
2571 def Ush : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins mem:$addr),
2572 "ush\t$rt, $addr">; //, ISA_MIPS1_NOT_32R6_64R6;
2573
2574 def Usw : MipsAsmPseudoInst<(outs GPR32Opnd:$rt), (ins mem:$addr),
2575 "usw\t$rt, $addr">; //, ISA_MIPS1_NOT_32R6_64R6;
2576
25712577 def LDMacro : MipsAsmPseudoInst<(outs GPR32Opnd:$rt),
25722578 (ins mem_simm16:$addr), "ld $rt, $addr">,
25732579 ISA_MIPS1_NOT_MIPS3;
325325 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
326326
327327 ulh $8, 32767($9)
328 # CHECK-BE: addiu $1, $zero, 32767 # encoding: [0x24,0x01,0x7f,0xff]
329 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
328 # CHECK-BE: addiu $1, $9, 32767 # encoding: [0x25,0x21,0x7f,0xff]
330329 # CHECK-BE: lb $8, 0($1) # encoding: [0x80,0x28,0x00,0x00]
331330 # CHECK-BE: lbu $1, 1($1) # encoding: [0x90,0x21,0x00,0x01]
332331 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
333332 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
334 # CHECK-LE: addiu $1, $zero, 32767 # encoding: [0xff,0x7f,0x01,0x24]
335 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
333 # CHECK-LE: addiu $1, $9, 32767 # encoding: [0xff,0x7f,0x21,0x25]
336334 # CHECK-LE: lb $8, 1($1) # encoding: [0x01,0x00,0x28,0x80]
337335 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
338336 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
526524 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
527525
528526 ulhu $8, 32767($9)
529 # CHECK-BE: addiu $1, $zero, 32767 # encoding: [0x24,0x01,0x7f,0xff]
530 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
527 # CHECK-BE: addiu $1, $9, 32767 # encoding: [0x25,0x21,0x7f,0xff]
531528 # CHECK-BE: lbu $8, 0($1) # encoding: [0x90,0x28,0x00,0x00]
532529 # CHECK-BE: lbu $1, 1($1) # encoding: [0x90,0x21,0x00,0x01]
533530 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
534531 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
535 # CHECK-LE: addiu $1, $zero, 32767 # encoding: [0xff,0x7f,0x01,0x24]
536 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
532 # CHECK-LE: addiu $1, $9, 32767 # encoding: [0xff,0x7f,0x21,0x25]
537533 # CHECK-LE: lbu $8, 1($1) # encoding: [0x01,0x00,0x28,0x90]
538534 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
539535 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
666662 # CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
667663
668664 ulw $8, 32765($9)
669 # CHECK-BE: addiu $1, $zero, 32765 # encoding: [0x24,0x01,0x7f,0xfd]
670 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
665 # CHECK-BE: addiu $1, $9, 32765 # encoding: [0x25,0x21,0x7f,0xfd]
671666 # CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00]
672667 # CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03]
673 # CHECK-LE: addiu $1, $zero, 32765 # encoding: [0xfd,0x7f,0x01,0x24]
674 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
668 # CHECK-LE: addiu $1, $9, 32765 # encoding: [0xfd,0x7f,0x21,0x25]
675669 # CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
676670 # CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
677671
672 ulw $8, 0($8)
673 # CHECK-BE: lwl $1, 0($8) # encoding: [0x89,0x01,0x00,0x00]
674 # CHECK-BE: lwr $1, 3($8) # encoding: [0x99,0x01,0x00,0x03]
675 # CHECK-BE: move $8, $1 # encoding: [0x00,0x20,0x40,0x25]
676 # CHECK-LE: lwl $1, 3($8) # encoding: [0x03,0x00,0x01,0x89]
677 # CHECK-LE: lwr $1, 0($8) # encoding: [0x00,0x00,0x01,0x99]
678 # CHECK-LE: move $8, $1 # encoding: [0x25,0x40,0x20,0x00]
679
680 ulw $8, 2($8)
681 # CHECK-BE: lwl $1, 2($8) # encoding: [0x89,0x01,0x00,0x02]
682 # CHECK-BE: lwr $1, 5($8) # encoding: [0x99,0x01,0x00,0x05]
683 # CHECK-BE: move $8, $1 # encoding: [0x00,0x20,0x40,0x25]
684 # CHECK-LE: lwl $1, 5($8) # encoding: [0x05,0x00,0x01,0x89]
685 # CHECK-LE: lwr $1, 2($8) # encoding: [0x02,0x00,0x01,0x99]
686 # CHECK-LE: move $8, $1 # encoding: [0x25,0x40,0x20,0x00]
687
688 ulw $8, 0x8000($8)
689 # CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
690 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
691 # CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00]
692 # CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03]
693 # CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
694 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
695 # CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
696 # CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
697
698 ulw $8, -0x8000($8)
699 # CHECK-BE: lwl $1, -32768($8) # encoding: [0x89,0x01,0x80,0x00]
700 # CHECK-BE: lwr $1, -32765($8) # encoding: [0x99,0x01,0x80,0x03]
701 # CHECK-BE: move $8, $1 # encoding: [0x00,0x20,0x40,0x25]
702 # CHECK-LE: lwl $1, -32765($8) # encoding: [0x03,0x80,0x01,0x89]
703 # CHECK-LE: lwr $1, -32768($8) # encoding: [0x00,0x80,0x01,0x99]
704 # CHECK-LE: move $8, $1 # encoding: [0x25,0x40,0x20,0x00]
705
706 ulw $8, 0x10000($8)
707 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
708 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
709 # CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00]
710 # CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03]
711 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
712 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
713 # CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
714 # CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
715
716 ulw $8, 0x18888($8)
717 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
718 # CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88]
719 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
720 # CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00]
721 # CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03]
722 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
723 # CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34]
724 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
725 # CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
726 # CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
727
728 ulw $8, -32771($8)
729 # CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff]
730 # CHECK-BE: ori $1, $1, 32765 # encoding: [0x34,0x21,0x7f,0xfd]
731 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
732 # CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00]
733 # CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03]
734 # CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c]
735 # CHECK-LE: ori $1, $1, 32765 # encoding: [0xfd,0x7f,0x21,0x34]
736 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
737 # CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
738 # CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
739
740 ulw $8, 32765($8)
741 # CHECK-BE: addiu $1, $8, 32765 # encoding: [0x25,0x01,0x7f,0xfd]
742 # CHECK-BE: lwl $8, 0($1) # encoding: [0x88,0x28,0x00,0x00]
743 # CHECK-BE: lwr $8, 3($1) # encoding: [0x98,0x28,0x00,0x03]
744 # CHECK-LE: addiu $1, $8, 32765 # encoding: [0xfd,0x7f,0x01,0x25]
745 # CHECK-LE: lwl $8, 3($1) # encoding: [0x03,0x00,0x28,0x88]
746 # CHECK-LE: lwr $8, 0($1) # encoding: [0x00,0x00,0x28,0x98]
747
748 ush_imm: # CHECK-LABEL: ush_imm
749 ush $8, 0
750 # CHECK-BE: sb $8, 1($zero) # encoding: [0xa0,0x08,0x00,0x01]
751 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
752 # CHECK-BE: sb $1, 0($zero) # encoding: [0xa0,0x01,0x00,0x00]
753 # CHECK-LE: sb $8, 0($zero) # encoding: [0x00,0x00,0x08,0xa0]
754 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
755 # CHECK-LE: sb $1, 1($zero) # encoding: [0x01,0x00,0x01,0xa0]
756
757 ush $8, 2
758 # CHECK-BE: sb $8, 3($zero) # encoding: [0xa0,0x08,0x00,0x03]
759 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
760 # CHECK-BE: sb $1, 2($zero) # encoding: [0xa0,0x01,0x00,0x02]
761 # CHECK-LE: sb $8, 2($zero) # encoding: [0x02,0x00,0x08,0xa0]
762 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
763 # CHECK-LE: sb $1, 3($zero) # encoding: [0x03,0x00,0x01,0xa0]
764
765 # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
766 ush $8, 0x8000
767 # CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
768 # CHECK-BE: move $1, $1 # encoding: [0x00,0x20,0x08,0x21]
769 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
770 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
771 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
772 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
773 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
774 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
775 # CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
776 # CHECK-LE: move $1, $1 # encoding: [0x21,0x08,0x20,0x00]
777 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
778 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
779 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
780 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
781 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
782 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
783
784 ush $8, -0x8000
785 # CHECK-BE: sb $8, -32767($zero) # encoding: [0xa0,0x08,0x80,0x01]
786 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
787 # CHECK-BE: sb $1, -32768($zero) # encoding: [0xa0,0x01,0x80,0x00]
788 # CHECK-LE: sb $8, -32768($zero) # encoding: [0x00,0x80,0x08,0xa0]
789 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
790 # CHECK-LE: sb $1, -32767($zero) # encoding: [0x01,0x80,0x01,0xa0]
791
792 # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
793 ush $8, 0x10000
794 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
795 # CHECK-BE: move $1, $1 # encoding: [0x00,0x20,0x08,0x21]
796 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
797 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
798 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
799 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
800 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
801 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
802 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
803 # CHECK-LE: move $1, $1 # encoding: [0x21,0x08,0x20,0x00]
804 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
805 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
806 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
807 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
808 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
809 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
810
811 # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
812 ush $8, 0x18888
813 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
814 # CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88]
815 # CHECK-BE: move $1, $1 # encoding: [0x00,0x20,0x08,0x21]
816 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
817 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
818 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
819 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
820 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
821 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
822 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
823 # CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34]
824 # CHECK-LE: move $1, $1 # encoding: [0x21,0x08,0x20,0x00]
825 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
826 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
827 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
828 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
829 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
830 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
831
832 # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
833 ush $8, -32769
834 # CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff]
835 # CHECK-BE: ori $1, $1, 32767 # encoding: [0x34,0x21,0x7f,0xff]
836 # CHECK-BE: move $1, $1 # encoding: [0x00,0x20,0x08,0x21]
837 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
838 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
839 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
840 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
841 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
842 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
843 # CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c]
844 # CHECK-LE: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34]
845 # CHECK-LE: move $1, $1 # encoding: [0x21,0x08,0x20,0x00]
846 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
847 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
848 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
849 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
850 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
851 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
852
853 ush $8, 32767
854 # CHECK-BE: addiu $1, $zero, 32767 # encoding: [0x24,0x01,0x7f,0xff]
855 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
856 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
857 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
858 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
859 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
860 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
861 # CHECK-LE: addiu $1, $zero, 32767 # encoding: [0xff,0x7f,0x01,0x24]
862 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
863 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
864 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
865 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
866 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
867 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
868
869 ush_reg: # CHECK-LABEL: ush_reg
870 ush $8, 0($9)
871 # CHECK-BE: sb $8, 1($9) # encoding: [0xa1,0x28,0x00,0x01]
872 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
873 # CHECK-BE: sb $1, 0($9) # encoding: [0xa1,0x21,0x00,0x00]
874 # CHECK-LE: sb $8, 0($9) # encoding: [0x00,0x00,0x28,0xa1]
875 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
876 # CHECK-LE: sb $1, 1($9) # encoding: [0x01,0x00,0x21,0xa1]
877
878 ush $8, 2($9)
879 # CHECK-BE: sb $8, 3($9) # encoding: [0xa1,0x28,0x00,0x03]
880 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
881 # CHECK-BE: sb $1, 2($9) # encoding: [0xa1,0x21,0x00,0x02]
882 # CHECK-LE: sb $8, 2($9) # encoding: [0x02,0x00,0x28,0xa1]
883 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
884 # CHECK-LE: sb $1, 3($9) # encoding: [0x03,0x00,0x21,0xa1]
885
886 ush $8, 0x8000($9)
887 # CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
888 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
889 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
890 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
891 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
892 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
893 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
894 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
895 # CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
896 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
897 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
898 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
899 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
900 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
901 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
902 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
903
904 ush $8, -0x8000($9)
905 # CHECK-BE: sb $8, -32767($9) # encoding: [0xa1,0x28,0x80,0x01]
906 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
907 # CHECK-BE: sb $1, -32768($9) # encoding: [0xa1,0x21,0x80,0x00]
908 # CHECK-LE: sb $8, -32768($9) # encoding: [0x00,0x80,0x28,0xa1]
909 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
910 # CHECK-LE: sb $1, -32767($9) # encoding: [0x01,0x80,0x21,0xa1]
911
912 ush $8, 0x10000($9)
913 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
914 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
915 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
916 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
917 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
918 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
919 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
920 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
921 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
922 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
923 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
924 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
925 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
926 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
927 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
928 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
929
930 ush $8, 0x18888($9)
931 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
932 # CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88]
933 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
934 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
935 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
936 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
937 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
938 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
939 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
940 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
941 # CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34]
942 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
943 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
944 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
945 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
946 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
947 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
948 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
949
950 ush $8, -32769($9)
951 # CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff]
952 # CHECK-BE: ori $1, $1, 32767 # encoding: [0x34,0x21,0x7f,0xff]
953 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
954 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
955 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
956 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
957 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
958 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
959 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
960 # CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c]
961 # CHECK-LE: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34]
962 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
963 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
964 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
965 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
966 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
967 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
968 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
969
970 ush $8, 32767($9)
971 # CHECK-BE: addiu $1, $9, 32767 # encoding: [0x25,0x21,0x7f,0xff]
972 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
973 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
974 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
975 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
976 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
977 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
978 # CHECK-LE: addiu $1, $9, 32767 # encoding: [0xff,0x7f,0x21,0x25]
979 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
980 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
981 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
982 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
983 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
984 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
985
986 ush $8, 0($8)
987 # CHECK-BE: sb $8, 1($8) # encoding: [0xa1,0x08,0x00,0x01]
988 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
989 # CHECK-BE: sb $1, 0($8) # encoding: [0xa1,0x01,0x00,0x00]
990 # CHECK-LE: sb $8, 0($8) # encoding: [0x00,0x00,0x08,0xa1]
991 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
992 # CHECK-LE: sb $1, 1($8) # encoding: [0x01,0x00,0x01,0xa1]
993
994 ush $8, 2($8)
995 # CHECK-BE: sb $8, 3($8) # encoding: [0xa1,0x08,0x00,0x03]
996 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
997 # CHECK-BE: sb $1, 2($8) # encoding: [0xa1,0x01,0x00,0x02]
998 # CHECK-LE: sb $8, 2($8) # encoding: [0x02,0x00,0x08,0xa1]
999 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
1000 # CHECK-LE: sb $1, 3($8) # encoding: [0x03,0x00,0x01,0xa1]
1001
1002 ush $8, 0x8000($8)
1003 # CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
1004 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
1005 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
1006 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
1007 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
1008 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
1009 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
1010 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
1011 # CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
1012 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
1013 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
1014 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
1015 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
1016 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
1017 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
1018 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
1019
1020 ush $8, -0x8000($8)
1021 # CHECK-BE: sb $8, -32767($8) # encoding: [0xa1,0x08,0x80,0x01]
1022 # CHECK-BE: srl $1, $8, 8 # encoding: [0x00,0x08,0x0a,0x02]
1023 # CHECK-BE: sb $1, -32768($8) # encoding: [0xa1,0x01,0x80,0x00]
1024 # CHECK-LE: sb $8, -32768($8) # encoding: [0x00,0x80,0x08,0xa1]
1025 # CHECK-LE: srl $1, $8, 8 # encoding: [0x02,0x0a,0x08,0x00]
1026 # CHECK-LE: sb $1, -32767($8) # encoding: [0x01,0x80,0x01,0xa1]
1027
1028 ush $8, 0x10000($8)
1029 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
1030 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
1031 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
1032 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
1033 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
1034 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
1035 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
1036 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
1037 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
1038 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
1039 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
1040 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
1041 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
1042 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
1043 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
1044 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
1045
1046 ush $8, 0x18888($8)
1047 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
1048 # CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88]
1049 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
1050 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
1051 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
1052 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
1053 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
1054 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
1055 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
1056 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
1057 # CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34]
1058 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
1059 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
1060 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
1061 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
1062 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
1063 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
1064 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
1065
1066 ush $8, -32769($8)
1067 # CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff]
1068 # CHECK-BE: ori $1, $1, 32767 # encoding: [0x34,0x21,0x7f,0xff]
1069 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
1070 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
1071 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
1072 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
1073 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
1074 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
1075 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
1076 # CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c]
1077 # CHECK-LE: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34]
1078 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
1079 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
1080 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
1081 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
1082 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
1083 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
1084 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
1085
1086 ush $8, 32767($8)
1087 # CHECK-BE: addiu $1, $8, 32767 # encoding: [0x25,0x01,0x7f,0xff]
1088 # CHECK-BE: sb $8, 1($1) # encoding: [0xa0,0x28,0x00,0x01]
1089 # CHECK-BE: srl $8, $8, 8 # encoding: [0x00,0x08,0x42,0x02]
1090 # CHECK-BE: sb $8, 0($1) # encoding: [0xa0,0x28,0x00,0x00]
1091 # CHECK-BE: lbu $1, 0($1) # encoding: [0x90,0x21,0x00,0x00]
1092 # CHECK-BE: sll $8, $8, 8 # encoding: [0x00,0x08,0x42,0x00]
1093 # CHECK-BE: or $8, $8, $1 # encoding: [0x01,0x01,0x40,0x25]
1094 # CHECK-LE: addiu $1, $8, 32767 # encoding: [0xff,0x7f,0x01,0x25]
1095 # CHECK-LE: sb $8, 0($1) # encoding: [0x00,0x00,0x28,0xa0]
1096 # CHECK-LE: srl $8, $8, 8 # encoding: [0x02,0x42,0x08,0x00]
1097 # CHECK-LE: sb $8, 1($1) # encoding: [0x01,0x00,0x28,0xa0]
1098 # CHECK-LE: lbu $1, 0($1) # encoding: [0x00,0x00,0x21,0x90]
1099 # CHECK-LE: sll $8, $8, 8 # encoding: [0x00,0x42,0x08,0x00]
1100 # CHECK-LE: or $8, $8, $1 # encoding: [0x25,0x40,0x01,0x01]
1101
1102 usw_imm: # CHECK-LABEL: usw_imm:
1103 usw $8, 0
1104 # CHECK-BE: swl $8, 0($zero) # encoding: [0xa8,0x08,0x00,0x00]
1105 # CHECK-BE: swr $8, 3($zero) # encoding: [0xb8,0x08,0x00,0x03]
1106 # CHECK-LE: swl $8, 3($zero) # encoding: [0x03,0x00,0x08,0xa8]
1107 # CHECK-LE: swr $8, 0($zero) # encoding: [0x00,0x00,0x08,0xb8]
1108
1109 usw $8, 2
1110 # CHECK-BE: swl $8, 2($zero) # encoding: [0xa8,0x08,0x00,0x02]
1111 # CHECK-BE: swr $8, 5($zero) # encoding: [0xb8,0x08,0x00,0x05]
1112 # CHECK-LE: swl $8, 5($zero) # encoding: [0x05,0x00,0x08,0xa8]
1113 # CHECK-LE: swr $8, 2($zero) # encoding: [0x02,0x00,0x08,0xb8]
1114
1115 # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
1116 usw $8, 0x8000
1117 # CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
1118 # CHECK-BE: move $1, $1 # encoding: [0x00,0x20,0x08,0x21]
1119 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1120 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1121 # CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
1122 # CHECK-LE: move $1, $1 # encoding: [0x21,0x08,0x20,0x00]
1123 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1124 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1125
1126 usw $8, -0x8000
1127 # CHECK-BE: swl $8, -32768($zero) # encoding: [0xa8,0x08,0x80,0x00]
1128 # CHECK-BE: swr $8, -32765($zero) # encoding: [0xb8,0x08,0x80,0x03]
1129 # CHECK-LE: swl $8, -32765($zero) # encoding: [0x03,0x80,0x08,0xa8]
1130 # CHECK-LE: swr $8, -32768($zero) # encoding: [0x00,0x80,0x08,0xb8]
1131
1132 # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
1133 usw $8, 0x10000
1134 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
1135 # CHECK-BE: move $1, $1 # encoding: [0x00,0x20,0x08,0x21]
1136 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1137 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1138 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
1139 # CHECK-LE: move $1, $1 # encoding: [0x21,0x08,0x20,0x00]
1140 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1141 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1142
1143 # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
1144 usw $8, 0x18888
1145 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
1146 # CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88]
1147 # CHECK-BE: move $1, $1 # encoding: [0x00,0x20,0x08,0x21]
1148 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1149 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1150 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
1151 # CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34]
1152 # CHECK-LE: move $1, $1 # encoding: [0x21,0x08,0x20,0x00]
1153 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1154 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1155
1156 # FIXME: Remove the identity moves (move $1, $1) coming from loadImmediate
1157 usw $8, -32769
1158 # CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff]
1159 # CHECK-BE: ori $1, $1, 32767 # encoding: [0x34,0x21,0x7f,0xff]
1160 # CHECK-BE: move $1, $1 # encoding: [0x00,0x20,0x08,0x21]
1161 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1162 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1163 # CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c]
1164 # CHECK-LE: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34]
1165 # CHECK-LE: move $1, $1 # encoding: [0x21,0x08,0x20,0x00]
1166 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1167 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1168
1169 usw $8, 32767
1170 # CHECK-BE: addiu $1, $zero, 32767 # encoding: [0x24,0x01,0x7f,0xff]
1171 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1172 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1173 # CHECK-LE: addiu $1, $zero, 32767 # encoding: [0xff,0x7f,0x01,0x24]
1174 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1175 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1176
1177 usw_reg: # CHECK-LABEL: usw_reg:
1178 usw $8, 0($9)
1179 # CHECK-BE: swl $8, 0($9) # encoding: [0xa9,0x28,0x00,0x00]
1180 # CHECK-BE: swr $8, 3($9) # encoding: [0xb9,0x28,0x00,0x03]
1181 # CHECK-LE: swl $8, 3($9) # encoding: [0x03,0x00,0x28,0xa9]
1182 # CHECK-LE: swr $8, 0($9) # encoding: [0x00,0x00,0x28,0xb9]
1183
1184 usw $8, 2($9)
1185 # CHECK-BE: swl $8, 2($9) # encoding: [0xa9,0x28,0x00,0x02]
1186 # CHECK-BE: swr $8, 5($9) # encoding: [0xb9,0x28,0x00,0x05]
1187 # CHECK-LE: swl $8, 5($9) # encoding: [0x05,0x00,0x28,0xa9]
1188 # CHECK-LE: swr $8, 2($9) # encoding: [0x02,0x00,0x28,0xb9]
1189
1190 usw $8, 0x8000($9)
1191 # CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
1192 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
1193 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1194 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1195 # CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
1196 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
1197 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1198 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1199
1200 usw $8, -0x8000($9)
1201 # CHECK-BE: swl $8, -32768($9) # encoding: [0xa9,0x28,0x80,0x00]
1202 # CHECK-BE: swr $8, -32765($9) # encoding: [0xb9,0x28,0x80,0x03]
1203 # CHECK-LE: swl $8, -32765($9) # encoding: [0x03,0x80,0x28,0xa9]
1204 # CHECK-LE: swr $8, -32768($9) # encoding: [0x00,0x80,0x28,0xb9]
1205
1206 usw $8, 0x10000($9)
1207 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
1208 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
1209 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1210 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1211 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
1212 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
1213 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1214 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1215
1216 usw $8, 0x18888($9)
1217 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
1218 # CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88]
1219 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
1220 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1221 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1222 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
1223 # CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34]
1224 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
1225 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1226 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1227
1228 usw $8, -32769($9)
1229 # CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff]
1230 # CHECK-BE: ori $1, $1, 32767 # encoding: [0x34,0x21,0x7f,0xff]
1231 # CHECK-BE: addu $1, $1, $9 # encoding: [0x00,0x29,0x08,0x21]
1232 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1233 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1234 # CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c]
1235 # CHECK-LE: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34]
1236 # CHECK-LE: addu $1, $1, $9 # encoding: [0x21,0x08,0x29,0x00]
1237 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1238 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1239
1240 usw $8, 32767($9)
1241 # CHECK-BE: addiu $1, $9, 32767 # encoding: [0x25,0x21,0x7f,0xff]
1242 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1243 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1244 # CHECK-LE: addiu $1, $9, 32767 # encoding: [0xff,0x7f,0x21,0x25]
1245 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1246 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1247
1248 usw $8, 0($8)
1249 # CHECK-BE: swl $8, 0($8) # encoding: [0xa9,0x08,0x00,0x00]
1250 # CHECK-BE: swr $8, 3($8) # encoding: [0xb9,0x08,0x00,0x03]
1251 # CHECK-LE: swl $8, 3($8) # encoding: [0x03,0x00,0x08,0xa9]
1252 # CHECK-LE: swr $8, 0($8) # encoding: [0x00,0x00,0x08,0xb9]
1253
1254 usw $8, 2($8)
1255 # CHECK-BE: swl $8, 2($8) # encoding: [0xa9,0x08,0x00,0x02]
1256 # CHECK-BE: swr $8, 5($8) # encoding: [0xb9,0x08,0x00,0x05]
1257 # CHECK-LE: swl $8, 5($8) # encoding: [0x05,0x00,0x08,0xa9]
1258 # CHECK-LE: swr $8, 2($8) # encoding: [0x02,0x00,0x08,0xb9]
1259
1260 usw $8, 0x8000($8)
1261 # CHECK-BE: ori $1, $zero, 32768 # encoding: [0x34,0x01,0x80,0x00]
1262 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
1263 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1264 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1265 # CHECK-LE: ori $1, $zero, 32768 # encoding: [0x00,0x80,0x01,0x34]
1266 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
1267 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1268 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1269
1270 usw $8, -0x8000($8)
1271 # CHECK-BE: swl $8, -32768($8) # encoding: [0xa9,0x08,0x80,0x00]
1272 # CHECK-BE: swr $8, -32765($8) # encoding: [0xb9,0x08,0x80,0x03]
1273 # CHECK-LE: swl $8, -32765($8) # encoding: [0x03,0x80,0x08,0xa9]
1274 # CHECK-LE: swr $8, -32768($8) # encoding: [0x00,0x80,0x08,0xb9]
1275
1276 usw $8, 0x10000($8)
1277 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
1278 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
1279 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1280 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1281 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
1282 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
1283 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1284 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1285
1286 usw $8, 0x18888($8)
1287 # CHECK-BE: lui $1, 1 # encoding: [0x3c,0x01,0x00,0x01]
1288 # CHECK-BE: ori $1, $1, 34952 # encoding: [0x34,0x21,0x88,0x88]
1289 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
1290 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1291 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1292 # CHECK-LE: lui $1, 1 # encoding: [0x01,0x00,0x01,0x3c]
1293 # CHECK-LE: ori $1, $1, 34952 # encoding: [0x88,0x88,0x21,0x34]
1294 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
1295 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1296 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1297
1298 usw $8, -32769($8)
1299 # CHECK-BE: lui $1, 65535 # encoding: [0x3c,0x01,0xff,0xff]
1300 # CHECK-BE: ori $1, $1, 32767 # encoding: [0x34,0x21,0x7f,0xff]
1301 # CHECK-BE: addu $1, $1, $8 # encoding: [0x00,0x28,0x08,0x21]
1302 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1303 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1304 # CHECK-LE: lui $1, 65535 # encoding: [0xff,0xff,0x01,0x3c]
1305 # CHECK-LE: ori $1, $1, 32767 # encoding: [0xff,0x7f,0x21,0x34]
1306 # CHECK-LE: addu $1, $1, $8 # encoding: [0x21,0x08,0x28,0x00]
1307 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1308 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1309
1310 usw $8, 32767($8)
1311 # CHECK-BE: addiu $1, $8, 32767 # encoding: [0x25,0x01,0x7f,0xff]
1312 # CHECK-BE: swl $8, 0($1) # encoding: [0xa8,0x28,0x00,0x00]
1313 # CHECK-BE: swr $8, 3($1) # encoding: [0xb8,0x28,0x00,0x03]
1314 # CHECK-LE: addiu $1, $8, 32767 # encoding: [0xff,0x7f,0x01,0x25]
1315 # CHECK-LE: swl $8, 3($1) # encoding: [0x03,0x00,0x28,0xa8]
1316 # CHECK-LE: swr $8, 0($1) # encoding: [0x00,0x00,0x28,0xb8]
1317
6781318 1:
6791319 add $4, $4, $4