|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
|
63 | 63 | import static jdk.vm.ci.amd64.AMD64.xmm7;
|
64 | 64 | import static jdk.vm.ci.amd64.AMD64.xmm8;
|
65 | 65 | import static jdk.vm.ci.amd64.AMD64.xmm9;
|
| 66 | +import static jdk.vm.ci.amd64.AMD64Kind.V128_QWORD; |
66 | 67 |
|
67 | 68 | import java.util.ArrayList;
|
68 | 69 | import java.util.Arrays;
|
|
85 | 86 | import jdk.graal.compiler.core.common.LIRKind;
|
86 | 87 | import jdk.vm.ci.amd64.AMD64;
|
87 | 88 | import jdk.vm.ci.amd64.AMD64Kind;
|
| 89 | +import jdk.vm.ci.code.Architecture; |
88 | 90 | import jdk.vm.ci.code.CallingConvention;
|
89 | 91 | import jdk.vm.ci.code.CallingConvention.Type;
|
90 | 92 | import jdk.vm.ci.code.Register;
|
@@ -234,6 +236,16 @@ public RegisterArray getCalleeSaveRegisters() {
|
234 | 236 | return calleeSaveRegisters;
|
235 | 237 | }
|
236 | 238 |
|
| 239 | + @Override |
| 240 | + public PlatformKind getCalleeSaveRegisterStorageKind(Architecture arch, Register calleeSaveRegister) { |
| 241 | + if (Platform.includedIn(Platform.WINDOWS.class)) { |
| 242 | + if (AMD64.XMM.equals(calleeSaveRegister.getRegisterCategory()) && calleeSaveRegister.encoding() >= xmm6.encoding() && calleeSaveRegister.encoding() <= xmm15.encoding()) { |
| 243 | + return V128_QWORD; |
| 244 | + } |
| 245 | + } |
| 246 | + return SubstrateRegisterConfig.super.getCalleeSaveRegisterStorageKind(arch, calleeSaveRegister); |
| 247 | + } |
| 248 | + |
237 | 249 | @Override
|
238 | 250 | public RegisterArray getCallerSaveRegisters() {
|
239 | 251 | return getAllocatableRegisters();
|
@@ -405,7 +417,7 @@ public CallingConvention getCallingConvention(Type t, JavaType returnType, JavaT
|
405 | 417 | kinds = Arrays.copyOf(kinds, kinds.length + 1);
|
406 | 418 | locations = Arrays.copyOf(locations, locations.length + 1);
|
407 | 419 | kinds[kinds.length - 1] = JavaKind.Int;
|
408 |
| - locations[locations.length - 1] = AMD64.rax.asValue(LIRKind.value(AMD64Kind.DWORD)); |
| 420 | + locations[locations.length - 1] = rax.asValue(LIRKind.value(AMD64Kind.DWORD)); |
409 | 421 | if (type.customABI()) {
|
410 | 422 | var extendsParametersAssignment = Arrays.copyOf(type.fixedParameterAssignment, type.fixedParameterAssignment.length + 1);
|
411 | 423 | extendsParametersAssignment[extendsParametersAssignment.length - 1] = AssignedLocation.forRegister(rax, JavaKind.Long);
|
|
0 commit comments