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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 __ Store(ebx, Operand(esp, 0 * kPointerSize), Representation::UInteger16()); | 116 __ Store(ebx, Operand(esp, 0 * kPointerSize), Representation::UInteger16()); |
117 __ mov(ebx, Operand(esp, 0 * kPointerSize)); | 117 __ mov(ebx, Operand(esp, 0 * kPointerSize)); |
118 __ mov(edx, Immediate(65535)); | 118 __ mov(edx, Immediate(65535)); |
119 __ cmp(ebx, edx); | 119 __ cmp(ebx, edx); |
120 __ j(not_equal, &exit); | 120 __ j(not_equal, &exit); |
121 __ Load(edx, Operand(esp, 0 * kPointerSize), Representation::UInteger16()); | 121 __ Load(edx, Operand(esp, 0 * kPointerSize), Representation::UInteger16()); |
122 __ cmp(ebx, edx); | 122 __ cmp(ebx, edx); |
123 __ j(not_equal, &exit); | 123 __ j(not_equal, &exit); |
124 | 124 |
125 // Test 5. | 125 // Test 5. |
126 if (CpuFeatures::IsSupported(SSE2)) { | 126 __ mov(eax, Immediate(5)); // Test XMM move immediate. |
127 CpuFeatureScope scope(masm, SSE2); | 127 __ Move(xmm0, 0.0); |
128 __ mov(eax, Immediate(5)); // Test XMM move immediate. | 128 __ Move(xmm1, 0.0); |
129 __ Move(xmm0, 0.0); | 129 __ ucomisd(xmm0, xmm1); |
130 __ Move(xmm1, 0.0); | 130 __ j(not_equal, &exit); |
131 __ ucomisd(xmm0, xmm1); | 131 __ Move(xmm2, 991.01); |
132 __ j(not_equal, &exit); | 132 __ ucomisd(xmm0, xmm2); |
133 __ Move(xmm2, 991.01); | 133 __ j(equal, &exit); |
134 __ ucomisd(xmm0, xmm2); | 134 __ Move(xmm0, 991.01); |
135 __ j(equal, &exit); | 135 __ ucomisd(xmm0, xmm2); |
136 __ Move(xmm0, 991.01); | 136 __ j(not_equal, &exit); |
137 __ ucomisd(xmm0, xmm2); | |
138 __ j(not_equal, &exit); | |
139 } | |
140 | 137 |
141 // Test 6. | 138 // Test 6. |
142 __ mov(eax, Immediate(6)); | 139 __ mov(eax, Immediate(6)); |
143 __ Move(edx, Immediate(0)); // Test Move() | 140 __ Move(edx, Immediate(0)); // Test Move() |
144 __ cmp(edx, Immediate(0)); | 141 __ cmp(edx, Immediate(0)); |
145 __ j(not_equal, &exit); | 142 __ j(not_equal, &exit); |
146 __ Move(ecx, Immediate(-1)); | 143 __ Move(ecx, Immediate(-1)); |
147 __ cmp(ecx, Immediate(-1)); | 144 __ cmp(ecx, Immediate(-1)); |
148 __ j(not_equal, &exit); | 145 __ j(not_equal, &exit); |
149 __ Move(ebx, Immediate(0x77)); | 146 __ Move(ebx, Immediate(0x77)); |
150 __ cmp(ebx, Immediate(0x77)); | 147 __ cmp(ebx, Immediate(0x77)); |
151 __ j(not_equal, &exit); | 148 __ j(not_equal, &exit); |
152 | 149 |
153 __ xor_(eax, eax); // Success. | 150 __ xor_(eax, eax); // Success. |
154 __ bind(&exit); | 151 __ bind(&exit); |
155 __ add(esp, Immediate(1 * kPointerSize)); | 152 __ add(esp, Immediate(1 * kPointerSize)); |
156 __ pop(edx); | 153 __ pop(edx); |
157 __ pop(ebx); | 154 __ pop(ebx); |
158 __ ret(0); | 155 __ ret(0); |
159 | 156 |
160 CodeDesc desc; | 157 CodeDesc desc; |
161 masm->GetCode(&desc); | 158 masm->GetCode(&desc); |
162 // Call the function from C++. | 159 // Call the function from C++. |
163 int result = FUNCTION_CAST<F0>(buffer)(); | 160 int result = FUNCTION_CAST<F0>(buffer)(); |
164 CHECK_EQ(0, result); | 161 CHECK_EQ(0, result); |
165 } | 162 } |
166 | 163 |
167 #undef __ | 164 #undef __ |
OLD | NEW |