File: micromips-lwc1-swc1.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (35 lines) | stat: -rw-r--r-- 1,056 bytes parent folder | download | duplicates (8)
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
; RUN: llc -march=mips -mcpu=mips32r3 -mattr=+micromips \
; RUN:   -relocation-model=pic < %s | \
; RUN:   FileCheck %s -check-prefixes=MM32
; RUN: llc -march=mips -mcpu=mips32r6 -mattr=+micromips \
; RUN:   -relocation-model=pic < %s | \
; RUN:   FileCheck %s -check-prefixes=MM32

@gf0 = external global float

define float @test_lwc1() {
entry:
; CHECK-LABEL: test_lwc1
; MM32:      lui     $[[R0:[0-9]+]], %hi(_gp_disp)
; MM32:      addiu   $[[R1:[0-9]+]], $[[R0]], %lo(_gp_disp)
; MM32:      addu    $[[R2:[0-9]+]], $[[R1]], $25
; MM32:      lw      $[[R3:[0-9]+]], %got(gf0)($[[R2]])
; MM32:      lwc1    $f0, 0($[[R3]])

  %0 = load float, ptr @gf0, align 4
  ret float %0
}

define void @test_swc1(float %a) {
entry:
; CHECK-LABEL: test_swc1
; MM32:      lui     $[[R0:[0-9]+]], %hi(_gp_disp)
; MM32:      addiu   $[[R1:[0-9]+]], $[[R0]], %lo(_gp_disp)
; MM32:      addu    $[[R2:[0-9]+]], $[[R1]], $25
; MM32:      lw      $[[R3:[0-9]+]], %got(gf0)($[[R2]])
; MM32:      swc1    $f12, 0($[[R3]])

  store float %a, ptr @gf0, align 4
  ret void
}