|
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;
|
@@ -236,6 +238,15 @@ public RegisterArray getCalleeSaveRegisters() {
|
236 | 238 | return calleeSaveRegisters;
|
237 | 239 | }
|
238 | 240 |
|
| 241 | + @Override |
| 242 | + public PlatformKind getCalleeSaveRegisterStorageKind(Architecture arch, Register calleeSaveRegister) { |
| 243 | + if (Platform.includedIn(Platform.WINDOWS.class) && AMD64.XMM.equals(calleeSaveRegister.getRegisterCategory())) { |
| 244 | + VMError.guarantee(calleeSaveRegister.encoding() >= xmm6.encoding() && calleeSaveRegister.encoding() <= xmm15.encoding(), "unexpected callee saved register %s", calleeSaveRegister); |
| 245 | + return V128_QWORD; |
| 246 | + } |
| 247 | + return SubstrateRegisterConfig.super.getCalleeSaveRegisterStorageKind(arch, calleeSaveRegister); |
| 248 | + } |
| 249 | + |
239 | 250 | @Override
|
240 | 251 | public RegisterArray getCallerSaveRegisters() {
|
241 | 252 | return getAllocatableRegisters();
|
@@ -407,7 +418,7 @@ public CallingConvention getCallingConvention(Type t, JavaType returnType, JavaT
|
407 | 418 | kinds = Arrays.copyOf(kinds, kinds.length + 1);
|
408 | 419 | locations = Arrays.copyOf(locations, locations.length + 1);
|
409 | 420 | kinds[kinds.length - 1] = JavaKind.Int;
|
410 |
| - locations[locations.length - 1] = AMD64.rax.asValue(LIRKind.value(AMD64Kind.DWORD)); |
| 421 | + locations[locations.length - 1] = rax.asValue(LIRKind.value(AMD64Kind.DWORD)); |
411 | 422 | if (type.customABI()) {
|
412 | 423 | var extendsParametersAssignment = Arrays.copyOf(type.fixedParameterAssignment, type.fixedParameterAssignment.length + 1);
|
413 | 424 | extendsParametersAssignment[extendsParametersAssignment.length - 1] = AssignedLocation.forRegister(rax, JavaKind.Long);
|
|
0 commit comments