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