[ARM] Fix crash when targetting CPU without NEON

We emulate a scalar vmin/vmax with NEON instructions as they don't exist in the VFP ISA. So only mark these as legal when NEON is available.

Found here: https://code.google.com/p/chromium/issues/detail?id=521671

llvm-svn: 245231
This commit is contained in:
James Molloy 2015-08-17 19:37:12 +00:00
parent 8b7c0398b6
commit 974838f294
2 changed files with 4 additions and 3 deletions

View File

@ -950,11 +950,11 @@ ARMTargetLowering::ARMTargetLowering(const TargetMachine &TM,
}
}
if (Subtarget->hasVFP3()) {
if (Subtarget->hasNEON()) {
// vmin and vmax aren't available in a scalar form, so we use
// a NEON instruction with an undef lane instead.
setOperationAction(ISD::FMINNAN, MVT::f32, Legal);
setOperationAction(ISD::FMAXNAN, MVT::f32, Legal);
}
if (Subtarget->hasNEON()) {
setOperationAction(ISD::FMINNAN, MVT::v2f32, Legal);
setOperationAction(ISD::FMAXNAN, MVT::v2f32, Legal);
setOperationAction(ISD::FMINNAN, MVT::v4f32, Legal);

View File

@ -1,4 +1,5 @@
; RUN: llc -mtriple=arm-eabi -mcpu=swift %s -o - | FileCheck %s
; RUN: llc -mtriple=arm-eabi -mcpu=cortex-a8 -mattr=-neon %s -o -
define float @fmin_ole(float %x) nounwind {
;CHECK-LABEL: fmin_ole: