interrupt-attr-nocall.ll 26.9 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple riscv32-unknown-elf -o - %s \
; RUN: 2>&1 | FileCheck %s -check-prefix CHECK-RV32
; RUN: llc -mtriple riscv32-unknown-elf -mattr=+f -o - %s \
; RUN: 2>&1 | FileCheck %s -check-prefix CHECK-RV32IF
; RUN: llc -mtriple riscv32-unknown-elf -mattr=+f,+d -o - %s \
; RUN: 2>&1 | FileCheck %s -check-prefix CHECK-RV32IFD
;
; TODO: Add RV64 tests when we can lower global addresses.

; Checking all registers that are used are being saved.
; This includes Caller (arguments and temps) and
; Callee saved registers.
;
; extern int a, b, c;
; __attribute__((interrupt)) void foo_no_call(void) {
;   c = a + b;
; }
;

@a = external global i32
@b = external global i32
@c = external global i32

define void @foo_i32() nounwind #0 {
; CHECK-RV32-LABEL: foo_i32:
; CHECK-RV32:       # %bb.0:
; CHECK-RV32-NEXT:    addi sp, sp, -16
; CHECK-RV32-NEXT:    sw a0, 12(sp)
; CHECK-RV32-NEXT:    sw a1, 8(sp)
; CHECK-RV32-NEXT:    lui a0, %hi(a)
; CHECK-RV32-NEXT:    lw a0, %lo(a)(a0)
; CHECK-RV32-NEXT:    lui a1, %hi(b)
; CHECK-RV32-NEXT:    lw a1, %lo(b)(a1)
; CHECK-RV32-NEXT:    add a0, a1, a0
; CHECK-RV32-NEXT:    lui a1, %hi(c)
; CHECK-RV32-NEXT:    sw a0, %lo(c)(a1)
; CHECK-RV32-NEXT:    lw a1, 8(sp)
; CHECK-RV32-NEXT:    lw a0, 12(sp)
; CHECK-RV32-NEXT:    addi sp, sp, 16
; CHECK-RV32-NEXT:    mret
;
; CHECK-RV32IF-LABEL: foo_i32:
; CHECK-RV32IF:       # %bb.0:
; CHECK-RV32IF-NEXT:    addi sp, sp, -16
; CHECK-RV32IF-NEXT:    sw a0, 12(sp)
; CHECK-RV32IF-NEXT:    sw a1, 8(sp)
; CHECK-RV32IF-NEXT:    lui a0, %hi(a)
; CHECK-RV32IF-NEXT:    lw a0, %lo(a)(a0)
; CHECK-RV32IF-NEXT:    lui a1, %hi(b)
; CHECK-RV32IF-NEXT:    lw a1, %lo(b)(a1)
; CHECK-RV32IF-NEXT:    add a0, a1, a0
; CHECK-RV32IF-NEXT:    lui a1, %hi(c)
; CHECK-RV32IF-NEXT:    sw a0, %lo(c)(a1)
; CHECK-RV32IF-NEXT:    lw a1, 8(sp)
; CHECK-RV32IF-NEXT:    lw a0, 12(sp)
; CHECK-RV32IF-NEXT:    addi sp, sp, 16
; CHECK-RV32IF-NEXT:    mret
;
; CHECK-RV32IFD-LABEL: foo_i32:
; CHECK-RV32IFD:       # %bb.0:
; CHECK-RV32IFD-NEXT:    addi sp, sp, -16
; CHECK-RV32IFD-NEXT:    sw a0, 12(sp)
; CHECK-RV32IFD-NEXT:    sw a1, 8(sp)
; CHECK-RV32IFD-NEXT:    lui a0, %hi(a)
; CHECK-RV32IFD-NEXT:    lw a0, %lo(a)(a0)
; CHECK-RV32IFD-NEXT:    lui a1, %hi(b)
; CHECK-RV32IFD-NEXT:    lw a1, %lo(b)(a1)
; CHECK-RV32IFD-NEXT:    add a0, a1, a0
; CHECK-RV32IFD-NEXT:    lui a1, %hi(c)
; CHECK-RV32IFD-NEXT:    sw a0, %lo(c)(a1)
; CHECK-RV32IFD-NEXT:    lw a1, 8(sp)
; CHECK-RV32IFD-NEXT:    lw a0, 12(sp)
; CHECK-RV32IFD-NEXT:    addi sp, sp, 16
; CHECK-RV32IFD-NEXT:    mret
  %1 = load i32, i32* @a
  %2 = load i32, i32* @b
  %add = add nsw i32 %2, %1
  store i32 %add, i32* @c
  ret void
}

;
; Additionally check frame pointer and return address are properly saved.
;

define void @foo_fp_i32() nounwind #1 {
; CHECK-RV32-LABEL: foo_fp_i32:
; CHECK-RV32:       # %bb.0:
; CHECK-RV32-NEXT:    addi sp, sp, -16
; CHECK-RV32-NEXT:    sw ra, 12(sp)
; CHECK-RV32-NEXT:    sw s0, 8(sp)
; CHECK-RV32-NEXT:    sw a0, 4(sp)
; CHECK-RV32-NEXT:    sw a1, 0(sp)
; CHECK-RV32-NEXT:    addi s0, sp, 16
; CHECK-RV32-NEXT:    lui a0, %hi(a)
; CHECK-RV32-NEXT:    lw a0, %lo(a)(a0)
; CHECK-RV32-NEXT:    lui a1, %hi(b)
; CHECK-RV32-NEXT:    lw a1, %lo(b)(a1)
; CHECK-RV32-NEXT:    add a0, a1, a0
; CHECK-RV32-NEXT:    lui a1, %hi(c)
; CHECK-RV32-NEXT:    sw a0, %lo(c)(a1)
; CHECK-RV32-NEXT:    lw a1, 0(sp)
; CHECK-RV32-NEXT:    lw a0, 4(sp)
; CHECK-RV32-NEXT:    lw s0, 8(sp)
; CHECK-RV32-NEXT:    lw ra, 12(sp)
; CHECK-RV32-NEXT:    addi sp, sp, 16
; CHECK-RV32-NEXT:    mret
;
; CHECK-RV32IF-LABEL: foo_fp_i32:
; CHECK-RV32IF:       # %bb.0:
; CHECK-RV32IF-NEXT:    addi sp, sp, -16
; CHECK-RV32IF-NEXT:    sw ra, 12(sp)
; CHECK-RV32IF-NEXT:    sw s0, 8(sp)
; CHECK-RV32IF-NEXT:    sw a0, 4(sp)
; CHECK-RV32IF-NEXT:    sw a1, 0(sp)
; CHECK-RV32IF-NEXT:    addi s0, sp, 16
; CHECK-RV32IF-NEXT:    lui a0, %hi(a)
; CHECK-RV32IF-NEXT:    lw a0, %lo(a)(a0)
; CHECK-RV32IF-NEXT:    lui a1, %hi(b)
; CHECK-RV32IF-NEXT:    lw a1, %lo(b)(a1)
; CHECK-RV32IF-NEXT:    add a0, a1, a0
; CHECK-RV32IF-NEXT:    lui a1, %hi(c)
; CHECK-RV32IF-NEXT:    sw a0, %lo(c)(a1)
; CHECK-RV32IF-NEXT:    lw a1, 0(sp)
; CHECK-RV32IF-NEXT:    lw a0, 4(sp)
; CHECK-RV32IF-NEXT:    lw s0, 8(sp)
; CHECK-RV32IF-NEXT:    lw ra, 12(sp)
; CHECK-RV32IF-NEXT:    addi sp, sp, 16
; CHECK-RV32IF-NEXT:    mret
;
; CHECK-RV32IFD-LABEL: foo_fp_i32:
; CHECK-RV32IFD:       # %bb.0:
; CHECK-RV32IFD-NEXT:    addi sp, sp, -16
; CHECK-RV32IFD-NEXT:    sw ra, 12(sp)
; CHECK-RV32IFD-NEXT:    sw s0, 8(sp)
; CHECK-RV32IFD-NEXT:    sw a0, 4(sp)
; CHECK-RV32IFD-NEXT:    sw a1, 0(sp)
; CHECK-RV32IFD-NEXT:    addi s0, sp, 16
; CHECK-RV32IFD-NEXT:    lui a0, %hi(a)
; CHECK-RV32IFD-NEXT:    lw a0, %lo(a)(a0)
; CHECK-RV32IFD-NEXT:    lui a1, %hi(b)
; CHECK-RV32IFD-NEXT:    lw a1, %lo(b)(a1)
; CHECK-RV32IFD-NEXT:    add a0, a1, a0
; CHECK-RV32IFD-NEXT:    lui a1, %hi(c)
; CHECK-RV32IFD-NEXT:    sw a0, %lo(c)(a1)
; CHECK-RV32IFD-NEXT:    lw a1, 0(sp)
; CHECK-RV32IFD-NEXT:    lw a0, 4(sp)
; CHECK-RV32IFD-NEXT:    lw s0, 8(sp)
; CHECK-RV32IFD-NEXT:    lw ra, 12(sp)
; CHECK-RV32IFD-NEXT:    addi sp, sp, 16
; CHECK-RV32IFD-NEXT:    mret
  %1 = load i32, i32* @a
  %2 = load i32, i32* @b
  %add = add nsw i32 %2, %1
  store i32 %add, i32* @c
  ret void
}

@e = external global float
@f = external global float
@d = external global float

define void @foo_float() nounwind #0 {
; CHECK-RV32-LABEL: foo_float:
; CHECK-RV32:       # %bb.0:
; CHECK-RV32-NEXT:    addi sp, sp, -64
; CHECK-RV32-NEXT:    sw ra, 60(sp)
; CHECK-RV32-NEXT:    sw t0, 56(sp)
; CHECK-RV32-NEXT:    sw t1, 52(sp)
; CHECK-RV32-NEXT:    sw t2, 48(sp)
; CHECK-RV32-NEXT:    sw a0, 44(sp)
; CHECK-RV32-NEXT:    sw a1, 40(sp)
; CHECK-RV32-NEXT:    sw a2, 36(sp)
; CHECK-RV32-NEXT:    sw a3, 32(sp)
; CHECK-RV32-NEXT:    sw a4, 28(sp)
; CHECK-RV32-NEXT:    sw a5, 24(sp)
; CHECK-RV32-NEXT:    sw a6, 20(sp)
; CHECK-RV32-NEXT:    sw a7, 16(sp)
; CHECK-RV32-NEXT:    sw t3, 12(sp)
; CHECK-RV32-NEXT:    sw t4, 8(sp)
; CHECK-RV32-NEXT:    sw t5, 4(sp)
; CHECK-RV32-NEXT:    sw t6, 0(sp)
; CHECK-RV32-NEXT:    lui a0, %hi(e)
; CHECK-RV32-NEXT:    lw a0, %lo(e)(a0)
; CHECK-RV32-NEXT:    lui a1, %hi(f)
; CHECK-RV32-NEXT:    lw a1, %lo(f)(a1)
; CHECK-RV32-NEXT:    call __addsf3
; CHECK-RV32-NEXT:    lui a1, %hi(d)
; CHECK-RV32-NEXT:    sw a0, %lo(d)(a1)
; CHECK-RV32-NEXT:    lw t6, 0(sp)
; CHECK-RV32-NEXT:    lw t5, 4(sp)
; CHECK-RV32-NEXT:    lw t4, 8(sp)
; CHECK-RV32-NEXT:    lw t3, 12(sp)
; CHECK-RV32-NEXT:    lw a7, 16(sp)
; CHECK-RV32-NEXT:    lw a6, 20(sp)
; CHECK-RV32-NEXT:    lw a5, 24(sp)
; CHECK-RV32-NEXT:    lw a4, 28(sp)
; CHECK-RV32-NEXT:    lw a3, 32(sp)
; CHECK-RV32-NEXT:    lw a2, 36(sp)
; CHECK-RV32-NEXT:    lw a1, 40(sp)
; CHECK-RV32-NEXT:    lw a0, 44(sp)
; CHECK-RV32-NEXT:    lw t2, 48(sp)
; CHECK-RV32-NEXT:    lw t1, 52(sp)
; CHECK-RV32-NEXT:    lw t0, 56(sp)
; CHECK-RV32-NEXT:    lw ra, 60(sp)
; CHECK-RV32-NEXT:    addi sp, sp, 64
; CHECK-RV32-NEXT:    mret
;
; CHECK-RV32IF-LABEL: foo_float:
; CHECK-RV32IF:       # %bb.0:
; CHECK-RV32IF-NEXT:    addi sp, sp, -16
; CHECK-RV32IF-NEXT:    sw a0, 12(sp)
; CHECK-RV32IF-NEXT:    fsw ft0, 8(sp)
; CHECK-RV32IF-NEXT:    fsw ft1, 4(sp)
; CHECK-RV32IF-NEXT:    lui a0, %hi(e)
; CHECK-RV32IF-NEXT:    flw ft0, %lo(e)(a0)
; CHECK-RV32IF-NEXT:    lui a0, %hi(f)
; CHECK-RV32IF-NEXT:    flw ft1, %lo(f)(a0)
; CHECK-RV32IF-NEXT:    fadd.s ft0, ft0, ft1
; CHECK-RV32IF-NEXT:    lui a0, %hi(d)
; CHECK-RV32IF-NEXT:    fsw ft0, %lo(d)(a0)
; CHECK-RV32IF-NEXT:    flw ft1, 4(sp)
; CHECK-RV32IF-NEXT:    flw ft0, 8(sp)
; CHECK-RV32IF-NEXT:    lw a0, 12(sp)
; CHECK-RV32IF-NEXT:    addi sp, sp, 16
; CHECK-RV32IF-NEXT:    mret
;
; CHECK-RV32IFD-LABEL: foo_float:
; CHECK-RV32IFD:       # %bb.0:
; CHECK-RV32IFD-NEXT:    addi sp, sp, -32
; CHECK-RV32IFD-NEXT:    sw a0, 28(sp)
; CHECK-RV32IFD-NEXT:    fsd ft0, 16(sp)
; CHECK-RV32IFD-NEXT:    fsd ft1, 8(sp)
; CHECK-RV32IFD-NEXT:    lui a0, %hi(e)
; CHECK-RV32IFD-NEXT:    flw ft0, %lo(e)(a0)
; CHECK-RV32IFD-NEXT:    lui a0, %hi(f)
; CHECK-RV32IFD-NEXT:    flw ft1, %lo(f)(a0)
; CHECK-RV32IFD-NEXT:    fadd.s ft0, ft0, ft1
; CHECK-RV32IFD-NEXT:    lui a0, %hi(d)
; CHECK-RV32IFD-NEXT:    fsw ft0, %lo(d)(a0)
; CHECK-RV32IFD-NEXT:    fld ft1, 8(sp)
; CHECK-RV32IFD-NEXT:    fld ft0, 16(sp)
; CHECK-RV32IFD-NEXT:    lw a0, 28(sp)
; CHECK-RV32IFD-NEXT:    addi sp, sp, 32
; CHECK-RV32IFD-NEXT:    mret
  %1 = load float, float* @e
  %2 = load float, float* @f
  %add = fadd float %1, %2
  store float %add, float* @d
  ret void
}

;
; Additionally check frame pointer and return address are properly saved.
;
define void @foo_fp_float() nounwind #1 {
; CHECK-RV32-LABEL: foo_fp_float:
; CHECK-RV32:       # %bb.0:
; CHECK-RV32-NEXT:    addi sp, sp, -80
; CHECK-RV32-NEXT:    sw ra, 76(sp)
; CHECK-RV32-NEXT:    sw t0, 72(sp)
; CHECK-RV32-NEXT:    sw t1, 68(sp)
; CHECK-RV32-NEXT:    sw t2, 64(sp)
; CHECK-RV32-NEXT:    sw s0, 60(sp)
; CHECK-RV32-NEXT:    sw a0, 56(sp)
; CHECK-RV32-NEXT:    sw a1, 52(sp)
; CHECK-RV32-NEXT:    sw a2, 48(sp)
; CHECK-RV32-NEXT:    sw a3, 44(sp)
; CHECK-RV32-NEXT:    sw a4, 40(sp)
; CHECK-RV32-NEXT:    sw a5, 36(sp)
; CHECK-RV32-NEXT:    sw a6, 32(sp)
; CHECK-RV32-NEXT:    sw a7, 28(sp)
; CHECK-RV32-NEXT:    sw t3, 24(sp)
; CHECK-RV32-NEXT:    sw t4, 20(sp)
; CHECK-RV32-NEXT:    sw t5, 16(sp)
; CHECK-RV32-NEXT:    sw t6, 12(sp)
; CHECK-RV32-NEXT:    addi s0, sp, 80
; CHECK-RV32-NEXT:    lui a0, %hi(e)
; CHECK-RV32-NEXT:    lw a0, %lo(e)(a0)
; CHECK-RV32-NEXT:    lui a1, %hi(f)
; CHECK-RV32-NEXT:    lw a1, %lo(f)(a1)
; CHECK-RV32-NEXT:    call __addsf3
; CHECK-RV32-NEXT:    lui a1, %hi(d)
; CHECK-RV32-NEXT:    sw a0, %lo(d)(a1)
; CHECK-RV32-NEXT:    lw t6, 12(sp)
; CHECK-RV32-NEXT:    lw t5, 16(sp)
; CHECK-RV32-NEXT:    lw t4, 20(sp)
; CHECK-RV32-NEXT:    lw t3, 24(sp)
; CHECK-RV32-NEXT:    lw a7, 28(sp)
; CHECK-RV32-NEXT:    lw a6, 32(sp)
; CHECK-RV32-NEXT:    lw a5, 36(sp)
; CHECK-RV32-NEXT:    lw a4, 40(sp)
; CHECK-RV32-NEXT:    lw a3, 44(sp)
; CHECK-RV32-NEXT:    lw a2, 48(sp)
; CHECK-RV32-NEXT:    lw a1, 52(sp)
; CHECK-RV32-NEXT:    lw a0, 56(sp)
; CHECK-RV32-NEXT:    lw s0, 60(sp)
; CHECK-RV32-NEXT:    lw t2, 64(sp)
; CHECK-RV32-NEXT:    lw t1, 68(sp)
; CHECK-RV32-NEXT:    lw t0, 72(sp)
; CHECK-RV32-NEXT:    lw ra, 76(sp)
; CHECK-RV32-NEXT:    addi sp, sp, 80
; CHECK-RV32-NEXT:    mret
;
; CHECK-RV32IF-LABEL: foo_fp_float:
; CHECK-RV32IF:       # %bb.0:
; CHECK-RV32IF-NEXT:    addi sp, sp, -32
; CHECK-RV32IF-NEXT:    sw ra, 28(sp)
; CHECK-RV32IF-NEXT:    sw s0, 24(sp)
; CHECK-RV32IF-NEXT:    sw a0, 20(sp)
; CHECK-RV32IF-NEXT:    fsw ft0, 16(sp)
; CHECK-RV32IF-NEXT:    fsw ft1, 12(sp)
; CHECK-RV32IF-NEXT:    addi s0, sp, 32
; CHECK-RV32IF-NEXT:    lui a0, %hi(e)
; CHECK-RV32IF-NEXT:    flw ft0, %lo(e)(a0)
; CHECK-RV32IF-NEXT:    lui a0, %hi(f)
; CHECK-RV32IF-NEXT:    flw ft1, %lo(f)(a0)
; CHECK-RV32IF-NEXT:    fadd.s ft0, ft0, ft1
; CHECK-RV32IF-NEXT:    lui a0, %hi(d)
; CHECK-RV32IF-NEXT:    fsw ft0, %lo(d)(a0)
; CHECK-RV32IF-NEXT:    flw ft1, 12(sp)
; CHECK-RV32IF-NEXT:    flw ft0, 16(sp)
; CHECK-RV32IF-NEXT:    lw a0, 20(sp)
; CHECK-RV32IF-NEXT:    lw s0, 24(sp)
; CHECK-RV32IF-NEXT:    lw ra, 28(sp)
; CHECK-RV32IF-NEXT:    addi sp, sp, 32
; CHECK-RV32IF-NEXT:    mret
;
; CHECK-RV32IFD-LABEL: foo_fp_float:
; CHECK-RV32IFD:       # %bb.0:
; CHECK-RV32IFD-NEXT:    addi sp, sp, -32
; CHECK-RV32IFD-NEXT:    sw ra, 28(sp)
; CHECK-RV32IFD-NEXT:    sw s0, 24(sp)
; CHECK-RV32IFD-NEXT:    sw a0, 20(sp)
; CHECK-RV32IFD-NEXT:    fsd ft0, 8(sp)
; CHECK-RV32IFD-NEXT:    fsd ft1, 0(sp)
; CHECK-RV32IFD-NEXT:    addi s0, sp, 32
; CHECK-RV32IFD-NEXT:    lui a0, %hi(e)
; CHECK-RV32IFD-NEXT:    flw ft0, %lo(e)(a0)
; CHECK-RV32IFD-NEXT:    lui a0, %hi(f)
; CHECK-RV32IFD-NEXT:    flw ft1, %lo(f)(a0)
; CHECK-RV32IFD-NEXT:    fadd.s ft0, ft0, ft1
; CHECK-RV32IFD-NEXT:    lui a0, %hi(d)
; CHECK-RV32IFD-NEXT:    fsw ft0, %lo(d)(a0)
; CHECK-RV32IFD-NEXT:    fld ft1, 0(sp)
; CHECK-RV32IFD-NEXT:    fld ft0, 8(sp)
; CHECK-RV32IFD-NEXT:    lw a0, 20(sp)
; CHECK-RV32IFD-NEXT:    lw s0, 24(sp)
; CHECK-RV32IFD-NEXT:    lw ra, 28(sp)
; CHECK-RV32IFD-NEXT:    addi sp, sp, 32
; CHECK-RV32IFD-NEXT:    mret
  %1 = load float, float* @e
  %2 = load float, float* @f
  %add = fadd float %1, %2
  store float %add, float* @d
  ret void
}

@h = external global double
@i = external global double
@g = external global double

define void @foo_double() nounwind #0 {
; CHECK-RV32-LABEL: foo_double:
; CHECK-RV32:       # %bb.0:
; CHECK-RV32-NEXT:    addi sp, sp, -64
; CHECK-RV32-NEXT:    sw ra, 60(sp)
; CHECK-RV32-NEXT:    sw t0, 56(sp)
; CHECK-RV32-NEXT:    sw t1, 52(sp)
; CHECK-RV32-NEXT:    sw t2, 48(sp)
; CHECK-RV32-NEXT:    sw a0, 44(sp)
; CHECK-RV32-NEXT:    sw a1, 40(sp)
; CHECK-RV32-NEXT:    sw a2, 36(sp)
; CHECK-RV32-NEXT:    sw a3, 32(sp)
; CHECK-RV32-NEXT:    sw a4, 28(sp)
; CHECK-RV32-NEXT:    sw a5, 24(sp)
; CHECK-RV32-NEXT:    sw a6, 20(sp)
; CHECK-RV32-NEXT:    sw a7, 16(sp)
; CHECK-RV32-NEXT:    sw t3, 12(sp)
; CHECK-RV32-NEXT:    sw t4, 8(sp)
; CHECK-RV32-NEXT:    sw t5, 4(sp)
; CHECK-RV32-NEXT:    sw t6, 0(sp)
; CHECK-RV32-NEXT:    lui a1, %hi(h)
; CHECK-RV32-NEXT:    lw a0, %lo(h)(a1)
; CHECK-RV32-NEXT:    addi a1, a1, %lo(h)
; CHECK-RV32-NEXT:    lw a1, 4(a1)
; CHECK-RV32-NEXT:    lui a3, %hi(i)
; CHECK-RV32-NEXT:    lw a2, %lo(i)(a3)
; CHECK-RV32-NEXT:    addi a3, a3, %lo(i)
; CHECK-RV32-NEXT:    lw a3, 4(a3)
; CHECK-RV32-NEXT:    call __adddf3
; CHECK-RV32-NEXT:    lui a2, %hi(g)
; CHECK-RV32-NEXT:    addi a3, a2, %lo(g)
; CHECK-RV32-NEXT:    sw a1, 4(a3)
; CHECK-RV32-NEXT:    sw a0, %lo(g)(a2)
; CHECK-RV32-NEXT:    lw t6, 0(sp)
; CHECK-RV32-NEXT:    lw t5, 4(sp)
; CHECK-RV32-NEXT:    lw t4, 8(sp)
; CHECK-RV32-NEXT:    lw t3, 12(sp)
; CHECK-RV32-NEXT:    lw a7, 16(sp)
; CHECK-RV32-NEXT:    lw a6, 20(sp)
; CHECK-RV32-NEXT:    lw a5, 24(sp)
; CHECK-RV32-NEXT:    lw a4, 28(sp)
; CHECK-RV32-NEXT:    lw a3, 32(sp)
; CHECK-RV32-NEXT:    lw a2, 36(sp)
; CHECK-RV32-NEXT:    lw a1, 40(sp)
; CHECK-RV32-NEXT:    lw a0, 44(sp)
; CHECK-RV32-NEXT:    lw t2, 48(sp)
; CHECK-RV32-NEXT:    lw t1, 52(sp)
; CHECK-RV32-NEXT:    lw t0, 56(sp)
; CHECK-RV32-NEXT:    lw ra, 60(sp)
; CHECK-RV32-NEXT:    addi sp, sp, 64
; CHECK-RV32-NEXT:    mret
;
; CHECK-RV32IF-LABEL: foo_double:
; CHECK-RV32IF:       # %bb.0:
; CHECK-RV32IF-NEXT:    addi sp, sp, -192
; CHECK-RV32IF-NEXT:    sw ra, 188(sp)
; CHECK-RV32IF-NEXT:    sw t0, 184(sp)
; CHECK-RV32IF-NEXT:    sw t1, 180(sp)
; CHECK-RV32IF-NEXT:    sw t2, 176(sp)
; CHECK-RV32IF-NEXT:    sw a0, 172(sp)
; CHECK-RV32IF-NEXT:    sw a1, 168(sp)
; CHECK-RV32IF-NEXT:    sw a2, 164(sp)
; CHECK-RV32IF-NEXT:    sw a3, 160(sp)
; CHECK-RV32IF-NEXT:    sw a4, 156(sp)
; CHECK-RV32IF-NEXT:    sw a5, 152(sp)
; CHECK-RV32IF-NEXT:    sw a6, 148(sp)
; CHECK-RV32IF-NEXT:    sw a7, 144(sp)
; CHECK-RV32IF-NEXT:    sw t3, 140(sp)
; CHECK-RV32IF-NEXT:    sw t4, 136(sp)
; CHECK-RV32IF-NEXT:    sw t5, 132(sp)
; CHECK-RV32IF-NEXT:    sw t6, 128(sp)
; CHECK-RV32IF-NEXT:    fsw ft0, 124(sp)
; CHECK-RV32IF-NEXT:    fsw ft1, 120(sp)
; CHECK-RV32IF-NEXT:    fsw ft2, 116(sp)
; CHECK-RV32IF-NEXT:    fsw ft3, 112(sp)
; CHECK-RV32IF-NEXT:    fsw ft4, 108(sp)
; CHECK-RV32IF-NEXT:    fsw ft5, 104(sp)
; CHECK-RV32IF-NEXT:    fsw ft6, 100(sp)
; CHECK-RV32IF-NEXT:    fsw ft7, 96(sp)
; CHECK-RV32IF-NEXT:    fsw fa0, 92(sp)
; CHECK-RV32IF-NEXT:    fsw fa1, 88(sp)
; CHECK-RV32IF-NEXT:    fsw fa2, 84(sp)
; CHECK-RV32IF-NEXT:    fsw fa3, 80(sp)
; CHECK-RV32IF-NEXT:    fsw fa4, 76(sp)
; CHECK-RV32IF-NEXT:    fsw fa5, 72(sp)
; CHECK-RV32IF-NEXT:    fsw fa6, 68(sp)
; CHECK-RV32IF-NEXT:    fsw fa7, 64(sp)
; CHECK-RV32IF-NEXT:    fsw ft8, 60(sp)
; CHECK-RV32IF-NEXT:    fsw ft9, 56(sp)
; CHECK-RV32IF-NEXT:    fsw ft10, 52(sp)
; CHECK-RV32IF-NEXT:    fsw ft11, 48(sp)
; CHECK-RV32IF-NEXT:    fsw fs0, 44(sp)
; CHECK-RV32IF-NEXT:    fsw fs1, 40(sp)
; CHECK-RV32IF-NEXT:    fsw fs2, 36(sp)
; CHECK-RV32IF-NEXT:    fsw fs3, 32(sp)
; CHECK-RV32IF-NEXT:    fsw fs4, 28(sp)
; CHECK-RV32IF-NEXT:    fsw fs5, 24(sp)
; CHECK-RV32IF-NEXT:    fsw fs6, 20(sp)
; CHECK-RV32IF-NEXT:    fsw fs7, 16(sp)
; CHECK-RV32IF-NEXT:    fsw fs8, 12(sp)
; CHECK-RV32IF-NEXT:    fsw fs9, 8(sp)
; CHECK-RV32IF-NEXT:    fsw fs10, 4(sp)
; CHECK-RV32IF-NEXT:    fsw fs11, 0(sp)
; CHECK-RV32IF-NEXT:    lui a1, %hi(h)
; CHECK-RV32IF-NEXT:    lw a0, %lo(h)(a1)
; CHECK-RV32IF-NEXT:    addi a1, a1, %lo(h)
; CHECK-RV32IF-NEXT:    lw a1, 4(a1)
; CHECK-RV32IF-NEXT:    lui a3, %hi(i)
; CHECK-RV32IF-NEXT:    lw a2, %lo(i)(a3)
; CHECK-RV32IF-NEXT:    addi a3, a3, %lo(i)
; CHECK-RV32IF-NEXT:    lw a3, 4(a3)
; CHECK-RV32IF-NEXT:    call __adddf3
; CHECK-RV32IF-NEXT:    lui a2, %hi(g)
; CHECK-RV32IF-NEXT:    addi a3, a2, %lo(g)
; CHECK-RV32IF-NEXT:    sw a1, 4(a3)
; CHECK-RV32IF-NEXT:    sw a0, %lo(g)(a2)
; CHECK-RV32IF-NEXT:    flw fs11, 0(sp)
; CHECK-RV32IF-NEXT:    flw fs10, 4(sp)
; CHECK-RV32IF-NEXT:    flw fs9, 8(sp)
; CHECK-RV32IF-NEXT:    flw fs8, 12(sp)
; CHECK-RV32IF-NEXT:    flw fs7, 16(sp)
; CHECK-RV32IF-NEXT:    flw fs6, 20(sp)
; CHECK-RV32IF-NEXT:    flw fs5, 24(sp)
; CHECK-RV32IF-NEXT:    flw fs4, 28(sp)
; CHECK-RV32IF-NEXT:    flw fs3, 32(sp)
; CHECK-RV32IF-NEXT:    flw fs2, 36(sp)
; CHECK-RV32IF-NEXT:    flw fs1, 40(sp)
; CHECK-RV32IF-NEXT:    flw fs0, 44(sp)
; CHECK-RV32IF-NEXT:    flw ft11, 48(sp)
; CHECK-RV32IF-NEXT:    flw ft10, 52(sp)
; CHECK-RV32IF-NEXT:    flw ft9, 56(sp)
; CHECK-RV32IF-NEXT:    flw ft8, 60(sp)
; CHECK-RV32IF-NEXT:    flw fa7, 64(sp)
; CHECK-RV32IF-NEXT:    flw fa6, 68(sp)
; CHECK-RV32IF-NEXT:    flw fa5, 72(sp)
; CHECK-RV32IF-NEXT:    flw fa4, 76(sp)
; CHECK-RV32IF-NEXT:    flw fa3, 80(sp)
; CHECK-RV32IF-NEXT:    flw fa2, 84(sp)
; CHECK-RV32IF-NEXT:    flw fa1, 88(sp)
; CHECK-RV32IF-NEXT:    flw fa0, 92(sp)
; CHECK-RV32IF-NEXT:    flw ft7, 96(sp)
; CHECK-RV32IF-NEXT:    flw ft6, 100(sp)
; CHECK-RV32IF-NEXT:    flw ft5, 104(sp)
; CHECK-RV32IF-NEXT:    flw ft4, 108(sp)
; CHECK-RV32IF-NEXT:    flw ft3, 112(sp)
; CHECK-RV32IF-NEXT:    flw ft2, 116(sp)
; CHECK-RV32IF-NEXT:    flw ft1, 120(sp)
; CHECK-RV32IF-NEXT:    flw ft0, 124(sp)
; CHECK-RV32IF-NEXT:    lw t6, 128(sp)
; CHECK-RV32IF-NEXT:    lw t5, 132(sp)
; CHECK-RV32IF-NEXT:    lw t4, 136(sp)
; CHECK-RV32IF-NEXT:    lw t3, 140(sp)
; CHECK-RV32IF-NEXT:    lw a7, 144(sp)
; CHECK-RV32IF-NEXT:    lw a6, 148(sp)
; CHECK-RV32IF-NEXT:    lw a5, 152(sp)
; CHECK-RV32IF-NEXT:    lw a4, 156(sp)
; CHECK-RV32IF-NEXT:    lw a3, 160(sp)
; CHECK-RV32IF-NEXT:    lw a2, 164(sp)
; CHECK-RV32IF-NEXT:    lw a1, 168(sp)
; CHECK-RV32IF-NEXT:    lw a0, 172(sp)
; CHECK-RV32IF-NEXT:    lw t2, 176(sp)
; CHECK-RV32IF-NEXT:    lw t1, 180(sp)
; CHECK-RV32IF-NEXT:    lw t0, 184(sp)
; CHECK-RV32IF-NEXT:    lw ra, 188(sp)
; CHECK-RV32IF-NEXT:    addi sp, sp, 192
; CHECK-RV32IF-NEXT:    mret
;
; CHECK-RV32IFD-LABEL: foo_double:
; CHECK-RV32IFD:       # %bb.0:
; CHECK-RV32IFD-NEXT:    addi sp, sp, -32
; CHECK-RV32IFD-NEXT:    sw a0, 28(sp)
; CHECK-RV32IFD-NEXT:    fsd ft0, 16(sp)
; CHECK-RV32IFD-NEXT:    fsd ft1, 8(sp)
; CHECK-RV32IFD-NEXT:    lui a0, %hi(h)
; CHECK-RV32IFD-NEXT:    fld ft0, %lo(h)(a0)
; CHECK-RV32IFD-NEXT:    lui a0, %hi(i)
; CHECK-RV32IFD-NEXT:    fld ft1, %lo(i)(a0)
; CHECK-RV32IFD-NEXT:    fadd.d ft0, ft0, ft1
; CHECK-RV32IFD-NEXT:    lui a0, %hi(g)
; CHECK-RV32IFD-NEXT:    fsd ft0, %lo(g)(a0)
; CHECK-RV32IFD-NEXT:    fld ft1, 8(sp)
; CHECK-RV32IFD-NEXT:    fld ft0, 16(sp)
; CHECK-RV32IFD-NEXT:    lw a0, 28(sp)
; CHECK-RV32IFD-NEXT:    addi sp, sp, 32
; CHECK-RV32IFD-NEXT:    mret
  %1 = load double, double* @h
  %2 = load double, double* @i
  %add = fadd double %1, %2
  store double %add, double* @g
  ret void
}

;
; Additionally check frame pointer and return address are properly saved.
;
define void @foo_fp_double() nounwind #1 {
; CHECK-RV32-LABEL: foo_fp_double:
; CHECK-RV32:       # %bb.0:
; CHECK-RV32-NEXT:    addi sp, sp, -80
; CHECK-RV32-NEXT:    sw ra, 76(sp)
; CHECK-RV32-NEXT:    sw t0, 72(sp)
; CHECK-RV32-NEXT:    sw t1, 68(sp)
; CHECK-RV32-NEXT:    sw t2, 64(sp)
; CHECK-RV32-NEXT:    sw s0, 60(sp)
; CHECK-RV32-NEXT:    sw a0, 56(sp)
; CHECK-RV32-NEXT:    sw a1, 52(sp)
; CHECK-RV32-NEXT:    sw a2, 48(sp)
; CHECK-RV32-NEXT:    sw a3, 44(sp)
; CHECK-RV32-NEXT:    sw a4, 40(sp)
; CHECK-RV32-NEXT:    sw a5, 36(sp)
; CHECK-RV32-NEXT:    sw a6, 32(sp)
; CHECK-RV32-NEXT:    sw a7, 28(sp)
; CHECK-RV32-NEXT:    sw t3, 24(sp)
; CHECK-RV32-NEXT:    sw t4, 20(sp)
; CHECK-RV32-NEXT:    sw t5, 16(sp)
; CHECK-RV32-NEXT:    sw t6, 12(sp)
; CHECK-RV32-NEXT:    addi s0, sp, 80
; CHECK-RV32-NEXT:    lui a1, %hi(h)
; CHECK-RV32-NEXT:    lw a0, %lo(h)(a1)
; CHECK-RV32-NEXT:    addi a1, a1, %lo(h)
; CHECK-RV32-NEXT:    lw a1, 4(a1)
; CHECK-RV32-NEXT:    lui a3, %hi(i)
; CHECK-RV32-NEXT:    lw a2, %lo(i)(a3)
; CHECK-RV32-NEXT:    addi a3, a3, %lo(i)
; CHECK-RV32-NEXT:    lw a3, 4(a3)
; CHECK-RV32-NEXT:    call __adddf3
; CHECK-RV32-NEXT:    lui a2, %hi(g)
; CHECK-RV32-NEXT:    addi a3, a2, %lo(g)
; CHECK-RV32-NEXT:    sw a1, 4(a3)
; CHECK-RV32-NEXT:    sw a0, %lo(g)(a2)
; CHECK-RV32-NEXT:    lw t6, 12(sp)
; CHECK-RV32-NEXT:    lw t5, 16(sp)
; CHECK-RV32-NEXT:    lw t4, 20(sp)
; CHECK-RV32-NEXT:    lw t3, 24(sp)
; CHECK-RV32-NEXT:    lw a7, 28(sp)
; CHECK-RV32-NEXT:    lw a6, 32(sp)
; CHECK-RV32-NEXT:    lw a5, 36(sp)
; CHECK-RV32-NEXT:    lw a4, 40(sp)
; CHECK-RV32-NEXT:    lw a3, 44(sp)
; CHECK-RV32-NEXT:    lw a2, 48(sp)
; CHECK-RV32-NEXT:    lw a1, 52(sp)
; CHECK-RV32-NEXT:    lw a0, 56(sp)
; CHECK-RV32-NEXT:    lw s0, 60(sp)
; CHECK-RV32-NEXT:    lw t2, 64(sp)
; CHECK-RV32-NEXT:    lw t1, 68(sp)
; CHECK-RV32-NEXT:    lw t0, 72(sp)
; CHECK-RV32-NEXT:    lw ra, 76(sp)
; CHECK-RV32-NEXT:    addi sp, sp, 80
; CHECK-RV32-NEXT:    mret
;
; CHECK-RV32IF-LABEL: foo_fp_double:
; CHECK-RV32IF:       # %bb.0:
; CHECK-RV32IF-NEXT:    addi sp, sp, -208
; CHECK-RV32IF-NEXT:    sw ra, 204(sp)
; CHECK-RV32IF-NEXT:    sw t0, 200(sp)
; CHECK-RV32IF-NEXT:    sw t1, 196(sp)
; CHECK-RV32IF-NEXT:    sw t2, 192(sp)
; CHECK-RV32IF-NEXT:    sw s0, 188(sp)
; CHECK-RV32IF-NEXT:    sw a0, 184(sp)
; CHECK-RV32IF-NEXT:    sw a1, 180(sp)
; CHECK-RV32IF-NEXT:    sw a2, 176(sp)
; CHECK-RV32IF-NEXT:    sw a3, 172(sp)
; CHECK-RV32IF-NEXT:    sw a4, 168(sp)
; CHECK-RV32IF-NEXT:    sw a5, 164(sp)
; CHECK-RV32IF-NEXT:    sw a6, 160(sp)
; CHECK-RV32IF-NEXT:    sw a7, 156(sp)
; CHECK-RV32IF-NEXT:    sw t3, 152(sp)
; CHECK-RV32IF-NEXT:    sw t4, 148(sp)
; CHECK-RV32IF-NEXT:    sw t5, 144(sp)
; CHECK-RV32IF-NEXT:    sw t6, 140(sp)
; CHECK-RV32IF-NEXT:    fsw ft0, 136(sp)
; CHECK-RV32IF-NEXT:    fsw ft1, 132(sp)
; CHECK-RV32IF-NEXT:    fsw ft2, 128(sp)
; CHECK-RV32IF-NEXT:    fsw ft3, 124(sp)
; CHECK-RV32IF-NEXT:    fsw ft4, 120(sp)
; CHECK-RV32IF-NEXT:    fsw ft5, 116(sp)
; CHECK-RV32IF-NEXT:    fsw ft6, 112(sp)
; CHECK-RV32IF-NEXT:    fsw ft7, 108(sp)
; CHECK-RV32IF-NEXT:    fsw fa0, 104(sp)
; CHECK-RV32IF-NEXT:    fsw fa1, 100(sp)
; CHECK-RV32IF-NEXT:    fsw fa2, 96(sp)
; CHECK-RV32IF-NEXT:    fsw fa3, 92(sp)
; CHECK-RV32IF-NEXT:    fsw fa4, 88(sp)
; CHECK-RV32IF-NEXT:    fsw fa5, 84(sp)
; CHECK-RV32IF-NEXT:    fsw fa6, 80(sp)
; CHECK-RV32IF-NEXT:    fsw fa7, 76(sp)
; CHECK-RV32IF-NEXT:    fsw ft8, 72(sp)
; CHECK-RV32IF-NEXT:    fsw ft9, 68(sp)
; CHECK-RV32IF-NEXT:    fsw ft10, 64(sp)
; CHECK-RV32IF-NEXT:    fsw ft11, 60(sp)
; CHECK-RV32IF-NEXT:    fsw fs0, 56(sp)
; CHECK-RV32IF-NEXT:    fsw fs1, 52(sp)
; CHECK-RV32IF-NEXT:    fsw fs2, 48(sp)
; CHECK-RV32IF-NEXT:    fsw fs3, 44(sp)
; CHECK-RV32IF-NEXT:    fsw fs4, 40(sp)
; CHECK-RV32IF-NEXT:    fsw fs5, 36(sp)
; CHECK-RV32IF-NEXT:    fsw fs6, 32(sp)
; CHECK-RV32IF-NEXT:    fsw fs7, 28(sp)
; CHECK-RV32IF-NEXT:    fsw fs8, 24(sp)
; CHECK-RV32IF-NEXT:    fsw fs9, 20(sp)
; CHECK-RV32IF-NEXT:    fsw fs10, 16(sp)
; CHECK-RV32IF-NEXT:    fsw fs11, 12(sp)
; CHECK-RV32IF-NEXT:    addi s0, sp, 208
; CHECK-RV32IF-NEXT:    lui a1, %hi(h)
; CHECK-RV32IF-NEXT:    lw a0, %lo(h)(a1)
; CHECK-RV32IF-NEXT:    addi a1, a1, %lo(h)
; CHECK-RV32IF-NEXT:    lw a1, 4(a1)
; CHECK-RV32IF-NEXT:    lui a3, %hi(i)
; CHECK-RV32IF-NEXT:    lw a2, %lo(i)(a3)
; CHECK-RV32IF-NEXT:    addi a3, a3, %lo(i)
; CHECK-RV32IF-NEXT:    lw a3, 4(a3)
; CHECK-RV32IF-NEXT:    call __adddf3
; CHECK-RV32IF-NEXT:    lui a2, %hi(g)
; CHECK-RV32IF-NEXT:    addi a3, a2, %lo(g)
; CHECK-RV32IF-NEXT:    sw a1, 4(a3)
; CHECK-RV32IF-NEXT:    sw a0, %lo(g)(a2)
; CHECK-RV32IF-NEXT:    flw fs11, 12(sp)
; CHECK-RV32IF-NEXT:    flw fs10, 16(sp)
; CHECK-RV32IF-NEXT:    flw fs9, 20(sp)
; CHECK-RV32IF-NEXT:    flw fs8, 24(sp)
; CHECK-RV32IF-NEXT:    flw fs7, 28(sp)
; CHECK-RV32IF-NEXT:    flw fs6, 32(sp)
; CHECK-RV32IF-NEXT:    flw fs5, 36(sp)
; CHECK-RV32IF-NEXT:    flw fs4, 40(sp)
; CHECK-RV32IF-NEXT:    flw fs3, 44(sp)
; CHECK-RV32IF-NEXT:    flw fs2, 48(sp)
; CHECK-RV32IF-NEXT:    flw fs1, 52(sp)
; CHECK-RV32IF-NEXT:    flw fs0, 56(sp)
; CHECK-RV32IF-NEXT:    flw ft11, 60(sp)
; CHECK-RV32IF-NEXT:    flw ft10, 64(sp)
; CHECK-RV32IF-NEXT:    flw ft9, 68(sp)
; CHECK-RV32IF-NEXT:    flw ft8, 72(sp)
; CHECK-RV32IF-NEXT:    flw fa7, 76(sp)
; CHECK-RV32IF-NEXT:    flw fa6, 80(sp)
; CHECK-RV32IF-NEXT:    flw fa5, 84(sp)
; CHECK-RV32IF-NEXT:    flw fa4, 88(sp)
; CHECK-RV32IF-NEXT:    flw fa3, 92(sp)
; CHECK-RV32IF-NEXT:    flw fa2, 96(sp)
; CHECK-RV32IF-NEXT:    flw fa1, 100(sp)
; CHECK-RV32IF-NEXT:    flw fa0, 104(sp)
; CHECK-RV32IF-NEXT:    flw ft7, 108(sp)
; CHECK-RV32IF-NEXT:    flw ft6, 112(sp)
; CHECK-RV32IF-NEXT:    flw ft5, 116(sp)
; CHECK-RV32IF-NEXT:    flw ft4, 120(sp)
; CHECK-RV32IF-NEXT:    flw ft3, 124(sp)
; CHECK-RV32IF-NEXT:    flw ft2, 128(sp)
; CHECK-RV32IF-NEXT:    flw ft1, 132(sp)
; CHECK-RV32IF-NEXT:    flw ft0, 136(sp)
; CHECK-RV32IF-NEXT:    lw t6, 140(sp)
; CHECK-RV32IF-NEXT:    lw t5, 144(sp)
; CHECK-RV32IF-NEXT:    lw t4, 148(sp)
; CHECK-RV32IF-NEXT:    lw t3, 152(sp)
; CHECK-RV32IF-NEXT:    lw a7, 156(sp)
; CHECK-RV32IF-NEXT:    lw a6, 160(sp)
; CHECK-RV32IF-NEXT:    lw a5, 164(sp)
; CHECK-RV32IF-NEXT:    lw a4, 168(sp)
; CHECK-RV32IF-NEXT:    lw a3, 172(sp)
; CHECK-RV32IF-NEXT:    lw a2, 176(sp)
; CHECK-RV32IF-NEXT:    lw a1, 180(sp)
; CHECK-RV32IF-NEXT:    lw a0, 184(sp)
; CHECK-RV32IF-NEXT:    lw s0, 188(sp)
; CHECK-RV32IF-NEXT:    lw t2, 192(sp)
; CHECK-RV32IF-NEXT:    lw t1, 196(sp)
; CHECK-RV32IF-NEXT:    lw t0, 200(sp)
; CHECK-RV32IF-NEXT:    lw ra, 204(sp)
; CHECK-RV32IF-NEXT:    addi sp, sp, 208
; CHECK-RV32IF-NEXT:    mret
;
; CHECK-RV32IFD-LABEL: foo_fp_double:
; CHECK-RV32IFD:       # %bb.0:
; CHECK-RV32IFD-NEXT:    addi sp, sp, -32
; CHECK-RV32IFD-NEXT:    sw ra, 28(sp)
; CHECK-RV32IFD-NEXT:    sw s0, 24(sp)
; CHECK-RV32IFD-NEXT:    sw a0, 20(sp)
; CHECK-RV32IFD-NEXT:    fsd ft0, 8(sp)
; CHECK-RV32IFD-NEXT:    fsd ft1, 0(sp)
; CHECK-RV32IFD-NEXT:    addi s0, sp, 32
; CHECK-RV32IFD-NEXT:    lui a0, %hi(h)
; CHECK-RV32IFD-NEXT:    fld ft0, %lo(h)(a0)
; CHECK-RV32IFD-NEXT:    lui a0, %hi(i)
; CHECK-RV32IFD-NEXT:    fld ft1, %lo(i)(a0)
; CHECK-RV32IFD-NEXT:    fadd.d ft0, ft0, ft1
; CHECK-RV32IFD-NEXT:    lui a0, %hi(g)
; CHECK-RV32IFD-NEXT:    fsd ft0, %lo(g)(a0)
; CHECK-RV32IFD-NEXT:    fld ft1, 0(sp)
; CHECK-RV32IFD-NEXT:    fld ft0, 8(sp)
; CHECK-RV32IFD-NEXT:    lw a0, 20(sp)
; CHECK-RV32IFD-NEXT:    lw s0, 24(sp)
; CHECK-RV32IFD-NEXT:    lw ra, 28(sp)
; CHECK-RV32IFD-NEXT:    addi sp, sp, 32
; CHECK-RV32IFD-NEXT:    mret
  %1 = load double, double* @h
  %2 = load double, double* @i
  %add = fadd double %1, %2
  store double %add, double* @g
  ret void
}

attributes #0 = { "interrupt"="machine" }
attributes #1 = { "interrupt"="machine" "frame-pointer"="all" }