OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 2850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2861 testl(reg, Immediate(0xFFFFFF00)); | 2861 testl(reg, Immediate(0xFFFFFF00)); |
2862 j(zero, &done, Label::kNear); | 2862 j(zero, &done, Label::kNear); |
2863 setcc(negative, reg); // 1 if negative, 0 if positive. | 2863 setcc(negative, reg); // 1 if negative, 0 if positive. |
2864 decb(reg); // 0 if negative, 255 if positive. | 2864 decb(reg); // 0 if negative, 255 if positive. |
2865 bind(&done); | 2865 bind(&done); |
2866 } | 2866 } |
2867 | 2867 |
2868 | 2868 |
2869 void MacroAssembler::ClampDoubleToUint8(XMMRegister input_reg, | 2869 void MacroAssembler::ClampDoubleToUint8(XMMRegister input_reg, |
2870 XMMRegister temp_xmm_reg, | 2870 XMMRegister temp_xmm_reg, |
2871 Register result_reg, | 2871 Register result_reg) { |
2872 Register temp_reg) { | |
2873 Label done; | 2872 Label done; |
2874 Set(result_reg, 0); | 2873 Label conv_failure; |
2875 xorps(temp_xmm_reg, temp_xmm_reg); | 2874 xorps(temp_xmm_reg, temp_xmm_reg); |
2876 ucomisd(input_reg, temp_xmm_reg); | |
2877 j(below, &done, Label::kNear); | |
2878 cvtsd2si(result_reg, input_reg); | 2875 cvtsd2si(result_reg, input_reg); |
2879 testl(result_reg, Immediate(0xFFFFFF00)); | 2876 testl(result_reg, Immediate(0xFFFFFF00)); |
2880 j(zero, &done, Label::kNear); | 2877 j(zero, &done, Label::kNear); |
| 2878 cmpl(result_reg, Immediate(0x80000000)); |
| 2879 j(equal, &conv_failure, Label::kNear); |
| 2880 movl(result_reg, Immediate(0)); |
| 2881 setcc(above, result_reg); |
| 2882 subl(result_reg, Immediate(1)); |
| 2883 andl(result_reg, Immediate(255)); |
| 2884 jmp(&done, Label::kNear); |
| 2885 bind(&conv_failure); |
| 2886 Set(result_reg, 0); |
| 2887 ucomisd(input_reg, temp_xmm_reg); |
| 2888 j(below, &done, Label::kNear); |
2881 Set(result_reg, 255); | 2889 Set(result_reg, 255); |
2882 bind(&done); | 2890 bind(&done); |
2883 } | 2891 } |
2884 | 2892 |
2885 | 2893 |
2886 static double kUint32Bias = | 2894 static double kUint32Bias = |
2887 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1; | 2895 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1; |
2888 | 2896 |
2889 | 2897 |
2890 void MacroAssembler::LoadUint32(XMMRegister dst, | 2898 void MacroAssembler::LoadUint32(XMMRegister dst, |
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4552 | 4560 |
4553 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); | 4561 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); |
4554 cmpq(rcx, null_value); | 4562 cmpq(rcx, null_value); |
4555 j(not_equal, &next); | 4563 j(not_equal, &next); |
4556 } | 4564 } |
4557 | 4565 |
4558 | 4566 |
4559 } } // namespace v8::internal | 4567 } } // namespace v8::internal |
4560 | 4568 |
4561 #endif // V8_TARGET_ARCH_X64 | 4569 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |