//===----------------------------------------------------------------------===//
#include "ARMLegalizerInfo.h"
+#include "ARMSubtarget.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Type.h"
#error "You shouldn't build this"
#endif
-ARMLegalizerInfo::ARMLegalizerInfo() {
+ARMLegalizerInfo::ARMLegalizerInfo(const ARMSubtarget &ST) {
using namespace TargetOpcode;
const LLT p0 = LLT::pointer(0, 32);
setAction({G_LOAD, Ty}, Legal);
setAction({G_LOAD, 1, p0}, Legal);
- // FIXME: This is strictly for loading double-precision floating point values,
- // if the hardware allows it. We rely on the instruction selector to complain
- // otherwise.
- setAction({G_LOAD, s64}, Legal);
-
for (auto Ty : {s1, s8, s16, s32})
setAction({G_ADD, Ty}, Legal);
setAction({Op, 1, Ty}, Legal);
}
- // FIXME: This is a bit sloppy, but for now we'll just rely on the instruction
- // selector to complain if it doesn't support floating point.
- setAction({G_FADD, s32}, Legal);
- setAction({G_FADD, s64}, Legal);
+ if (ST.hasVFP2()) {
+ setAction({G_FADD, s32}, Legal);
+ setAction({G_FADD, s64}, Legal);
+
+ setAction({G_LOAD, s64}, Legal);
+ }
computeTables();
}
define void @test_add_s32() { ret void }
define void @test_load_from_stack() { ret void }
- define void @test_legal_loads() { ret void }
+ define void @test_legal_loads() #0 { ret void }
- define void @test_fadd_s32() { ret void }
- define void @test_fadd_s64() { ret void }
+ define void @test_fadd_s32() #0 { ret void }
+ define void @test_fadd_s64() #0 { ret void }
+
+ attributes #0 = { "target-features"="+vfp2" }
...
---
name: test_sext_s8