dmul 0x6b

Multiplies two doubles on top of the stack; pushes the result.

Opcode
0x6b (107)
Family
Arithmetic and bitwise
Operands
none
Length
1 byte
Operand stack
…, value1 (double), value2 (double) → …, result (double)
Can throw
nothing at run time (beyond linking errors)

What it does

a * b on two doubles: pops b, then a, and pushes the result.

How often javac uses it

In JDK 25.0.5's java.base module, dmul appears 466 times in 41 of its 7,391 classes: 0.02% of all instructions, the 125th most common of 194 opcodes in use. Some of the methods that use it: java.io.StreamTokenizer.nextToken, java.lang.ClassValue$ClassValueMap.sizeCache, java.lang.FdLibm$Acos.compute, java.lang.FdLibm$Asin.compute.

Examples

From the sample classes, compiled by javac 25 with -g. Each Java line is shown above the bytecode it compiled to; dmul is highlighted.

static double doubles(double a, double b) in Tour, compiled by javac 25
31double x = a + b - a * b;
0dload_0 // a
1dload_2 // b
3dload_0 // a
4dload_2 // b
7dstore 4// x
32x = x / b % 7;
9dload 4// x
11dload_2 // b
12ddiv
13ldc2_w #14// 7
… 9 instructions after

Open in the viewer

static long mix(long a, int b, short c, byte d, double e, float f, char g, boolean h) in Numbers, compiled by javac 25
… 10 instructions before
30long r = a * b + c - d;
11lstore 10// r
31r ^= (long) (e * f);
13lload 10// r
15dload 5// e
17fload 7// f
19f2d
20dmul
21d2l
22lxor
23lstore 10// r
32r += g;
25lload 10// r
27iload 8// g
29i2l
… 47 instructions after

Open in the viewer

Related instructions

imul Multiplies two ints on top of the stack; pushes the result.lmul Multiplies two longs on top of the stack; pushes the result.fmul Multiplies two floats on top of the stack; pushes the result.

Specification: JVMS §6.5, dmul (Java SE 25).