brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.8 KiB · d92de13 Raw
111 lines · plain
1;; Check that an unknown --target-abi is ignored and the triple-implied ABI is2;; used.3; RUN: llc --mtriple=loongarch32-linux-gnu --target-abi=foo --mattr=+d < %s 2>&1 \4; RUN:   | FileCheck %s --check-prefixes=ILP32D,UNKNOWN5; RUN: llc --mtriple=loongarch64-linux-gnu --target-abi=foo --mattr=+d < %s 2>&1 \6; RUN:   | FileCheck %s --check-prefixes=LP64D,UNKNOWN7 8; UNKNOWN: warning: the 'foo' is not a recognized ABI for this target, ignoring and using triple-implied ABI9 10;; Check that --target-abi takes precedence over triple-supplied ABI modifiers.11; RUN: llc --mtriple=loongarch32-linux-gnusf --target-abi=ilp32d --mattr=+d < %s 2>&1 \12; RUN:   | FileCheck %s --check-prefixes=ILP32D,CONFLICT-ILP32D13; RUN: llc --mtriple=loongarch64-linux-gnusf --target-abi=lp64d --mattr=+d < %s 2>&1 \14; RUN:   | FileCheck %s --check-prefixes=LP64D,CONFLICT-LP64D15 16; CONFLICT-ILP32D: warning: triple-implied ABI conflicts with provided target-abi 'ilp32d', using target-abi17; CONFLICT-LP64D:  warning: triple-implied ABI conflicts with provided target-abi 'lp64d', using target-abi18 19;; Check that no warning is reported when there is no environment component in20;; triple-supplied ABI modifiers and --target-abi is used.21; RUN: llc --mtriple=loongarch64-linux --target-abi=lp64d --mattr=+d < %s 2>&1 \22; RUN:   | FileCheck %s --check-prefixes=LP64D,NO-WARNING23 24; NO-WARNING-NOT:  warning: triple-implied ABI conflicts with provided target-abi 'lp64d', using target-abi25 26;; Check that ILP32-on-LA64 and LP64-on-LA32 combinations are handled properly.27; RUN: llc --mtriple=loongarch64-linux-gnu --target-abi=ilp32d --mattr=+d < %s 2>&1 \28; RUN:   | FileCheck %s --check-prefixes=LP64D,32ON6429; RUN: llc --mtriple=loongarch32-linux-gnu --target-abi=lp64d --mattr=+d < %s 2>&1 \30; RUN:   | FileCheck %s --check-prefixes=ILP32D,64ON3231 32; 32ON64: warning: 32-bit ABIs are not supported for 64-bit targets, ignoring and using triple-implied ABI33; 64ON32: warning: 64-bit ABIs are not supported for 32-bit targets, ignoring and using triple-implied ABI34 35;; Check that target-abi is invalid but triple-implied ABI is valid, use triple-implied ABI36; RUN: llc --mtriple=loongarch64-linux-gnusf --target-abi=lp64f --mattr=-f < %s 2>&1 \37; RUN:   | FileCheck %s --check-prefixes=LP64S,LP64S-LP64F-NOF38; RUN: llc --mtriple=loongarch64-linux-gnusf --target-abi=lp64d --mattr=-d < %s 2>&1 \39; RUN:   | FileCheck %s --check-prefixes=LP64S,LP64S-LP64D-NOD40 41; LP64S-LP64F-NOF: warning: the 'lp64f' ABI can't be used for a target that doesn't support the 'F' instruction set, ignoring and using triple-implied ABI42; LP64S-LP64D-NOD: warning: the 'lp64d' ABI can't be used for a target that doesn't support the 'D' instruction set, ignoring and using triple-implied ABI43 44;; Check that both target-abi and triple-implied ABI are invalid, use feature-implied ABI45; RUN: llc --mtriple=loongarch64-linux-gnuf64 --target-abi=lp64f --mattr=-f < %s 2>&1 \46; RUN:   | FileCheck %s --check-prefixes=LP64S,LP64D-LP64F-NOF47; RUN: llc --mtriple=loongarch64 --target-abi=lp64f --mattr=-f < %s 2>&1 \48; RUN:   | FileCheck %s --check-prefixes=LP64S,LP64D-LP64F-NOF49 50; LP64D-LP64F-NOF: warning: both target-abi and the triple-implied ABI are invalid, ignoring and using feature-implied ABI51 52define float @f(float %a) {53; ILP32D-LABEL: f:54; ILP32D:       # %bb.0:55; ILP32D-NEXT:    lu12i.w $a0, 26009656; ILP32D-NEXT:    movgr2fr.w  $fa1, $a057; ILP32D-NEXT:    fadd.s  $fa0, $fa0, $fa158; ILP32D-NEXT:    ret59;60; LP64D-LABEL: f:61; LP64D:       # %bb.0:62; LP64D-NEXT:    vldi $vr1, -116863; LP64D-NEXT:    fadd.s $fa0, $fa0, $fa164; LP64D-NEXT:    ret65;66; LP64S-LP64F-NOF-LABEL: f:67; LP64S-LP64F-NOF:    pcaddu18i $ra, %call36(__addsf3)68; LP64S-LP64F-NOF-NEXT:    jirl $ra, $ra, 069;70; LP64S-LP64D-NOD-LABEL: f:71; LP64S-LP64D-NOD:       # %bb.0:72; LP64S-LP64D-NOD-NEXT:    movgr2fr.w $fa0, $a073; LP64S-LP64D-NOD-NEXT:    lu12i.w $a0, 26009674; LP64S-LP64D-NOD-NEXT:    movgr2fr.w  $fa1, $a075; LP64S-LP64D-NOD-NEXT:    fadd.s  $fa0, $fa0, $fa176; LP64S-LP64D-NOD-NEXT:    movfr2gr.s  $a0, $fa077; LP64S-LP64D-NOD-NEXT:    ret78;79; LP64D-LP64F-NOF-LABEL: f:80; LP64D-LP64F-NOF:    pcaddu18i $ra, %call36(__addsf3)81; LP64D-LP64F-NOF-NEXT:    jirl $ra, $ra, 082;83; LP64D-NONE-NOF-LABEL: f:84; LP64D-NONE-NOF:    pcaddu18i $ra, %call36(__addsf3)85; LP64D-NONE-NOF-NEXT:    jirl $ra, $ra, 086  %1 = fadd float %a, 1.087  ret float %188}89 90define double @g(double %a) {91; ILP32D-LABEL: g:92; ILP32D:       # %bb.0:93; ILP32D-NEXT:    movgr2fr.w $fa1, $zero94; ILP32D-NEXT:    lu12i.w $a0, 26188895; ILP32D-NEXT:    movgr2frh.w $fa1, $a096; ILP32D-NEXT:    fadd.d $fa0, $fa0, $fa197; ILP32D-NEXT:    ret98;99; LP64D-LABEL: g:100; LP64D:       # %bb.0:101; LP64D-NEXT:    vldi $vr1, -912102; LP64D-NEXT:    fadd.d $fa0, $fa0, $fa1103; LP64D-NEXT:    ret104;105; LP64S-LABEL: g:106; LP64S:    pcaddu18i $ra, %call36(__adddf3)107; LP64S-NEXT:    jirl $ra, $ra, 0108  %1 = fadd double %a, 1.0109  ret double %1110}111