Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: src/x64/macro-assembler-x64.cc

Issue 10831409: Fix rounding in Uint8ClampedArray setter. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix manual rounding Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform.h ('k') | test/mjsunit/regress/regress-2294.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2839 2839
2840 void MacroAssembler::ClampDoubleToUint8(XMMRegister input_reg, 2840 void MacroAssembler::ClampDoubleToUint8(XMMRegister input_reg,
2841 XMMRegister temp_xmm_reg, 2841 XMMRegister temp_xmm_reg,
2842 Register result_reg, 2842 Register result_reg,
2843 Register temp_reg) { 2843 Register temp_reg) {
2844 Label done; 2844 Label done;
2845 Set(result_reg, 0); 2845 Set(result_reg, 0);
2846 xorps(temp_xmm_reg, temp_xmm_reg); 2846 xorps(temp_xmm_reg, temp_xmm_reg);
2847 ucomisd(input_reg, temp_xmm_reg); 2847 ucomisd(input_reg, temp_xmm_reg);
2848 j(below, &done, Label::kNear); 2848 j(below, &done, Label::kNear);
2849 uint64_t one_half = BitCast<uint64_t, double>(0.5); 2849 cvtsd2si(result_reg, input_reg);
2850 Set(temp_reg, one_half);
2851 movq(temp_xmm_reg, temp_reg);
2852 addsd(temp_xmm_reg, input_reg);
2853 cvttsd2si(result_reg, temp_xmm_reg);
2854 testl(result_reg, Immediate(0xFFFFFF00)); 2850 testl(result_reg, Immediate(0xFFFFFF00));
2855 j(zero, &done, Label::kNear); 2851 j(zero, &done, Label::kNear);
2856 Set(result_reg, 255); 2852 Set(result_reg, 255);
2857 bind(&done); 2853 bind(&done);
2858 } 2854 }
2859 2855
2860 2856
2861 void MacroAssembler::LoadInstanceDescriptors(Register map, 2857 void MacroAssembler::LoadInstanceDescriptors(Register map,
2862 Register descriptors) { 2858 Register descriptors) {
2863 Register temp = descriptors; 2859 Register temp = descriptors;
(...skipping 1641 matching lines...) Expand 10 before | Expand all | Expand 10 after
4505 bind(&check_prototype); 4501 bind(&check_prototype);
4506 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset)); 4502 movq(rcx, FieldOperand(rbx, Map::kPrototypeOffset));
4507 cmpq(rcx, null_value); 4503 cmpq(rcx, null_value);
4508 j(not_equal, &next); 4504 j(not_equal, &next);
4509 } 4505 }
4510 4506
4511 4507
4512 } } // namespace v8::internal 4508 } } // namespace v8::internal
4513 4509
4514 #endif // V8_TARGET_ARCH_X64 4510 #endif // V8_TARGET_ARCH_X64
OLDNEW
« no previous file with comments | « src/platform.h ('k') | test/mjsunit/regress/regress-2294.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698