stdarch: Inlining is broken in ARMv7+NEON

MWE:

#![feature(stdsimd,target_feature)]
extern crate stdsimd;
use ::stdsimd::arch::arm::int8x8_t;
#[inline]
#[target_feature(enable = "neon,v7")]
pub unsafe fn bar(x: int8x8_t) -> int8x8_t {
    ::stdsimd::arch::arm::vadd_s8(x, x)
}
pub unsafe fn foo(x: int8x8_t) -> int8x8_t {
    bar(x)
}

produces:

foo::foo:
 push    {r11, lr}
 vldr    d0, [r1]
 bl      foo::bar
 pop     {r11, pc}

built using RUSTFLAGS="-C target-feature=+neon,+v7 -C lto=fat -C codegen-units=1 --emit asm -C debuginfo=0" CARGO_INCREMENTAL=0 cargo build --release --target=armv7-unknown-linux-gnueabihf.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Yes it does:

[tstellar@tstellar clang-build]$ echo 'void main(){}' | clang -w -S -emit-llvm -x c - -o -
; ModuleID = '-'
source_filename = "-"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @main() #0 {
entry:
  ret void
}

attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }

!llvm.module.flags = !{!0}
!llvm.ident = !{!1}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"clang version 7.0.0 (trunk 329854) (llvm/trunk 329852)"}