OLD | NEW |
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 2791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2802 default: | 2802 default: |
2803 UnimplementedLoweringError(this, Instr); | 2803 UnimplementedLoweringError(this, Instr); |
2804 return; | 2804 return; |
2805 // Explicitly whitelist vector instructions we have implemented/enabled. | 2805 // Explicitly whitelist vector instructions we have implemented/enabled. |
2806 case InstArithmetic::Fadd: | 2806 case InstArithmetic::Fadd: |
2807 case InstArithmetic::Add: | 2807 case InstArithmetic::Add: |
2808 case InstArithmetic::Fsub: | 2808 case InstArithmetic::Fsub: |
2809 case InstArithmetic::Sub: | 2809 case InstArithmetic::Sub: |
2810 case InstArithmetic::And: | 2810 case InstArithmetic::And: |
2811 case InstArithmetic::Or: | 2811 case InstArithmetic::Or: |
| 2812 case InstArithmetic::Xor: |
2812 break; | 2813 break; |
2813 } | 2814 } |
2814 } | 2815 } |
2815 | 2816 |
2816 Variable *T = makeReg(DestTy); | 2817 Variable *T = makeReg(DestTy); |
2817 | 2818 |
2818 // * Handle div/rem separately. They require a non-legalized Src1 to inspect | 2819 // * Handle div/rem separately. They require a non-legalized Src1 to inspect |
2819 // whether or not Src1 is a non-zero constant. Once legalized it is more | 2820 // whether or not Src1 is a non-zero constant. Once legalized it is more |
2820 // difficult to determine (constant may be moved to a register). | 2821 // difficult to determine (constant may be moved to a register). |
2821 // * Handle floating point arithmetic separately: they require Src1 to be | 2822 // * Handle floating point arithmetic separately: they require Src1 to be |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2974 _vorr(T, Src0R, Src1R); | 2975 _vorr(T, Src0R, Src1R); |
2975 } else { | 2976 } else { |
2976 Operand *Src1RF = Srcs.src1RF(this); | 2977 Operand *Src1RF = Srcs.src1RF(this); |
2977 _orr(T, Src0R, Src1RF); | 2978 _orr(T, Src0R, Src1RF); |
2978 } | 2979 } |
2979 _mov(Dest, T); | 2980 _mov(Dest, T); |
2980 return; | 2981 return; |
2981 } | 2982 } |
2982 case InstArithmetic::Xor: { | 2983 case InstArithmetic::Xor: { |
2983 Variable *Src0R = Srcs.src0R(this); | 2984 Variable *Src0R = Srcs.src0R(this); |
2984 Operand *Src1RF = Srcs.src1RF(this); | 2985 if (isVectorType(DestTy)) { |
2985 _eor(T, Src0R, Src1RF); | 2986 Variable *Src1R = legalizeToReg(Src1); |
| 2987 _veor(T, Src0R, Src1R); |
| 2988 } else { |
| 2989 Operand *Src1RF = Srcs.src1RF(this); |
| 2990 _eor(T, Src0R, Src1RF); |
| 2991 } |
2986 _mov(Dest, T); | 2992 _mov(Dest, T); |
2987 return; | 2993 return; |
2988 } | 2994 } |
2989 case InstArithmetic::Sub: { | 2995 case InstArithmetic::Sub: { |
2990 if (const Inst *Src1Producer = Computations.getProducerOf(Src1)) { | 2996 if (const Inst *Src1Producer = Computations.getProducerOf(Src1)) { |
2991 assert(!isVectorType(DestTy)); | 2997 assert(!isVectorType(DestTy)); |
2992 Variable *Src0R = legalizeToReg(Src0); | 2998 Variable *Src0R = legalizeToReg(Src0); |
2993 Variable *Src1R = legalizeToReg(Src1Producer->getSrc(0)); | 2999 Variable *Src1R = legalizeToReg(Src1Producer->getSrc(0)); |
2994 Variable *Src2R = legalizeToReg(Src1Producer->getSrc(1)); | 3000 Variable *Src2R = legalizeToReg(Src1Producer->getSrc(1)); |
2995 _mls(T, Src1R, Src2R, Src0R); | 3001 _mls(T, Src1R, Src2R, Src0R); |
(...skipping 3503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6499 // Technically R9 is used for TLS with Sandboxing, and we reserve it. | 6505 // Technically R9 is used for TLS with Sandboxing, and we reserve it. |
6500 // However, for compatibility with current NaCl LLVM, don't claim that. | 6506 // However, for compatibility with current NaCl LLVM, don't claim that. |
6501 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; | 6507 Str << ".eabi_attribute 14, 3 @ Tag_ABI_PCS_R9_use: Not used\n"; |
6502 } | 6508 } |
6503 | 6509 |
6504 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; | 6510 llvm::SmallBitVector TargetARM32::TypeToRegisterSet[RegARM32::RCARM32_NUM]; |
6505 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; | 6511 llvm::SmallBitVector TargetARM32::RegisterAliases[RegARM32::Reg_NUM]; |
6506 | 6512 |
6507 } // end of namespace ARM32 | 6513 } // end of namespace ARM32 |
6508 } // end of namespace Ice | 6514 } // end of namespace Ice |
OLD | NEW |