OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2812 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2823 | 2823 |
2824 | 2824 |
2825 void Simulator::VisitFPDataProcessing3Source(Instruction* instr) { | 2825 void Simulator::VisitFPDataProcessing3Source(Instruction* instr) { |
2826 AssertSupportedFPCR(); | 2826 AssertSupportedFPCR(); |
2827 | 2827 |
2828 unsigned fd = instr->Rd(); | 2828 unsigned fd = instr->Rd(); |
2829 unsigned fn = instr->Rn(); | 2829 unsigned fn = instr->Rn(); |
2830 unsigned fm = instr->Rm(); | 2830 unsigned fm = instr->Rm(); |
2831 unsigned fa = instr->Ra(); | 2831 unsigned fa = instr->Ra(); |
2832 | 2832 |
2833 // The C99 (and C++11) fma function performs a fused multiply-accumulate. | |
2834 switch (instr->Mask(FPDataProcessing3SourceMask)) { | 2833 switch (instr->Mask(FPDataProcessing3SourceMask)) { |
2835 // fd = fa +/- (fn * fm) | 2834 // fd = fa +/- (fn * fm) |
2836 case FMADD_s: set_sreg(fd, FPMulAdd(sreg(fa), sreg(fn), sreg(fm))); break; | 2835 case FMADD_s: set_sreg(fd, FPMulAdd(sreg(fa), sreg(fn), sreg(fm))); break; |
2837 case FMSUB_s: set_sreg(fd, FPMulAdd(sreg(fa), -sreg(fn), sreg(fm))); break; | 2836 case FMSUB_s: set_sreg(fd, FPMulAdd(sreg(fa), -sreg(fn), sreg(fm))); break; |
2838 case FMADD_d: set_dreg(fd, FPMulAdd(dreg(fa), dreg(fn), dreg(fm))); break; | 2837 case FMADD_d: set_dreg(fd, FPMulAdd(dreg(fa), dreg(fn), dreg(fm))); break; |
2839 case FMSUB_d: set_dreg(fd, FPMulAdd(dreg(fa), -dreg(fn), dreg(fm))); break; | 2838 case FMSUB_d: set_dreg(fd, FPMulAdd(dreg(fa), -dreg(fn), dreg(fm))); break; |
2840 // Negated variants of the above. | 2839 // Negated variants of the above. |
2841 case FNMADD_s: | 2840 case FNMADD_s: |
2842 set_sreg(fd, FPMulAdd(-sreg(fa), -sreg(fn), sreg(fm))); | 2841 set_sreg(fd, FPMulAdd(-sreg(fa), -sreg(fn), sreg(fm))); |
2843 break; | 2842 break; |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3637 default: | 3636 default: |
3638 UNIMPLEMENTED(); | 3637 UNIMPLEMENTED(); |
3639 } | 3638 } |
3640 } | 3639 } |
3641 | 3640 |
3642 #endif // USE_SIMULATOR | 3641 #endif // USE_SIMULATOR |
3643 | 3642 |
3644 } } // namespace v8::internal | 3643 } } // namespace v8::internal |
3645 | 3644 |
3646 #endif // V8_TARGET_ARCH_ARM64 | 3645 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |