Index: lib/Target/NDS32/NDS32InstrInfo.td =================================================================== --- lib/Target/NDS32/NDS32InstrInfo.td +++ lib/Target/NDS32/NDS32InstrInfo.td @@ -618,6 +618,10 @@ def : Pat<(i32 (extloadi16 addr_imm15s_half:$src)), (LHI addr_imm15s_half:$src)>; def : Pat<(i32 (extloadi8 addr_imm15s_byte:$src)), (LBI addr_imm15s_byte:$src)>; +// call patterns +def : Pat<(NDS32call (i32 texternalsym:$dst)), + (JAL texternalsym:$dst)>; + //===----------------------------------------------------------------------===// // Conditional Move Instructions Index: test/CodeGen/NDS32/extern-symbal-call.ll =================================================================== --- /dev/null +++ test/CodeGen/NDS32/extern-symbal-call.ll @@ -0,0 +1,12 @@ +; RUN: llc < %s | FileCheck %s +target datalayout = "e-m:e-p:32:32-i64:64-a:0:32-n32-S64" +target triple = "nds32le---elf" + +; Function Attrs: norecurse nounwind readnone +define i32 @extern_symbal_call(float %a, float %b) local_unnamed_addr #0 { +entry: + %cmp = fcmp oeq float %a, %b + %conv = zext i1 %cmp to i32 +; CHECK: jal __eqsf2 + ret i32 %conv +}