Index: lib/Target/ARM/ARMAsmPrinter.cpp =================================================================== --- lib/Target/ARM/ARMAsmPrinter.cpp +++ lib/Target/ARM/ARMAsmPrinter.cpp @@ -74,8 +74,9 @@ if (AFI->isThumbFunction()) { OutStreamer->EmitAssemblerFlag(MCAF_Code16); OutStreamer->EmitThumbFunc(CurrentFnSym); + } else { + OutStreamer->EmitAssemblerFlag(MCAF_Code32); } - OutStreamer->EmitLabel(CurrentFnSym); } Index: test/CodeGen/ARM/interwork.ll =================================================================== --- /dev/null +++ test/CodeGen/ARM/interwork.ll @@ -0,0 +1,23 @@ +; One file may have multiple functions targeted at different (ARM, Thumb) +; instruction sets. Passing this information to the linker and the assembler +; is done through the ".code 16" and ".code 32" directives. +; +; RUN: llc -mtriple=arm-arm-none-eabi %s -o - | FileCheck %s + +define void @ft() #0 { +; CHECK: .code 16 +; CHECK: .thumb_func +; CHECK-LABEL: ft: +entry: + ret void +} + +define void @fz() #1 { +; CHECK: .code 32 +; CHECK-LABEL: fz: +entry: + ret void +} + +attributes #0 = { "target-features"="+thumb-mode" } +attributes #1 = { "target-features"="-thumb-mode" } Index: test/CodeGen/ARM/vfloatintrinsics.ll =================================================================== --- test/CodeGen/ARM/vfloatintrinsics.ll +++ test/CodeGen/ARM/vfloatintrinsics.ll @@ -5,103 +5,103 @@ ;;; Float vectors %v2f32 = type <2 x float> -; CHECK: test_v2f32.sqrt: +; CHECK-LABEL: test_v2f32.sqrt:{{.*}} define %v2f32 @test_v2f32.sqrt(%v2f32 %a) { ; CHECK: sqrt %1 = call %v2f32 @llvm.sqrt.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.powi: +; CHECK-LABEL: test_v2f32.powi:{{.*}} define %v2f32 @test_v2f32.powi(%v2f32 %a, i32 %b) { ; CHECK: pow %1 = call %v2f32 @llvm.powi.v2f32(%v2f32 %a, i32 %b) ret %v2f32 %1 } -; CHECK: test_v2f32.sin: +; CHECK-LABEL: test_v2f32.sin:{{.*}} define %v2f32 @test_v2f32.sin(%v2f32 %a) { ; CHECK: sin %1 = call %v2f32 @llvm.sin.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.cos: +; CHECK-LABEL: test_v2f32.cos:{{.*}} define %v2f32 @test_v2f32.cos(%v2f32 %a) { ; CHECK: cos %1 = call %v2f32 @llvm.cos.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.pow: +; CHECK-LABEL: test_v2f32.pow:{{.*}} define %v2f32 @test_v2f32.pow(%v2f32 %a, %v2f32 %b) { ; CHECK: pow %1 = call %v2f32 @llvm.pow.v2f32(%v2f32 %a, %v2f32 %b) ret %v2f32 %1 } -; CHECK: test_v2f32.exp: +; CHECK-LABEL: test_v2f32.exp:{{.*}} define %v2f32 @test_v2f32.exp(%v2f32 %a) { ; CHECK: exp %1 = call %v2f32 @llvm.exp.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.exp2: +; CHECK-LABEL: test_v2f32.exp2:{{.*}} define %v2f32 @test_v2f32.exp2(%v2f32 %a) { ; CHECK: exp %1 = call %v2f32 @llvm.exp2.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.log: +; CHECK-LABEL: test_v2f32.log:{{.*}} define %v2f32 @test_v2f32.log(%v2f32 %a) { ; CHECK: log %1 = call %v2f32 @llvm.log.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.log10: +; CHECK-LABEL: test_v2f32.log10:{{.*}} define %v2f32 @test_v2f32.log10(%v2f32 %a) { ; CHECK: log %1 = call %v2f32 @llvm.log10.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.log2: +; CHECK-LABEL: test_v2f32.log2:{{.*}} define %v2f32 @test_v2f32.log2(%v2f32 %a) { ; CHECK: log %1 = call %v2f32 @llvm.log2.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.fma: +; CHECK: test_v2f32.fma:{{.*}} define %v2f32 @test_v2f32.fma(%v2f32 %a, %v2f32 %b, %v2f32 %c) { ; CHECK: fma %1 = call %v2f32 @llvm.fma.v2f32(%v2f32 %a, %v2f32 %b, %v2f32 %c) ret %v2f32 %1 } -; CHECK: test_v2f32.fabs: +; CHECK-LABEL: test_v2f32.fabs:{{.*}} define %v2f32 @test_v2f32.fabs(%v2f32 %a) { - ; CHECK: fabs + ; CHECK: vabs.f32 %1 = call %v2f32 @llvm.fabs.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.floor: +; CHECK-LABEL: test_v2f32.floor:{{.*}} define %v2f32 @test_v2f32.floor(%v2f32 %a) { - ; CHECK: floor + ; CHECK: _floorf %1 = call %v2f32 @llvm.floor.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.fceil: +; CHECK-LABEL: test_v2f32.fceil:{{.*}} define %v2f32 @test_v2f32.fceil(%v2f32 %a) { ; CHECK: ceil %1 = call %v2f32 @llvm.fceil.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.trunc: +; CHECK-LABEL: test_v2f32.trunc:{{.*}} define %v2f32 @test_v2f32.trunc(%v2f32 %a) { ; CHECK: trunc %1 = call %v2f32 @llvm.trunc.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.rint: +; CHECK-LABEL: test_v2f32.rint:{{.*}} define %v2f32 @test_v2f32.rint(%v2f32 %a) { ; CHECK: rint %1 = call %v2f32 @llvm.rint.v2f32(%v2f32 %a) ret %v2f32 %1 } -; CHECK: test_v2f32.nearbyint: +; CHECK-LABEL: test_v2f32.nearbyint:{{.*}} define %v2f32 @test_v2f32.nearbyint(%v2f32 %a) { ; CHECK: nearbyint %1 = call %v2f32 @llvm.nearbyint.v2f32(%v2f32 %a) @@ -129,103 +129,103 @@ ;;; %v4f32 = type <4 x float> -; CHECK: test_v4f32.sqrt: +; CHECK-LABEL: test_v4f32.sqrt:{{.*}} define %v4f32 @test_v4f32.sqrt(%v4f32 %a) { ; CHECK: sqrt %1 = call %v4f32 @llvm.sqrt.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.powi: +; CHECK-LABEL: test_v4f32.powi:{{.*}} define %v4f32 @test_v4f32.powi(%v4f32 %a, i32 %b) { ; CHECK: pow %1 = call %v4f32 @llvm.powi.v4f32(%v4f32 %a, i32 %b) ret %v4f32 %1 } -; CHECK: test_v4f32.sin: +; CHECK-LABEL: test_v4f32.sin:{{.*}} define %v4f32 @test_v4f32.sin(%v4f32 %a) { ; CHECK: sin %1 = call %v4f32 @llvm.sin.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.cos: +; CHECK-LABEL: test_v4f32.cos:{{.*}} define %v4f32 @test_v4f32.cos(%v4f32 %a) { ; CHECK: cos %1 = call %v4f32 @llvm.cos.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.pow: +; CHECK-LABEL: test_v4f32.pow:{{.*}} define %v4f32 @test_v4f32.pow(%v4f32 %a, %v4f32 %b) { ; CHECK: pow %1 = call %v4f32 @llvm.pow.v4f32(%v4f32 %a, %v4f32 %b) ret %v4f32 %1 } -; CHECK: test_v4f32.exp: +; CHECK-LABEL: test_v4f32.exp:{{.*}} define %v4f32 @test_v4f32.exp(%v4f32 %a) { ; CHECK: exp %1 = call %v4f32 @llvm.exp.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.exp2: +; CHECK-LABEL: test_v4f32.exp2:{{.*}} define %v4f32 @test_v4f32.exp2(%v4f32 %a) { ; CHECK: exp %1 = call %v4f32 @llvm.exp2.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.log: +; CHECK-LABEL: test_v4f32.log:{{.*}} define %v4f32 @test_v4f32.log(%v4f32 %a) { ; CHECK: log %1 = call %v4f32 @llvm.log.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.log10: +; CHECK-LABEL: test_v4f32.log10:{{.*}} define %v4f32 @test_v4f32.log10(%v4f32 %a) { ; CHECK: log %1 = call %v4f32 @llvm.log10.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.log2: +; CHECK-LABEL: test_v4f32.log2:{{.*}} define %v4f32 @test_v4f32.log2(%v4f32 %a) { ; CHECK: log %1 = call %v4f32 @llvm.log2.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.fma: +; CHECK-LABEL: test_v4f32.fma:{{.*}} define %v4f32 @test_v4f32.fma(%v4f32 %a, %v4f32 %b, %v4f32 %c) { ; CHECK: fma %1 = call %v4f32 @llvm.fma.v4f32(%v4f32 %a, %v4f32 %b, %v4f32 %c) ret %v4f32 %1 } -; CHECK: test_v4f32.fabs: +; CHECK-LABEL: test_v4f32.fabs:{{.*}} define %v4f32 @test_v4f32.fabs(%v4f32 %a) { - ; CHECK: fabs + ; CHECK: vabs.f32 %1 = call %v4f32 @llvm.fabs.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.floor: +; CHECK-LABEL: test_v4f32.floor:{{.*}} define %v4f32 @test_v4f32.floor(%v4f32 %a) { ; CHECK: floor %1 = call %v4f32 @llvm.floor.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.fceil: +; CHECK-LABEL: test_v4f32.fceil:{{.*}} define %v4f32 @test_v4f32.fceil(%v4f32 %a) { ; CHECK: ceil %1 = call %v4f32 @llvm.fceil.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.trunc: +; CHECK-LABEL: test_v4f32.trunc:{{.*}} define %v4f32 @test_v4f32.trunc(%v4f32 %a) { ; CHECK: trunc %1 = call %v4f32 @llvm.trunc.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.rint: +; CHECK-LABEL: test_v4f32.rint:{{.*}} define %v4f32 @test_v4f32.rint(%v4f32 %a) { ; CHECK: rint %1 = call %v4f32 @llvm.rint.v4f32(%v4f32 %a) ret %v4f32 %1 } -; CHECK: test_v4f32.nearbyint: +; CHECK-LABEL: test_v4f32.nearbyint:{{.*}} define %v4f32 @test_v4f32.nearbyint(%v4f32 %a) { ; CHECK: nearbyint %1 = call %v4f32 @llvm.nearbyint.v4f32(%v4f32 %a) @@ -253,103 +253,97 @@ ;;; Double vector %v2f64 = type <2 x double> -; CHECK: test_v2f64.sqrt: +; CHECK-LABEL: test_v2f64.sqrt:{{.*}} define %v2f64 @test_v2f64.sqrt(%v2f64 %a) { ; CHECK: sqrt %1 = call %v2f64 @llvm.sqrt.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.powi: +; CHECK-LABEL: test_v2f64.powi:{{.*}} define %v2f64 @test_v2f64.powi(%v2f64 %a, i32 %b) { ; CHECK: pow %1 = call %v2f64 @llvm.powi.v2f64(%v2f64 %a, i32 %b) ret %v2f64 %1 } -; CHECK: test_v2f64.sin: +; CHECK-LABEL: test_v2f64.sin:{{.*}} define %v2f64 @test_v2f64.sin(%v2f64 %a) { ; CHECK: sin %1 = call %v2f64 @llvm.sin.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.cos: +; CHECK-LABEL: test_v2f64.cos:{{.*}} define %v2f64 @test_v2f64.cos(%v2f64 %a) { ; CHECK: cos %1 = call %v2f64 @llvm.cos.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.pow: +; CHECK-LABEL: test_v2f64.pow:{{.*}} define %v2f64 @test_v2f64.pow(%v2f64 %a, %v2f64 %b) { ; CHECK: pow %1 = call %v2f64 @llvm.pow.v2f64(%v2f64 %a, %v2f64 %b) ret %v2f64 %1 } -; CHECK: test_v2f64.exp: +; CHECK-LABEL: test_v2f64.exp:{{.*}} define %v2f64 @test_v2f64.exp(%v2f64 %a) { ; CHECK: exp %1 = call %v2f64 @llvm.exp.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.exp2: +; CHECK-LABEL: test_v2f64.exp2:{{.*}} define %v2f64 @test_v2f64.exp2(%v2f64 %a) { ; CHECK: exp %1 = call %v2f64 @llvm.exp2.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.log: +; CHECK-LABEL: test_v2f64.log:{{.*}} define %v2f64 @test_v2f64.log(%v2f64 %a) { ; CHECK: log %1 = call %v2f64 @llvm.log.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.log10: +; CHECK-LABEL: test_v2f64.log10:{{.*}} define %v2f64 @test_v2f64.log10(%v2f64 %a) { ; CHECK: log %1 = call %v2f64 @llvm.log10.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.log2: +; CHECK-LABEL: test_v2f64.log2:{{.*}} define %v2f64 @test_v2f64.log2(%v2f64 %a) { ; CHECK: log %1 = call %v2f64 @llvm.log2.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.fma: +; CHECK-LABEL: test_v2f64.fma:{{.*}} define %v2f64 @test_v2f64.fma(%v2f64 %a, %v2f64 %b, %v2f64 %c) { ; CHECK: fma %1 = call %v2f64 @llvm.fma.v2f64(%v2f64 %a, %v2f64 %b, %v2f64 %c) ret %v2f64 %1 } -; CHECK: test_v2f64.fabs: -define %v2f64 @test_v2f64.fabs(%v2f64 %a) { - ; CHECK: fabs - %1 = call %v2f64 @llvm.fabs.v2f64(%v2f64 %a) - ret %v2f64 %1 -} -; CHECK: test_v2f64.floor: +; CHECK-LABEL: test_v2f64.floor:{{.*}} define %v2f64 @test_v2f64.floor(%v2f64 %a) { ; CHECK: floor %1 = call %v2f64 @llvm.floor.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.fceil: +; CHECK-LABEL: test_v2f64.fceil:{{.*}} define %v2f64 @test_v2f64.fceil(%v2f64 %a) { ; CHECK: ceil %1 = call %v2f64 @llvm.fceil.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.trunc: +; CHECK-LABEL: test_v2f64.trunc:{{.*}} define %v2f64 @test_v2f64.trunc(%v2f64 %a) { ; CHECK: trunc %1 = call %v2f64 @llvm.trunc.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.rint: +; CHECK-LABEL: test_v2f64.rint:{{.*}} define %v2f64 @test_v2f64.rint(%v2f64 %a) { ; CHECK: rint %1 = call %v2f64 @llvm.rint.v2f64(%v2f64 %a) ret %v2f64 %1 } -; CHECK: test_v2f64.nearbyint: +; CHECK-LABEL: test_v2f64.nearbyint:{{.*}} define %v2f64 @test_v2f64.nearbyint(%v2f64 %a) { ; CHECK: nearbyint %1 = call %v2f64 @llvm.nearbyint.v2f64(%v2f64 %a) Index: test/DebugInfo/ARM/header.ll =================================================================== --- test/DebugInfo/ARM/header.ll +++ test/DebugInfo/ARM/header.ll @@ -8,7 +8,8 @@ ; CHECK-NEXT: .syntax unified ; CHECK-NEXT: .globl _f ; CHECK-NEXT: .p2align 2 -; CHECK-NEXT: _f: @ @f +; CHECK-NEXT: .code 32 @ @f +; CHECK-NEXT: _f: ; CHECK: .section __DWARF,__debug_str,regular,debug @@ -21,7 +22,7 @@ !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "foo", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2) !1 = !DIFile(filename: "/foo/test.c", directory: "/foo") !2 = !{} -!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) +!4 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2) !5 = !DISubroutineType(types: !6) !6 = !{null} !7 = !{i32 2, !"Dwarf Version", i32 4}