Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: src/IceTargetLoweringARM32.cpp

Issue 1397933002: Start incorporating the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nit and add URL. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===// 1 //===- subzero/src/IceTargetLoweringARM32.cpp - ARM32 lowering ------------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 19 matching lines...) Expand all
30 #include "IceUtils.h" 30 #include "IceUtils.h"
31 #include "llvm/Support/MathExtras.h" 31 #include "llvm/Support/MathExtras.h"
32 32
33 #include <algorithm> 33 #include <algorithm>
34 #include <utility> 34 #include <utility>
35 35
36 namespace Ice { 36 namespace Ice {
37 37
38 namespace { 38 namespace {
39 39
40 // UnimplementedError is defined as a macro so that we can get actual line
41 // numbers.
42 #define UnimplementedError(Flags) \
43 do { \
44 if (!static_cast<const ClFlags &>(Flags).getSkipUnimplemented()) { \
45 /* Use llvm_unreachable instead of report_fatal_error, which gives \
46 better stack traces. */ \
47 llvm_unreachable("Not yet implemented"); \
48 abort(); \
49 } \
50 } while (0)
51
52 // The following table summarizes the logic for lowering the icmp instruction 40 // The following table summarizes the logic for lowering the icmp instruction
53 // for i32 and narrower types. Each icmp condition has a clear mapping to an 41 // for i32 and narrower types. Each icmp condition has a clear mapping to an
54 // ARM32 conditional move instruction. 42 // ARM32 conditional move instruction.
55 43
56 const struct TableIcmp32_ { 44 const struct TableIcmp32_ {
57 CondARM32::Cond Mapping; 45 CondARM32::Cond Mapping;
58 } TableIcmp32[] = { 46 } TableIcmp32[] = {
59 #define X(val, is_signed, swapped64, C_32, C1_64, C2_64) \ 47 #define X(val, is_signed, swapped64, C_32, C1_64, C2_64) \
60 { CondARM32::C_32 } \ 48 { CondARM32::C_32 } \
61 , 49 ,
(...skipping 3802 matching lines...) Expand 10 before | Expand all | Expand 10 after
3864 } 3852 }
3865 } // end of anonymous namespace 3853 } // end of anonymous namespace
3866 3854
3867 void TargetDataARM32::lowerConstants() { 3855 void TargetDataARM32::lowerConstants() {
3868 if (Ctx->getFlags().getDisableTranslation()) 3856 if (Ctx->getFlags().getDisableTranslation())
3869 return; 3857 return;
3870 switch (Ctx->getFlags().getOutFileType()) { 3858 switch (Ctx->getFlags().getOutFileType()) {
3871 case FT_Elf: 3859 case FT_Elf:
3872 UnimplementedError(Ctx->getFlags()); 3860 UnimplementedError(Ctx->getFlags());
3873 break; 3861 break;
3874 case FT_Asm: { 3862 case FT_Asm:
3863 case FT_Iasm: {
3875 OstreamLocker L(Ctx); 3864 OstreamLocker L(Ctx);
3876 emitConstantPool<float>(Ctx); 3865 emitConstantPool<float>(Ctx);
3877 emitConstantPool<double>(Ctx); 3866 emitConstantPool<double>(Ctx);
3878 break; 3867 break;
3879 } 3868 }
3880 case FT_Iasm: {
3881 UnimplementedError(Ctx->getFlags());
3882 break;
3883 }
3884 } 3869 }
3885 } 3870 }
3886 3871
3887 void TargetDataARM32::lowerJumpTables() { 3872 void TargetDataARM32::lowerJumpTables() {
3888 if (Ctx->getFlags().getDisableTranslation()) 3873 if (Ctx->getFlags().getDisableTranslation())
3889 return; 3874 return;
3890 switch (Ctx->getFlags().getOutFileType()) { 3875 switch (Ctx->getFlags().getOutFileType()) {
3891 case FT_Elf: 3876 case FT_Elf:
3892 UnimplementedError(Ctx->getFlags()); 3877 UnimplementedError(Ctx->getFlags());
3893 break; 3878 break;
3894 case FT_Asm: 3879 case FT_Asm:
3895 // Already emitted from Cfg 3880 // Already emitted from Cfg
3896 break; 3881 break;
3897 case FT_Iasm: { 3882 case FT_Iasm: {
3898 UnimplementedError(Ctx->getFlags()); 3883 // TODO(kschimpf): Fill this in when we get more information.
3899 break; 3884 break;
3900 } 3885 }
3901 } 3886 }
3902 } 3887 }
3903 3888
3904 TargetHeaderARM32::TargetHeaderARM32(GlobalContext *Ctx) 3889 TargetHeaderARM32::TargetHeaderARM32(GlobalContext *Ctx)
3905 : TargetHeaderLowering(Ctx), CPUFeatures(Ctx->getFlags()) {} 3890 : TargetHeaderLowering(Ctx), CPUFeatures(Ctx->getFlags()) {}
3906 3891
3907 void TargetHeaderARM32::lower() { 3892 void TargetHeaderARM32::lower() {
3908 OstreamLocker L(Ctx); 3893 OstreamLocker L(Ctx);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3944 << ".eabi_attribute 68, 1 @ Tag_Virtualization_use\n"; 3929 << ".eabi_attribute 68, 1 @ Tag_Virtualization_use\n";
3945 if (CPUFeatures.hasFeature(TargetARM32Features::HWDivArm)) { 3930 if (CPUFeatures.hasFeature(TargetARM32Features::HWDivArm)) {
3946 Str << ".eabi_attribute 44, 2 @ Tag_DIV_use\n"; 3931 Str << ".eabi_attribute 44, 2 @ Tag_DIV_use\n";
3947 } 3932 }
3948 // Technically R9 is used for TLS with Sandboxing, and we reserve it. 3933 // Technically R9 is used for TLS with Sandboxing, and we reserve it.
3949 // However, for compatibility with current NaCl LLVM, don't claim that. 3934 // However, for compatibility with current NaCl LLVM, don't claim that.
3950 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; 3935 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n";
3951 } 3936 }
3952 3937
3953 } // end of namespace Ice 3938 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | src/IceTargetLoweringMIPS32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698