Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat $LLVM_HOME/tools/clang/lib/Basic/Targets.cpp
- ...
- ARCompactTargetInfo(const std::string& triple) : TargetInfo(triple) {
- // Set the default information variables.
- // Mostly taken from ARC GCC manual, some guessed from other targets.
- BigEndian = false;
- TLSSupported = false;
- NoAsmVariants = false;
- PointerWidth = PointerAlign = 32;
- BoolWidth = BoolAlign = 8;
- IntWidth = IntAlign = 32;
- LongWidth = LongAlign = 32;
- LongLongWidth = 64; LongLongAlign = 32;
- // TODO: Check this. I believe Suitable Align is an align for anything, so 32 should do.
- SuitableAlign = 32;
- HalfWidth = HalfAlign = 16;
- FloatWidth = FloatAlign = 32;
- DoubleWidth = 64; DoubleAlign = 32;
- LongDoubleWidth = 64; LongDoubleAlign = 32;
- // Most of this stuff is probably unsupported.
- LargeArrayMinWidth = 0;
- LargeArrayAlign = 0;
- MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 0;
- // Type information.
- SizeType = UnsignedInt;
- PtrDiffType = SignedInt;
- IntMaxType = SignedLongLong;
- UIntMaxType = UnsignedLongLong;
- IntPtrType = SignedInt;
- WCharType = SignedInt; // Not sure if correct.
- WIntType = SignedInt; // Not sure if correct.
- Char16Type = UnsignedShort;
- Char32Type = UnsignedInt;
- Int64Type = SignedLongLong; // Not sure if correct.
- SigAtomicType = SignedInt; // Not sure if correct.
- DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
- "i64:32:32:32-f32:32:32:32-f64:32:32:32-n32";
- UserLabelPrefix = "_"; // TODO: Check.
- }
- ...
- $ cat test.c
- int main() {
- double x = 5.5;
- return 0;
- }
- $ clang -ccc-host-triple arcompact -O0 test.c -emit-llvm -S -o test.ll
- $ cat test.ll
- ; ModuleID = 'test.c'
- target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32:32-f32:32:32:32-f64:32:32:32-n32"
- target triple = "arcompact"
- define i32 @main() nounwind {
- entry:
- %retval = alloca i32, align 4
- %x = alloca double, align 8 <---- why does this happen?
- store i32 0, i32* %retval
- store double 5.500000e+00, double* %x, align 8 <---- why does this happen?
- ret i32 0
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement