xref: /aosp_15_r20/external/llvm/test/CodeGen/Mips/micromips-lwc1-swc1.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips -mcpu=mips32r3 -mattr=+micromips \
2*9880d681SAndroid Build Coastguard Worker; RUN:   -relocation-model=pic < %s | \
3*9880d681SAndroid Build Coastguard Worker; RUN:   FileCheck %s -check-prefixes=ALL,MM32
4*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips -mcpu=mips32r6 -mattr=+micromips \
5*9880d681SAndroid Build Coastguard Worker; RUN:   -relocation-model=pic < %s | \
6*9880d681SAndroid Build Coastguard Worker; RUN:   FileCheck %s -check-prefixes=ALL,MM32
7*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=mips -mcpu=mips64r6 -mattr=+micromips -target-abi n64 \
8*9880d681SAndroid Build Coastguard Worker; RUN:   -relocation-model=pic < %s | \
9*9880d681SAndroid Build Coastguard Worker; RUN:   FileCheck %s -check-prefixes=ALL,MM64
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker@gf0 = external global float
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Workerdefine float @test_lwc1() {
14*9880d681SAndroid Build Coastguard Workerentry:
15*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_lwc1
16*9880d681SAndroid Build Coastguard Worker; MM32:      lui     $[[R0:[0-9]+]], %hi(_gp_disp)
17*9880d681SAndroid Build Coastguard Worker; MM32:      addiu   $[[R1:[0-9]+]], $[[R0]], %lo(_gp_disp)
18*9880d681SAndroid Build Coastguard Worker; MM32:      addu    $[[R2:[0-9]+]], $[[R1]], $25
19*9880d681SAndroid Build Coastguard Worker; MM32:      lw      $[[R3:[0-9]+]], %got(gf0)($[[R2]])
20*9880d681SAndroid Build Coastguard Worker; MM32:      lwc1    $f0, 0($[[R3]])
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Worker; MM64:      lui     $[[R0:[0-9]+]], %hi(%neg(%gp_rel(test_lwc1)))
23*9880d681SAndroid Build Coastguard Worker; MM64:      daddu   $[[R1:[0-9]+]], $[[R0]], $25
24*9880d681SAndroid Build Coastguard Worker; MM64:      daddiu  $[[R2:[0-9]+]], $[[R1]], %lo(%neg(%gp_rel(test_lwc1)))
25*9880d681SAndroid Build Coastguard Worker; MM64:      ld      $[[R3:[0-9]+]], %got_disp(gf0)($[[R2]])
26*9880d681SAndroid Build Coastguard Worker; MM64:      lwc1    $f0, 0($[[R3]])
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Worker  %0 = load float, float* @gf0, align 4
29*9880d681SAndroid Build Coastguard Worker  ret float %0
30*9880d681SAndroid Build Coastguard Worker}
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerdefine void @test_swc1(float %a) {
33*9880d681SAndroid Build Coastguard Workerentry:
34*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test_swc1
35*9880d681SAndroid Build Coastguard Worker; MM32:      lui     $[[R0:[0-9]+]], %hi(_gp_disp)
36*9880d681SAndroid Build Coastguard Worker; MM32:      addiu   $[[R1:[0-9]+]], $[[R0]], %lo(_gp_disp)
37*9880d681SAndroid Build Coastguard Worker; MM32:      addu    $[[R2:[0-9]+]], $[[R1]], $25
38*9880d681SAndroid Build Coastguard Worker; MM32:      lw      $[[R3:[0-9]+]], %got(gf0)($[[R2]])
39*9880d681SAndroid Build Coastguard Worker; MM32:      swc1    $f12, 0($[[R3]])
40*9880d681SAndroid Build Coastguard Worker
41*9880d681SAndroid Build Coastguard Worker; MM64:      lui     $[[R0:[0-9]+]], %hi(%neg(%gp_rel(test_swc1)))
42*9880d681SAndroid Build Coastguard Worker; MM64:      daddu   $[[R1:[0-9]+]], $[[R0]], $25
43*9880d681SAndroid Build Coastguard Worker; MM64:      daddiu  $[[R2:[0-9]+]], $[[R1]], %lo(%neg(%gp_rel(test_swc1)))
44*9880d681SAndroid Build Coastguard Worker; MM64:      ld      $[[R3:[0-9]+]], %got_disp(gf0)($[[R2]])
45*9880d681SAndroid Build Coastguard Worker; MM64:      swc1    $f12, 0($[[R3]])
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker  store float %a, float* @gf0, align 4
48*9880d681SAndroid Build Coastguard Worker  ret void
49*9880d681SAndroid Build Coastguard Worker}
50*9880d681SAndroid Build Coastguard Worker
51