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 5455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5466 } | 5466 } |
5467 } | 5467 } |
5468 } | 5468 } |
5469 | 5469 |
5470 | 5470 |
5471 static void FminFmaxFloatHelper(float n, float m, float min, float max, | 5471 static void FminFmaxFloatHelper(float n, float m, float min, float max, |
5472 float minnm, float maxnm) { | 5472 float minnm, float maxnm) { |
5473 SETUP(); | 5473 SETUP(); |
5474 | 5474 |
5475 START(); | 5475 START(); |
5476 // TODO(all): Signalling NaNs are sometimes converted by the C compiler to | 5476 __ Fmov(s0, n); |
5477 // quiet NaNs on implicit casts from float to double. Here, we move the raw | 5477 __ Fmov(s1, m); |
5478 // bits into a W register first, so we get the correct value. Fix Fmov so this | |
5479 // additional step is no longer needed. | |
5480 __ Mov(w0, float_to_rawbits(n)); | |
5481 __ Fmov(s0, w0); | |
5482 __ Mov(w0, float_to_rawbits(m)); | |
5483 __ Fmov(s1, w0); | |
5484 __ Fmin(s28, s0, s1); | 5478 __ Fmin(s28, s0, s1); |
5485 __ Fmax(s29, s0, s1); | 5479 __ Fmax(s29, s0, s1); |
5486 __ Fminnm(s30, s0, s1); | 5480 __ Fminnm(s30, s0, s1); |
5487 __ Fmaxnm(s31, s0, s1); | 5481 __ Fmaxnm(s31, s0, s1); |
5488 END(); | 5482 END(); |
5489 | 5483 |
5490 RUN(); | 5484 RUN(); |
5491 | 5485 |
5492 ASSERT_EQUAL_FP32(min, s28); | 5486 ASSERT_EQUAL_FP32(min, s28); |
5493 ASSERT_EQUAL_FP32(max, s29); | 5487 ASSERT_EQUAL_FP32(max, s29); |
(...skipping 4529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10023 AbsHelperX(-42); | 10017 AbsHelperX(-42); |
10024 AbsHelperX(kXMinInt); | 10018 AbsHelperX(kXMinInt); |
10025 AbsHelperX(kXMaxInt); | 10019 AbsHelperX(kXMaxInt); |
10026 | 10020 |
10027 AbsHelperW(0); | 10021 AbsHelperW(0); |
10028 AbsHelperW(42); | 10022 AbsHelperW(42); |
10029 AbsHelperW(-42); | 10023 AbsHelperW(-42); |
10030 AbsHelperW(kWMinInt); | 10024 AbsHelperW(kWMinInt); |
10031 AbsHelperW(kWMaxInt); | 10025 AbsHelperW(kWMaxInt); |
10032 } | 10026 } |
OLD | NEW |