Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// | 1 //===- subzero/src/IceAssemblerARM32.cpp - Assembler for ARM32 --*- C++ -*-===// |
| 2 // | 2 // |
| 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 3 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 4 // for details. All rights reserved. Use of this source code is governed by a | 4 // for details. All rights reserved. Use of this source code is governed by a |
| 5 // BSD-style license that can be found in the LICENSE file. | 5 // BSD-style license that can be found in the LICENSE file. |
| 6 // | 6 // |
| 7 // Modified by the Subzero authors. | 7 // Modified by the Subzero authors. |
| 8 // | 8 // |
| 9 //===----------------------------------------------------------------------===// | 9 //===----------------------------------------------------------------------===// |
| 10 // | 10 // |
| (...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1038 assert(CondARM32::isDefined(Cond)); | 1038 assert(CondARM32::isDefined(Cond)); |
| 1039 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9 | B8; | 1039 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9 | B8; |
| 1040 const IValueT Encoding = | 1040 const IValueT Encoding = |
| 1041 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | | 1041 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | |
| 1042 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dn) << 16) | | 1042 (getYInRegYXXXX(Dd) << 22) | (getXXXXInRegYXXXX(Dn) << 16) | |
| 1043 (getXXXXInRegYXXXX(Dd) << 12) | (getYInRegYXXXX(Dn) << 7) | | 1043 (getXXXXInRegYXXXX(Dd) << 12) | (getYInRegYXXXX(Dn) << 7) | |
| 1044 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm); | 1044 (getYInRegYXXXX(Dm) << 5) | getXXXXInRegYXXXX(Dm); |
| 1045 emitInst(Encoding); | 1045 emitInst(Encoding); |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 void AssemblerARM32::emitVFPddd(CondARM32::Cond Cond, IValueT Opcode, | |
| 1049 const Operand *OpDd, const Operand *OpDn, | |
|
John
2016/01/26 19:13:15
incredibly ridiculous nit, optional: because C(++)
Jim Stichnoth
2016/01/26 19:25:48
For historical bad reasons (my fault), pretty much
Karl
2016/01/26 20:38:39
For now, I won't change the signature.
| |
| 1050 const Operand *OpDm, const char *InstName) { | |
| 1051 IValueT Dd = encodeDRegister(OpDd, "Dd", InstName); | |
| 1052 IValueT Dn = encodeDRegister(OpDn, "Dn", InstName); | |
| 1053 IValueT Dm = encodeDRegister(OpDm, "Dm", InstName); | |
| 1054 emitVFPddd(Cond, Opcode, Dd, Dn, Dm); | |
| 1055 } | |
| 1056 | |
| 1048 void AssemblerARM32::emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, | 1057 void AssemblerARM32::emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, |
| 1049 IValueT Sd, IValueT Sn, IValueT Sm) { | 1058 IValueT Sd, IValueT Sn, IValueT Sm) { |
| 1050 assert(Sd < RegARM32::getNumSRegs()); | 1059 assert(Sd < RegARM32::getNumSRegs()); |
| 1051 assert(Sn < RegARM32::getNumSRegs()); | 1060 assert(Sn < RegARM32::getNumSRegs()); |
| 1052 assert(Sm < RegARM32::getNumSRegs()); | 1061 assert(Sm < RegARM32::getNumSRegs()); |
| 1053 assert(CondARM32::isDefined(Cond)); | 1062 assert(CondARM32::isDefined(Cond)); |
| 1054 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; | 1063 constexpr IValueT VFPOpcode = B27 | B26 | B25 | B11 | B9; |
| 1055 const IValueT Encoding = | 1064 const IValueT Encoding = |
| 1056 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | | 1065 Opcode | VFPOpcode | (encodeCondition(Cond) << kConditionShift) | |
| 1057 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sn) << 16) | | 1066 (getYInRegXXXXY(Sd) << 22) | (getXXXXInRegXXXXY(Sn) << 16) | |
| 1058 (getXXXXInRegXXXXY(Sd) << 12) | (getYInRegXXXXY(Sn) << 7) | | 1067 (getXXXXInRegXXXXY(Sd) << 12) | (getYInRegXXXXY(Sn) << 7) | |
| 1059 (getYInRegXXXXY(Sm) << 5) | getXXXXInRegXXXXY(Sm); | 1068 (getYInRegXXXXY(Sm) << 5) | getXXXXInRegXXXXY(Sm); |
| 1060 emitInst(Encoding); | 1069 emitInst(Encoding); |
| 1061 } | 1070 } |
| 1062 | 1071 |
| 1072 void AssemblerARM32::emitVFPsss(CondARM32::Cond Cond, IValueT Opcode, | |
| 1073 const Operand *OpSd, const Operand *OpSn, | |
| 1074 const Operand *OpSm, const char *InstName) { | |
| 1075 const IValueT Sd = encodeSRegister(OpSd, "Sd", InstName); | |
| 1076 const IValueT Sn = encodeSRegister(OpSn, "Sn", InstName); | |
| 1077 const IValueT Sm = encodeSRegister(OpSm, "Sm", InstName); | |
| 1078 emitVFPsss(Cond, Opcode, Sd, Sn, Sm); | |
| 1079 } | |
| 1080 | |
| 1063 void AssemblerARM32::adc(const Operand *OpRd, const Operand *OpRn, | 1081 void AssemblerARM32::adc(const Operand *OpRd, const Operand *OpRn, |
| 1064 const Operand *OpSrc1, bool SetFlags, | 1082 const Operand *OpSrc1, bool SetFlags, |
| 1065 CondARM32::Cond Cond) { | 1083 CondARM32::Cond Cond) { |
| 1066 // ADC (register) - ARM section 18.8.2, encoding A1: | 1084 // ADC (register) - ARM section 18.8.2, encoding A1: |
| 1067 // adc{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} | 1085 // adc{s}<c> <Rd>, <Rn>, <Rm>{, <shift>} |
| 1068 // | 1086 // |
| 1069 // cccc0000101snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, | 1087 // cccc0000101snnnnddddiiiiitt0mmmm where cccc=Cond, dddd=Rd, nnnn=Rn, |
| 1070 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags. | 1088 // mmmm=Rm, iiiii=Shift, tt=ShiftKind, and s=SetFlags. |
| 1071 // | 1089 // |
| 1072 // ADC (Immediate) - ARM section A8.8.1, encoding A1: | 1090 // ADC (Immediate) - ARM section A8.8.1, encoding A1: |
| (...skipping 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2068 } | 2086 } |
| 2069 | 2087 |
| 2070 void AssemblerARM32::vadds(const Operand *OpSd, const Operand *OpSn, | 2088 void AssemblerARM32::vadds(const Operand *OpSd, const Operand *OpSn, |
| 2071 const Operand *OpSm, CondARM32::Cond Cond) { | 2089 const Operand *OpSm, CondARM32::Cond Cond) { |
| 2072 // VADD (floating-point) - ARM section A8.8.283, encoding A2: | 2090 // VADD (floating-point) - ARM section A8.8.283, encoding A2: |
| 2073 // vadd<c>.f32 <Sd>, <Sn>, <Sm> | 2091 // vadd<c>.f32 <Sd>, <Sn>, <Sm> |
| 2074 // | 2092 // |
| 2075 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, | 2093 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, |
| 2076 // and mmmmM=Rm. | 2094 // and mmmmM=Rm. |
| 2077 constexpr const char *Vadds = "vadds"; | 2095 constexpr const char *Vadds = "vadds"; |
| 2078 IValueT Sd = encodeSRegister(OpSd, "Sd", Vadds); | |
| 2079 IValueT Sn = encodeSRegister(OpSn, "Sn", Vadds); | |
| 2080 IValueT Sm = encodeSRegister(OpSm, "Sm", Vadds); | |
| 2081 constexpr IValueT VaddsOpcode = B21 | B20; | 2096 constexpr IValueT VaddsOpcode = B21 | B20; |
| 2082 emitVFPsss(Cond, VaddsOpcode, Sd, Sn, Sm); | 2097 emitVFPsss(Cond, VaddsOpcode, OpSd, OpSn, OpSm, Vadds); |
| 2083 } | 2098 } |
| 2084 | 2099 |
| 2085 void AssemblerARM32::vaddd(const Operand *OpDd, const Operand *OpDn, | 2100 void AssemblerARM32::vaddd(const Operand *OpDd, const Operand *OpDn, |
| 2086 const Operand *OpDm, CondARM32::Cond Cond) { | 2101 const Operand *OpDm, CondARM32::Cond Cond) { |
| 2087 // VADD (floating-point) - ARM section A8.8.283, encoding A2: | 2102 // VADD (floating-point) - ARM section A8.8.283, encoding A2: |
| 2088 // vadd<c>.f64 <Dd>, <Dn>, <Dm> | 2103 // vadd<c>.f64 <Dd>, <Dn>, <Dm> |
| 2089 // | 2104 // |
| 2090 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, | 2105 // cccc11100D11nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, |
| 2091 // and Mmmmm=Rm. | 2106 // and Mmmmm=Rm. |
| 2092 constexpr const char *Vaddd = "vaddd"; | 2107 constexpr const char *Vaddd = "vaddd"; |
| 2093 IValueT Dd = encodeDRegister(OpDd, "Dd", Vaddd); | |
| 2094 IValueT Dn = encodeDRegister(OpDn, "Dn", Vaddd); | |
| 2095 IValueT Dm = encodeDRegister(OpDm, "Dm", Vaddd); | |
| 2096 constexpr IValueT VadddOpcode = B21 | B20; | 2108 constexpr IValueT VadddOpcode = B21 | B20; |
| 2097 emitVFPddd(Cond, VadddOpcode, Dd, Dn, Dm); | 2109 emitVFPddd(Cond, VadddOpcode, OpDd, OpDn, OpDm, Vaddd); |
| 2098 } | 2110 } |
| 2099 | 2111 |
| 2100 void AssemblerARM32::vcmpd(const Operand *OpDd, const Operand *OpDm, | 2112 void AssemblerARM32::vcmpd(const Operand *OpDd, const Operand *OpDm, |
| 2101 CondARM32::Cond Cond) { | 2113 CondARM32::Cond Cond) { |
| 2102 constexpr const char *Vcmpd = "vcmpd"; | 2114 constexpr const char *Vcmpd = "vcmpd"; |
| 2103 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcmpd); | 2115 IValueT Dd = encodeDRegister(OpDd, "Dd", Vcmpd); |
| 2104 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcmpd); | 2116 IValueT Dm = encodeDRegister(OpDm, "Dm", Vcmpd); |
| 2105 constexpr IValueT VcmpdOpcode = B23 | B21 | B20 | B18 | B6; | 2117 constexpr IValueT VcmpdOpcode = B23 | B21 | B20 | B18 | B6; |
| 2106 constexpr IValueT Dn = 0; | 2118 constexpr IValueT Dn = 0; |
| 2107 emitVFPddd(Cond, VcmpdOpcode, Dd, Dn, Dm); | 2119 emitVFPddd(Cond, VcmpdOpcode, Dd, Dn, Dm); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2298 } | 2310 } |
| 2299 | 2311 |
| 2300 void AssemblerARM32::vdivs(const Operand *OpSd, const Operand *OpSn, | 2312 void AssemblerARM32::vdivs(const Operand *OpSd, const Operand *OpSn, |
| 2301 const Operand *OpSm, CondARM32::Cond Cond) { | 2313 const Operand *OpSm, CondARM32::Cond Cond) { |
| 2302 // VDIV (floating-point) - ARM section A8.8.283, encoding A2: | 2314 // VDIV (floating-point) - ARM section A8.8.283, encoding A2: |
| 2303 // vdiv<c>.f32 <Sd>, <Sn>, <Sm> | 2315 // vdiv<c>.f32 <Sd>, <Sn>, <Sm> |
| 2304 // | 2316 // |
| 2305 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, | 2317 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, |
| 2306 // and mmmmM=Rm. | 2318 // and mmmmM=Rm. |
| 2307 constexpr const char *Vdivs = "vdivs"; | 2319 constexpr const char *Vdivs = "vdivs"; |
| 2308 IValueT Sd = encodeSRegister(OpSd, "Sd", Vdivs); | |
| 2309 IValueT Sn = encodeSRegister(OpSn, "Sn", Vdivs); | |
| 2310 IValueT Sm = encodeSRegister(OpSm, "Sm", Vdivs); | |
| 2311 constexpr IValueT VdivsOpcode = B23; | 2320 constexpr IValueT VdivsOpcode = B23; |
| 2312 emitVFPsss(Cond, VdivsOpcode, Sd, Sn, Sm); | 2321 emitVFPsss(Cond, VdivsOpcode, OpSd, OpSn, OpSm, Vdivs); |
| 2313 } | 2322 } |
| 2314 | 2323 |
| 2315 void AssemblerARM32::vdivd(const Operand *OpDd, const Operand *OpDn, | 2324 void AssemblerARM32::vdivd(const Operand *OpDd, const Operand *OpDn, |
| 2316 const Operand *OpDm, CondARM32::Cond Cond) { | 2325 const Operand *OpDm, CondARM32::Cond Cond) { |
| 2317 // VDIV (floating-point) - ARM section A8.8.283, encoding A2: | 2326 // VDIV (floating-point) - ARM section A8.8.283, encoding A2: |
| 2318 // vdiv<c>.f64 <Dd>, <Dn>, <Dm> | 2327 // vdiv<c>.f64 <Dd>, <Dn>, <Dm> |
| 2319 // | 2328 // |
| 2320 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, | 2329 // cccc11101D00nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, |
| 2321 // and Mmmmm=Rm. | 2330 // and Mmmmm=Rm. |
| 2322 constexpr const char *Vdivd = "vdivd"; | 2331 constexpr const char *Vdivd = "vdivd"; |
| 2323 IValueT Dd = encodeDRegister(OpDd, "Dd", Vdivd); | |
| 2324 IValueT Dn = encodeDRegister(OpDn, "Dn", Vdivd); | |
| 2325 IValueT Dm = encodeDRegister(OpDm, "Dm", Vdivd); | |
| 2326 constexpr IValueT VdivdOpcode = B23; | 2332 constexpr IValueT VdivdOpcode = B23; |
| 2327 emitVFPddd(Cond, VdivdOpcode, Dd, Dn, Dm); | 2333 emitVFPddd(Cond, VdivdOpcode, OpDd, OpDn, OpDm, Vdivd); |
| 2328 } | 2334 } |
| 2329 | 2335 |
| 2330 void AssemblerARM32::veord(const Operand *OpDd, const Operand *OpDn, | 2336 void AssemblerARM32::veord(const Operand *OpDd, const Operand *OpDn, |
| 2331 const Operand *OpDm) { | 2337 const Operand *OpDm) { |
| 2332 // VEOR - ARM secdtion A8.8.315, encoding A1: | 2338 // VEOR - ARM secdtion A8.8.315, encoding A1: |
| 2333 // veor<c> <Dd>, <Dn>, <Dm> | 2339 // veor<c> <Dd>, <Dn>, <Dm> |
| 2334 // | 2340 // |
| 2335 // 111100110D00nnnndddd0001N0M1mmmm where Ddddd=Dd, Nnnnn=Dn, and Mmmmm=Dm. | 2341 // 111100110D00nnnndddd0001N0M1mmmm where Ddddd=Dd, Nnnnn=Dn, and Mmmmm=Dm. |
| 2336 constexpr const char *Veord = "veord"; | 2342 constexpr const char *Veord = "veord"; |
| 2337 IValueT Dd = encodeDRegister(OpDd, "Dd", Veord); | 2343 IValueT Dd = encodeDRegister(OpDd, "Dd", Veord); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2403 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovsr); | 2409 IValueT Rt = encodeGPRegister(OpRt, "Rt", Vmovsr); |
| 2404 assert(Sn < RegARM32::getNumSRegs()); | 2410 assert(Sn < RegARM32::getNumSRegs()); |
| 2405 assert(Rt < RegARM32::getNumGPRegs()); | 2411 assert(Rt < RegARM32::getNumGPRegs()); |
| 2406 assert(CondARM32::isDefined(Cond)); | 2412 assert(CondARM32::isDefined(Cond)); |
| 2407 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 | | 2413 IValueT Encoding = (encodeCondition(Cond) << kConditionShift) | B27 | B26 | |
| 2408 B25 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) | | 2414 B25 | B11 | B9 | B4 | (getXXXXInRegXXXXY(Sn) << 16) | |
| 2409 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7); | 2415 (Rt << kRdShift) | (getYInRegXXXXY(Sn) << 7); |
| 2410 emitInst(Encoding); | 2416 emitInst(Encoding); |
| 2411 } | 2417 } |
| 2412 | 2418 |
| 2419 void AssemblerARM32::vmlad(const Operand *OpDd, const Operand *OpDn, | |
| 2420 const Operand *OpDm, CondARM32::Cond Cond) { | |
| 2421 // VMLA, VMLS (floating-point), ARM section A8.8.337, encoding A2: | |
| 2422 // vmla<c>.f64 <Dd>, <Dn>, <Dm> | |
| 2423 // | |
| 2424 // cccc11100d00nnnndddd1011n0M0mmmm where cccc=Cond, Ddddd=Dd, Nnnnn=Dn, and | |
| 2425 // Mmmmm=Dm | |
| 2426 constexpr const char *Vmlad = "vmlad"; | |
| 2427 constexpr IValueT VmladOpcode = 0; | |
| 2428 emitVFPddd(Cond, VmladOpcode, OpDd, OpDn, OpDm, Vmlad); | |
| 2429 } | |
| 2430 | |
| 2431 void AssemblerARM32::vmlas(const Operand *OpSd, const Operand *OpSn, | |
| 2432 const Operand *OpSm, CondARM32::Cond Cond) { | |
| 2433 // VMLA, VMLS (floating-point), ARM section A8.8.337, encoding A2: | |
| 2434 // vmla<c>.f32 <Sd>, <Sn>, <Sm> | |
| 2435 // | |
| 2436 // cccc11100d00nnnndddd1010n0M0mmmm where cccc=Cond, ddddD=Sd, nnnnN=Sn, and | |
| 2437 // mmmmM=Sm | |
| 2438 constexpr const char *Vmlas = "vmlas"; | |
| 2439 constexpr IValueT VmlasOpcode = 0; | |
| 2440 emitVFPsss(Cond, VmlasOpcode, OpSd, OpSn, OpSm, Vmlas); | |
| 2441 } | |
| 2442 | |
| 2413 void AssemblerARM32::vmrsAPSR_nzcv(CondARM32::Cond Cond) { | 2443 void AssemblerARM32::vmrsAPSR_nzcv(CondARM32::Cond Cond) { |
| 2414 // MVRS - ARM section A*.8.348, encoding A1: | 2444 // MVRS - ARM section A*.8.348, encoding A1: |
| 2415 // vmrs<c> APSR_nzcv, FPSCR | 2445 // vmrs<c> APSR_nzcv, FPSCR |
| 2416 // | 2446 // |
| 2417 // cccc111011110001tttt101000010000 where tttt=0x15 (i.e. when Rt=pc, use | 2447 // cccc111011110001tttt101000010000 where tttt=0x15 (i.e. when Rt=pc, use |
| 2418 // APSR_nzcv instead). | 2448 // APSR_nzcv instead). |
| 2419 assert(CondARM32::isDefined(Cond)); | 2449 assert(CondARM32::isDefined(Cond)); |
| 2420 IValueT Encoding = B27 | B26 | B25 | B23 | B22 | B21 | B20 | B16 | B15 | B14 | | 2450 IValueT Encoding = B27 | B26 | B25 | B23 | B22 | B21 | B20 | B16 | B15 | B14 | |
| 2421 B13 | B12 | B11 | B9 | B4 | | 2451 B13 | B12 | B11 | B9 | B4 | |
| 2422 (encodeCondition(Cond) << kConditionShift); | 2452 (encodeCondition(Cond) << kConditionShift); |
| 2423 emitInst(Encoding); | 2453 emitInst(Encoding); |
| 2424 } | 2454 } |
| 2425 | 2455 |
| 2426 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn, | 2456 void AssemblerARM32::vmuls(const Operand *OpSd, const Operand *OpSn, |
| 2427 const Operand *OpSm, CondARM32::Cond Cond) { | 2457 const Operand *OpSm, CondARM32::Cond Cond) { |
| 2428 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: | 2458 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: |
| 2429 // vmul<c>.f32 <Sd>, <Sn>, <Sm> | 2459 // vmul<c>.f32 <Sd>, <Sn>, <Sm> |
| 2430 // | 2460 // |
| 2431 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, | 2461 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, |
| 2432 // and mmmmM=Rm. | 2462 // and mmmmM=Rm. |
| 2433 constexpr const char *Vmuls = "vmuls"; | 2463 constexpr const char *Vmuls = "vmuls"; |
| 2434 IValueT Sd = encodeSRegister(OpSd, "Sd", Vmuls); | |
| 2435 IValueT Sn = encodeSRegister(OpSn, "Sn", Vmuls); | |
| 2436 IValueT Sm = encodeSRegister(OpSm, "Sm", Vmuls); | |
| 2437 constexpr IValueT VmulsOpcode = B21; | 2464 constexpr IValueT VmulsOpcode = B21; |
| 2438 emitVFPsss(Cond, VmulsOpcode, Sd, Sn, Sm); | 2465 emitVFPsss(Cond, VmulsOpcode, OpSd, OpSn, OpSm, Vmuls); |
| 2439 } | 2466 } |
| 2440 | 2467 |
| 2441 void AssemblerARM32::vmuld(const Operand *OpDd, const Operand *OpDn, | 2468 void AssemblerARM32::vmuld(const Operand *OpDd, const Operand *OpDn, |
| 2442 const Operand *OpDm, CondARM32::Cond Cond) { | 2469 const Operand *OpDm, CondARM32::Cond Cond) { |
| 2443 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: | 2470 // VMUL (floating-point) - ARM section A8.8.351, encoding A2: |
| 2444 // vmul<c>.f64 <Dd>, <Dn>, <Dm> | 2471 // vmul<c>.f64 <Dd>, <Dn>, <Dm> |
| 2445 // | 2472 // |
| 2446 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, | 2473 // cccc11100D10nnnndddd101sN0M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, |
| 2447 // and Mmmmm=Rm. | 2474 // and Mmmmm=Rm. |
| 2448 constexpr const char *Vmuld = "vmuld"; | 2475 constexpr const char *Vmuld = "vmuld"; |
| 2449 IValueT Dd = encodeDRegister(OpDd, "Dd", Vmuld); | |
| 2450 IValueT Dn = encodeDRegister(OpDn, "Dn", Vmuld); | |
| 2451 IValueT Dm = encodeDRegister(OpDm, "Dm", Vmuld); | |
| 2452 constexpr IValueT VmuldOpcode = B21; | 2476 constexpr IValueT VmuldOpcode = B21; |
| 2453 emitVFPddd(Cond, VmuldOpcode, Dd, Dn, Dm); | 2477 emitVFPddd(Cond, VmuldOpcode, OpDd, OpDn, OpDm, Vmuld); |
| 2454 } | 2478 } |
| 2455 | 2479 |
| 2456 void AssemblerARM32::vstrd(const Operand *OpDd, const Operand *OpAddress, | 2480 void AssemblerARM32::vstrd(const Operand *OpDd, const Operand *OpAddress, |
| 2457 CondARM32::Cond Cond, const TargetInfo &TInfo) { | 2481 CondARM32::Cond Cond, const TargetInfo &TInfo) { |
| 2458 // VSTR - ARM section A8.8.413, encoding A1: | 2482 // VSTR - ARM section A8.8.413, encoding A1: |
| 2459 // vstr<c> <Dd>, [<Rn>{, #+/-<Imm>}] | 2483 // vstr<c> <Dd>, [<Rn>{, #+/-<Imm>}] |
| 2460 // | 2484 // |
| 2461 // cccc1101UD00nnnndddd1011iiiiiiii where cccc=Cond, nnnn=Rn, Ddddd=Rd, | 2485 // cccc1101UD00nnnndddd1011iiiiiiii where cccc=Cond, nnnn=Rn, Ddddd=Rd, |
| 2462 // iiiiiiii=abs(Imm >> 2), and U=1 if Imm>=0. | 2486 // iiiiiiii=abs(Imm >> 2), and U=1 if Imm>=0. |
| 2463 constexpr const char *Vstrd = "vstrd"; | 2487 constexpr const char *Vstrd = "vstrd"; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2497 } | 2521 } |
| 2498 | 2522 |
| 2499 void AssemblerARM32::vsubs(const Operand *OpSd, const Operand *OpSn, | 2523 void AssemblerARM32::vsubs(const Operand *OpSd, const Operand *OpSn, |
| 2500 const Operand *OpSm, CondARM32::Cond Cond) { | 2524 const Operand *OpSm, CondARM32::Cond Cond) { |
| 2501 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: | 2525 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: |
| 2502 // vsub<c>.f32 <Sd>, <Sn>, <Sm> | 2526 // vsub<c>.f32 <Sd>, <Sn>, <Sm> |
| 2503 // | 2527 // |
| 2504 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, | 2528 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=0, ddddD=Rd, nnnnN=Rn, |
| 2505 // and mmmmM=Rm. | 2529 // and mmmmM=Rm. |
| 2506 constexpr const char *Vsubs = "vsubs"; | 2530 constexpr const char *Vsubs = "vsubs"; |
| 2507 IValueT Sd = encodeSRegister(OpSd, "Sd", Vsubs); | |
| 2508 IValueT Sn = encodeSRegister(OpSn, "Sn", Vsubs); | |
| 2509 IValueT Sm = encodeSRegister(OpSm, "Sm", Vsubs); | |
| 2510 constexpr IValueT VsubsOpcode = B21 | B20 | B6; | 2531 constexpr IValueT VsubsOpcode = B21 | B20 | B6; |
| 2511 emitVFPsss(Cond, VsubsOpcode, Sd, Sn, Sm); | 2532 emitVFPsss(Cond, VsubsOpcode, OpSd, OpSn, OpSm, Vsubs); |
| 2512 } | 2533 } |
| 2513 | 2534 |
| 2514 void AssemblerARM32::vsubd(const Operand *OpDd, const Operand *OpDn, | 2535 void AssemblerARM32::vsubd(const Operand *OpDd, const Operand *OpDn, |
| 2515 const Operand *OpDm, CondARM32::Cond Cond) { | 2536 const Operand *OpDm, CondARM32::Cond Cond) { |
| 2516 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: | 2537 // VSUB (floating-point) - ARM section A8.8.415, encoding A2: |
| 2517 // vsub<c>.f64 <Dd>, <Dn>, <Dm> | 2538 // vsub<c>.f64 <Dd>, <Dn>, <Dm> |
| 2518 // | 2539 // |
| 2519 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, | 2540 // cccc11100D11nnnndddd101sN1M0mmmm where cccc=Cond, s=1, Ddddd=Rd, Nnnnn=Rn, |
| 2520 // and Mmmmm=Rm. | 2541 // and Mmmmm=Rm. |
| 2521 constexpr const char *Vsubd = "vsubd"; | 2542 constexpr const char *Vsubd = "vsubd"; |
| 2522 IValueT Dd = encodeDRegister(OpDd, "Dd", Vsubd); | |
| 2523 IValueT Dn = encodeDRegister(OpDn, "Dn", Vsubd); | |
| 2524 IValueT Dm = encodeDRegister(OpDm, "Dm", Vsubd); | |
| 2525 constexpr IValueT VsubdOpcode = B21 | B20 | B6; | 2543 constexpr IValueT VsubdOpcode = B21 | B20 | B6; |
| 2526 emitVFPddd(Cond, VsubdOpcode, Dd, Dn, Dm); | 2544 emitVFPddd(Cond, VsubdOpcode, OpDd, OpDn, OpDm, Vsubd); |
| 2527 } | 2545 } |
| 2528 | 2546 |
| 2529 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode, | 2547 void AssemblerARM32::emitVStackOp(CondARM32::Cond Cond, IValueT Opcode, |
| 2530 const Variable *OpBaseReg, | 2548 const Variable *OpBaseReg, |
| 2531 SizeT NumConsecRegs) { | 2549 SizeT NumConsecRegs) { |
| 2532 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg); | 2550 const IValueT BaseReg = getEncodedSRegNum(OpBaseReg); |
| 2533 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register. | 2551 const IValueT DLastBit = mask(BaseReg, 0, 1); // Last bit of base register. |
| 2534 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register. | 2552 const IValueT Rd = mask(BaseReg, 1, 4); // Top 4 bits of base register. |
| 2535 assert(0 < NumConsecRegs); | 2553 assert(0 < NumConsecRegs); |
| 2536 (void)VpushVpopMaxConsecRegs; | 2554 (void)VpushVpopMaxConsecRegs; |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 2567 // | 2585 // |
| 2568 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and | 2586 // cccc11010D101101dddd1010iiiiiiii where cccc=Cond, ddddD=BaseReg, and |
| 2569 // iiiiiiii=NumConsecRegs. | 2587 // iiiiiiii=NumConsecRegs. |
| 2570 constexpr IValueT VpushOpcode = | 2588 constexpr IValueT VpushOpcode = |
| 2571 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; | 2589 B27 | B26 | B24 | B21 | B19 | B18 | B16 | B11 | B9; |
| 2572 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); | 2590 emitVStackOp(Cond, VpushOpcode, OpBaseReg, NumConsecRegs); |
| 2573 } | 2591 } |
| 2574 | 2592 |
| 2575 } // end of namespace ARM32 | 2593 } // end of namespace ARM32 |
| 2576 } // end of namespace Ice | 2594 } // end of namespace Ice |
| OLD | NEW |